cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

MODIFY ENTITY CREATE doesn't return reported, failed items to report

Kostiantyn_K
Participant
0 Likes
3,462

Hello, experts

I have a little problem with MODIFY ENTITY CREATE EML command.

I created report for importing data into DB table which will be used by RESTful application. RESTfull application has its own determinations and validations. In order to do not repeat the code I use MODIFY ENTITY CREATE in that report to save data to DB. Everything work fine data is saved, determinations work in case if no error during validation process. In case of error during validation return parameters FAILED and REPORTED are empty but MAPPED filled by record and looks like this line is saved to DB, but actually no.

So question is why report doesn't get such records, but in behavior implementation class everything work as expected.

andre.fischer maybe you can help?

Thank you in advance

Code example

    LOOP AT it_items ASSIGNING FIELD-SYMBOL(<line>).
ASSIGN <line>->* TO <item>.
MODIFY ENTITIES OF zi_xpl_link_stores_rtp
ENTITY storeslink
CREATE FIELDS ( teamid distrchanextid salesorgextid storezoneid extraplacementid extstoreid explpriority )
WITH VALUE #(
( %cid = |{ <item>-teamid } { <item>-distrchanextid } { <item>-salesorgextid } { <item>-storezoneid } { <item>-extraplacementid } { <item>-extstoreid } { <item>-explpriority }|
teamid = <item>-teamid
distrchanextid = <item>-distrchanextid
salesorgextid = <item>-salesorgextid
storezoneid = <item>-storezoneid
extraplacementid = <item>-extraplacementid
extstoreid = <item>-extstoreid
explpriority = <item>-explpriority ) )
FAILED DATA(ls_failed)
REPORTED DATA(ls_reported)
MAPPED DATA(ls_mapped).
      IF ls_failed IS INITIAL.

COMMIT ENTITIES.
ELSE.
ENDIF.
View Entire Topic
dhegde
Participant
0 Likes

Hi Kostiantyn,

Validations are invoked during the save sequence, pricisely during "check_before_save" step. i.e. they are not called on MODIFY ENTITIES..

Further, determinations are always called before the validations. Messges raised from validatsion are available as a response to "COMMIT ENTITIES..." when used with addition either `RESPONSE OF .... REPORTED ... FAILED ...` or `BEGIN RESPONSE OF .... REPORTED .... FAILED .... `.

Help documentation on Validations states this.

For example,

COMMIT ENTITIES RESPONSE OF ZDH_R_OrderHeaderMngdTP REPORTED DATA(ls_save_reported) FAILED DATA(ls_save_failed).

Hope this helps.

Cheers!

Dhananjay

Kostiantyn_K
Participant

Hi, Dhananjay

Thank you for your answer it solved my problem.

Live and learn 😉