sap abap f4 help from internal table

Objective : The objective of this abap code is to select the user name who has created the PO in the given po creation date range, and display that values as F4 help for selecting the user name.

REPORT Z2020042401.

tables ekko.

DATAit_return LIKE ddshretval OCCURS WITH HEADER LINE.

SELECTION-SCREEN begin of BLOCK b1 WITH FRAME TITLE text-001.
  select-OPTIONS  s_ebeln for ekko-ebeln,
                    s_aedat for ekko-aedat,
                    s_ernam for ekko-ernam MODIF ID HID,
                    s_bsart for ekko-bsart MODIF ID DIS.
SELECTION-SCREEN end of BLOCK b1.

INITIALIZATION.

"set the default po creation date from last 1 year to till date

 S_AEDAT-SIGN     =  'I'.
 S_AEDAT-OPTION   'BT'.
 S_AEDAT-LOW      SY-DATUM 365.
 S_AEDAT-HIGH     SY-DATUM.
 APPEND S_AEDAT.


 AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_ERNAM-LOW.

"select unique user names who has created po in given po creation date

 select DISTINCT ernam from EKKO into TABLE @data(gt_ernam)
 WHERE AEDAT in @S_AEDAT.

if gt_ernam[] is NOT INITIAL.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
  EXPORTING
*   DDIC_STRUCTURE         = ' '
    RETFIELD               'ERNAM'
*   PVALKEY                = ' '
*   DYNPPROG               = ' '
*   DYNPNR                 = ' '
*   DYNPROFIELD            = ' '
*   STEPL                  = 0
*   WINDOW_TITLE           =
*   VALUE                  = ' '
   VALUE_ORG               'S'
*   MULTIPLE_CHOICE        = ' '
*   DISPLAY                = ' '
*   CALLBACK_PROGRAM       = ' '
*   CALLBACK_FORM          = ' '
*   CALLBACK_METHOD        =
*   MARK_TAB               =
* IMPORTING
*   USER_RESET             =
  TABLES
    VALUE_TAB              GT_ERNAM
*   FIELD_TAB              =
   RETURN_TAB              it_return
*   DYNPFLD_MAPPING        =
 EXCEPTIONS
   PARAMETER_ERROR        1
   NO_VALUES_FOUND        2
   OTHERS                 3
          .
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.

  WRITE it_return-fieldval TO S_ERNAM-LOW.
  REFRESH gt_ernam.


endif.

START-OF-SELECTION.
"code logic
end-of-SELECTION.

""""""""""""""""""""""""""



click on F4 help at created by.







Post a Comment

0 Comments

Total Pageviews