Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- METHOD /iwbep/if_mgw_appl_srv_runtime~execute_action.
- DATA: ls_fnset TYPE zcl_zreact_app_mpc=>ts_fnimportset,
- et_fnset TYPE zcl_zreact_app_mpc=>tt_fnimportset,
- lv_user TYPE sy-uname.
- DATA(lv_fnName) = io_tech_request_context->get_function_import_name( ).
- CASE lv_fnName.
- WHEN 'fnImportDemo3'.
- LOOP AT it_parameter ASSIGNING FIELD-SYMBOL(<fs>).
- IF <fs> IS ASSIGNED.
- IF <fs>-name EQ 'userName'.
- lv_user = <fs>-value.
- ENDIF.
- ENDIF.
- ENDLOOP.
- TRANSLATE lv_user TO UPPER CASE.
- AUTHORITY-CHECK OBJECT 'ZBTN' FOR USER lv_user ID 'ACTVT' FIELD '02' .
- ls_fnset-hasAccess = abap_false.
- IF sy-subrc EQ 0.
- ls_fnset-message = lv_user && ' has access'.
- ls_fnset-hasAccess = abap_true.
- ELSE.
- ls_fnset-message = lv_user && ' has no access'.
- ENDIF.
- APPEND ls_fnset TO et_fnset.
- copy_data_to_ref( EXPORTING is_data = et_fnset
- CHANGING cr_data = er_data ).
- ENDCASE.
- ENDMETHOD.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement