cancel
Showing results for 
Search instead for 
Did you mean: 

Create button unavailable in SAP RAP ODATA V4

Mayursatardekar
Explorer
0 Kudos

Hi Experts,

I am trying to create a simple APP using RAP. I created a behavior definition without draft and created a ODATA V4 service, when I checked the preview, the CREATE button was missing on the page, so i checked online and i found out that if one is creating an ODATA V4 service, Draft functionality is mandatory, so I add Draft functionality, but after adding the Draft functionality, the create button is still missing, I check in BAS as well, it is not showing the Create button.

managed implementation in class zbp_i_qenbill unique;

strict ( 2 );

with draft;

define behavior for ZI_QENBILL alias Invoice

persistent table zqen_billingdata

draft table zqen_df_billdata

lock master total etag Locallastchangedat

authorization master ( instance )

etag master Locallastchangedat

{

create;

update;

delete;

field(readonly) Accountid;

field(readonly) Projectid;

field(readonly) Associateid;

mapping for zi_qenbill

{

// Accountid = accountid;

Projectid = projectid;

Associateid = associateid;

Accountname = accountname;

Projectname = projectname;

Associatename = associatename;

Associaterole = associaterole;

Deliverymanager = deliverymanager;

PoSow = posow;

Bdm = bdm;

Location = location;

Billfrom = billfrom;

Billto = billto;

Billinghours = billinghours;

Billingrate = billingrate;

Totalamount = totalamount;

Invoiceamount = invoiceamount;

Status = status;

Runrate = runrate;

Locallastchangedat = locallastchangedat;

Locallastchanged = locallastchanged;

}

draft action Edit;

draft action Discard;

draft action Activate;

draft action Resume;

draft determine action Prepare;

}

View Entire Topic
Andre_Fischer
Product and Topic Expert
Product and Topic Expert

You also have to use the statement

use draft;

in the behavior definition of the projection layer.

So your BDEF projection should look as follows:

projection;

strict( 2 ) ;

use draft;

Did you do that?

In addtion you would have to set a

use create;

statement there as well.

Mayursatardekar
Explorer

sorry for replying late, but yes it did work, thank you for your response

TylerFincham
Discoverer
0 Kudos
How can we implement create and edit button without draft?