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

Unmanaged Application, custom actions. enable/disable not working using features instance

0 Likes
1,438

Hi,

In my RAP Unmanaged Application, I have custom actions which need to enable/disable using features instance. But this features instance method is not triggered while selecting the line item. Hence not able to read the condition to make the custom actions disble or enable.

View Entire Topic
0 Likes

I have the requirment to enable disable a button at item level in Objet Page based on the status of Header and items. Code is given below for your reference..

READ ENTITIES OF zc_ewm_stock_header IN LOCAL MODE
ENTITY item
FIELDS ( status ) WITH CORRESPONDING #( keys )
RESULT DATA(result_i)
ENTITY item BY \_header
FIELDS ( status ) WITH CORRESPONDING #( keys )
RESULT DATA(result_h)
FAILED failed.

IF failed IS INITIAL.

result = VALUE #( FOR <fs_i> IN result_i
                              LET statusval_h = COND #( WHEN line_exists( result_h[ status = '01' ] )
                                                                           AND ( <fs_i>-status = 'W' OR
                                                                                      <fs_i>-status = 'E4' )
                                                                          THEN if_abap_behv=>fc-o-enabled
                                                                           ELSE if_abap_behv=>fc-o-disabled )
                             IN ( %features-%action-stck_sync = statusval_h
                                    %tky = <fs_i>-%tky
                                    requestid = <fs_i>-requestid
                                    sequencenumber = <fs_i>-sequencenumber
                                    currentcount = <fs_i>-currentcount ) ).

ENDIF.

0 Likes

Also in behavior definition add below logic.

action ( features: instance ) stck_sync result [1] $self;
Also don't forget to add it in projection behavior definition.

use action stck_sync;