on 2024 Oct 18 9:12 PM
Hi Gurus,
I have created V4 API using Unmanaged RAP Scenario... When I am trying to create record using API in Gateway test tool, records are getting creating in Draft mode and they are not getting Saved. SAVE method is not getting triggered... I have Implemented Early Numbering which is getting triggered along with Create Method...
Everything is working fine when I using testing same service using Preview Option in Eclipse.
Please help what am I missing...
Early Numbering code
METHOD earlynumbering_create.
DATA: l_tanum TYPE /scwm/tanum,
l_returncode(1) TYPE c.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = '01'
object = wmegc_nrobj_to
subobject = 'WD01'
IMPORTING
number = l_tanum
returncode = l_returncode
EXCEPTIONS
interval_not_found = 1.
LOOP AT entities ASSIGNING FIELD-SYMBOL(<lfs_entities>).
l_tanum = l_tanum + 1.
mapped-warehousetask = VALUE #(
FOR ls_entities IN entities WHERE ( tanum is INITIAL )
(
%cid = ls_entities-%cid
%is_draft = ls_entities-%is_draft
tanum = l_tanum
)
).
ENDLOOP.
ENDMETHOD.
Behavior Definition
unmanaged implementation in class zbp_i_openwt unique;
strict;
with draft;
define behavior for ZI_OPENWT alias WarehouseTask
draft table Zordim_o_d
//late numbering
early numbering
lock master
total etag ChangeAt
authorization master ( global )
etag master ChangeAt
{
create;
update;
delete;
field ( readonly ) Tanum;
field ( readonly ) CreatedBy;
field ( readonly ) Letyp;
field ( readonly ) CreatedAt;
draft action Edit;
draft action Activate;
draft action Discard;
draft action Resume;
draft determine action Prepare;
mapping for /scwm/ordim_o {
Lgnum = lgnum;
Tanum = tanum;
Letyp = letyp;
Procty = procty;
Tostat = tostat;
Vlenr = vlenr;
ChangeAt = changed_at;
CreatedAt = created_at;
CreatedBy = created_by;
}
}
CREATE method
METHOD create.
DATA: lo_entity_store TYPE REF TO zcl_datastore_rap,
ls_entity TYPE /scwm/s_ordim_o_rf.
lo_entity_store = zcl_datastore_rap=>get_object( ).
LOOP AT entities ASSIGNING FIELD-SYMBOL(<lfs_owt>).
ls_entity-vlenr_o = <lfs_owt>-vlenr.
ls_entity-nlpla_o = <lfs_owt>-nlpla.
INSERT VALUE #( %cid = <lfs_owt>-%cid ) INTO TABLE mapped-warehousetask.
ENDLOOP.
lo_entity_store->put_data( data_in = ls_entity ).
ENDMETHOD.
Please help.
Thanks-
Request clarification before answering.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you specifiy the "with unmanaged save"?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
41 | |
15 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.