cancel
Showing results for 
Search instead for 
Did you mean: 

RAP Managed Action RESULT is not updating the Response

shubham_banerjee
Participant
0 Kudos
118

Hi All,

I am working on a RAP Managed scenario with Unmanaged save. I have 2 actions as following,

  1. Test: Update few fields of the entityset and return the updated fields.
  2. Post: Execute BGMC Operation.

I have checked the post https://community.sap.com/t5/technology-q-a/rap-action-does-not-update-the-instance/qaq-p/12531084 however the issue remains.

My action is,

 

action test result [1..*] $self;

 

My bdef mapping is,

 

create;
update;
action test result [1..*] $self;
action post;
mapping for zasset
{
message = message;
}

 

My action implementation is

 

METHOD test for MODIFY
IMPORTING keys FOR ACTION Asset~test RESULT result.

METHOD test .
MODIFY ENTITIES OF zasset IN LOCAL MODE
ENTITY Asset
UPDATE FIELDS ( message )
WITH VALUE #( FOR <fs> IN keys ( %tky = <fs>-%tky message = 'Test' ) )
FAILED DATA(lt_failed) REPORTED DATA(lt_reported) .

READ ENTITIES OF zasset IN LOCAL MODE
ENTITY Asset ALL FIELDS WITH CORRESPONDING #( keys ) RESULT DATA(lt_result) .

result = VALUE #( FOR <fs> IN lt_result ( %tky = <fs>-%tky %param = <fs> ) ) .
ENDMETHOD .

 

The requirement is to fill the message field with some messages after validating the keys whenever user clicks on the action TEST, like a simulation. The POST action is responsible for COMMIT to the database.

The result structure is having the updated value for the message field, however the response is not being updated either in browser or postman.

@Andre_Fischer, could you please help me here.

 

 

Accepted Solutions (0)

Answers (1)

Answers (1)

MioYasutake
Active Contributor
0 Kudos

Hi @shubham_banerjee,

Why is the action cardinality [1..*], instead of [1] ?