ABAP – Reading a feature with return value

In ABAP we can read a FEATURE and can return the value from the feature using the below function Module HR_FEATURE_BACKFIELD.

I have showed here fetching the value WERKS from the feature VEBZU.

CALL FUNCTION ‘HR_FEATURE_BACKFIELD’
EXPORTING
FEATURE                     = ‘VEBZU’
STRUC_CONTENT               = pme01
*     KIND_OF_ERROR               =
IMPORTING
BACK                        = l_werks
EXCEPTIONS
DUMMY                       = 1
ERROR_OPERATION             = 2
NO_BACKVALUE                = 3
FEATURE_NOT_GENERATED       = 4
INVALID_SIGN_IN_FUNID       = 5
FIELD_IN_REPORT_TAB_IN_PE03 = 6
OTHERS                      = 7.

 
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.

 

After executing this functional module the return value from the feature will stored in the variable l_werks.

0 Comments

Leave A Reply