cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP RAP : How to Identify selected rows of child entity inside Create By Association Method ?

akshay154
Explorer
0 Kudos

Business Scenario :
While creating Parent entity I am populating data for child entities and displaying it to the user. The user can then select relevant child entity records which they want to be associated with the Parent entity. ( rest child entity records should not be considered inside Create By association method implementation ).

For Example:

Suppose Reference Account Details is a child entity with 3 records. The user selects first 2 records and hits CREATE. Then I need a way to pass this information to CREATE BY ASSOCIATION method implementation so that I can discard the 3rd record which was not selected by the user while creating Parent entity.

But the IMPORTING PARAMETER "entities_cba" for CREATE BY ASSOCIATION method contains all the 3 records and I am unable to find out which records were selected by the user.

Is this possible to achieve via RAP ?

Thanks & Regards

Akshay Verma

Accepted Solutions (1)

Accepted Solutions (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Akshay,

maybe the question "how can this be achieved by RAP" is not correct.

Getting instance specific information can be achieved by using instance specific actions as I have described.

This is what your use case is about as you have described it. User selects three child entities and wants to do something based on this information.

When you use Fiori Elements the new action can be added to your UI automatically and it would not require you to change the app itself. The button could be added in addition or you can decide to hide the create button if that is not needed.

If you are building a custom UI I would suggest to put the logic on the UI side instead.

Kind regards,

Andre

akshay154
Explorer
0 Kudos

Hi andre.fischer ,

Thank you for your guidance. I will try to implement your suggestion.

Thanks & Regards,

Akshay Verma

Answers (1)

Answers (1)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

What about creating a custom (instance based) action?

This way you receive the keys of the selected entities.

akshay154
Explorer
0 Kudos

Hi Andre,

Thanks for answering, I think using a custom action would get us the keys but it would require a design change to the app,

Is there any other way to achieve it via RAP ?

Thanks & Regards,

Akshay Verma