Function Module Get Feature

    CALL FUNCTION 'HR_FEATURE_BACKFIELD'
      EXPORTING
        feature       = lv_featurename
        struc_content = ls_struc
      IMPORTING
        back          = ls_back.

Untuk structure dari feature bisa dilihat dengan tcode PE03 dan masukan nama feature-nya, pilih menu Goto >> Structure.

Bila diperlukan, dalam feature bisa memanggil subroutine yang dicode oleh ABAPer. Adapun format untuk subrotine-nya adalah sbb :

REPORT  zfeature.
*&--------------------------------------------------------------------*
*&      Form  ext_call_f
*&--------------------------------------------------------------------*
*      -- > NAMEN      text
*      < -- BACK       text
*      < -- STATUS     text 
*      -- > STRUCT     text
*---------------------------------------------------------------------*
FORM ext_call_f USING namen back status struc .
  DATA : BEGIN OF wa_struc,
          xxx1 TYPE char4,
          xxx2 TYPE char1,
          xxx3 TYPE char2,
          xxx4 TYPE char4,
          xxx5 TYPE char4,
          xxx6 TYPE numc1,
        END OF wa_struc.

  DATA: molga LIKE t500l-molga.
  DATA: model TYPE CHAR20.
  DATA: fname LIKE tfdir-funcname VALUE 'HR_ADDON_FEATURE_F_XX'.

  CHECK sy-pfkey  'DIS'.

* get the MOLGA from incomming structure
  IF NOT molga IS INITIAL.
*   compose the name of the FM to be called per country from MOLGA
    REPLACE 'XX' WITH molga INTO fname.
    CALL FUNCTION 'FUNCTION_EXISTS'
      EXPORTING
        funcname           = fname
      EXCEPTIONS
        function_not_exist = 1
        OTHERS             = 2.
  ENDIF.

*PUT YOUR CODE IN HERE
*PUT YOUR CODE IN HERE
*PUT YOUR CODE IN HERE
*PUT YOUR CODE IN HERE

  back = ZZZZ. "result of feature

ENDFORM.                    "ext_call_f
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s