5 CRUD practical full
5 CRUD practical full
Go to SEGW
method FI01_BANKSET_GET_ENTITY.
READ TABLE it_key_tab INTO DATA(wa_key_tab)
WITH KEY name = 'COUNTRY'."read it_key_tab it_key_tab
if sy-subrc EQ 0.
DATA(lv_COUNTRY) = wa_key_tab-value.
ENDIF.
if sy-subrc EQ 0.
DATA(lv_KEY) = wa_key_tab-value.
ENDIF.
endmethod.
10.Activate code
11.Activate and maintain service - /n/iwfnd/maint_service
12.Put initials of service and press get service. Double clk on your service name.
https://www.youtube.com/watch?v=K0Qu8SGnaT8&list=PLmajIBPiks11NU41T8G149D5hf-o1o
Bqs&index=5 17.47
13.Dbl clk on service Below screen comes with details. Press next.
14.Service get added
15.Go back find your service and press SAP Gateway Client
16.Below screen will popup
17.Select GET radio button and press entity set
method FI01_BANKSET_GET_ENTITYSET.
Endmethod.
/sap/opu/odata/sap/ZJI_CRUD1_SRV/FI01_BANKSet
21.To pass parameters to get_entityset method we use $filter method
a. It is a case sensitive method.
b. ?$filter=COUNTRY eq 'US' and KEY eq '011000390'
c. Write below code to accesses filter using select options
method FI01_BANKSET_GET_ENTITYSET.
DATA : LV_COUNTRY TYPE BANKS.
DATA : LV_KEY TYPE BANKL.
endmethod.
22.
23.https://www.youtube.com/watch?v=K0Qu8SGnaT8&list=PLmajIBPiks11NU41T8G149D5
hf-o1oBqs&index=5 19
24.CREATE
a. Redefine CREATE_ENTITY method
ENDIF.
endmethod.
25.(COUNTRY='DE',KEY='10000001')
26.Exception
a. There are 2 exception class. As per you call BAPI or insert operation DB see its
output then raise exception
i. Business exception
ii. Technical exception
b.
27.UPDATE
a. Use filter options for filter data key to update
b. From workarea use data to direct modify
method FI01_BANKSET_UPDATE_ENTITY.
BREAK-POINT.