cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi All,

My requirement is that when a user clicks 'edit,' an action should execute based on certain conditions, and this action requires a parameter. How can we ensure that when the user clicks 'edit,' the required parameter is passed along?

0 Likes
View Entire Topic
ankahit
Participant
0 Likes

No, I want parameter to be fill by User and not via program 

patrick_winkler
Product and Topic Expert
Product and Topic Expert
0 Likes

I don't think you can add a user input to the default Edit action. Never tried it myself, but you can try this: Set the Edit action to internal so that it no longer appears. Instead, create a new button Edit2 with the user input. In the Edit2 runtime, you then call the internal edit action. The latter may not be allowed by the RAP framework at this point in time.

ankahit
Participant
0 Likes
Hey Patrick, how to set edit action to internal?
patrick_winkler
Product and Topic Expert
Product and Topic Expert
0 Likes

In the behavior definition: "internal draft action Edit;"

ankahit
Participant
0 Likes
Hi Patrick, I am trying this but unable to call edit action due to %Cid missing. Do you have any code snippet? That will be really helpful and will solve problem.
patrick_winkler
Product and Topic Expert
Product and Topic Expert
0 Likes

You can use AUTO FILL CID

MODIFY ENTITY IN LOCAL MODE zi_cubco6_s
      EXECUTE edit AUTO FILL CID with VALUE #( FOR key IN keys ( %key = CORRESPONDING #( key )
                                                                 %param-preserve_changes = abap_true ) ).

if not available

MODIFY ENTITY IN LOCAL MODE zi_cubco6_s
      EXECUTE edit FROM VALUE #( FOR key IN keys INDEX INTO idx ( %cid = |CID{ idx }|
                                                                  %key = CORRESPONDING #( key )
                                                                  %param-preserve_changes = abap_true ) ).


 

ankahit
Participant
0 Likes
Hi Patrick, Firstly, thank you so much for your assistance. I followed your suggestions, but unfortunately, they didn't work. This issue persists where my object page remains uneditable.
ankahit
Participant
0 Likes
Hi @patrick_winkler , I've made some progress on our project and we've decided to adopt a new approach. Specifically, we're enabling the edit button upon action click. However, I've encountered a few issues that I need assistance with. Firstly, when attempting to update the data of the action parameter in the draft, I'm encountering an error because there are no existing entries in the draft. The error message indicates that the 'draft instance is locked and cannot be edited'. Additionally, I tried creating with draft functionality enabled, but received an error stating that the same primary key already exists. My main concern now is ensuring that when a custom action is triggered, the data is stored in the draft table. Subsequently, when I click on edit later on, I expect the data to be retrievable from the draft table. Your insights on resolving this would be greatly appreciated.