cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP RAP: Edit button not getting Disabled on Object Page

sri_vishnu
Product and Topic Expert
Product and Topic Expert
0 Kudos
444

Hello Experts,

The things done so far, in an Unmanaged RAP application with draft

In Behavior Implementation, defined update action with features: instance

 

 

update ( features: instance );
delete ( features: instance );

 

 

In get_instance_features method I disable the update and delete actions  when variable lv_import_id is filled and vice versa

Only the Delete buttion is getting disabled (greyed out) but not Edit button when variable lv_import_id is filled with the below code

Can you give me a hint, what might be the issue? Please let me know if you need any more information

 

 

    LOOP AT keys INTO DATA(key).

      APPEND VALUE #(

           %tky = key-%tky

           %update = COND #( WHEN lv_import_id IS NOT INITIAL
                                          THEN if_abap_behv=>fc-o-disabled
                                          ELSE if_abap_behv=>fc-o-enabled )

           %delete = COND #( WHEN lv_import_id IS NOT INITIAL
                                          THEN if_abap_behv=>fc-o-disabled
                                          ELSE if_abap_behv=>fc-o-enabled )

                     ) TO result.

    ENDLOOP.

 

 

 @Andre_Fischer . @patrick_winkler 

View Entire Topic
junwu
Active Contributor
I quickly tried in my system, it didn't hide the edit button,
but it gives error(says operation not enabled) when you click edit button.

 

 

   draft action ( features : instance ) Edit;
LOOP AT keys INTO DATA(key).

      APPEND VALUE #(

           %tky = key-%tky

%action-edit = if_abap_behv=>fc-o-disabled

                     ) TO result.

    ENDLOOP.

 

 

sri_vishnu
Product and Topic Expert
Product and Topic Expert
0 Kudos
@ junwu, thank you very much for your response! I now realize that the Edit button I see at the top of Object page is coming from the "draft action ( features : instance ) Edit". My purpose was to just input disable the Edit button, which I am now able to do with "%action-edit = if_abap_behv=>fc-o-disabled". I mistakenly, thought that the Edit button was coming through standard action Update (just like Delete) but it doesn't. I believe when we have Draft functionality with Edit action, then it overrides the Update action and it is the %action-edit that we need to manipulate in get_instance_features method to control the Edit button
junwu
Active Contributor
0 Kudos
if your issue is solved, please select the correct answer to close the thread.