PARAMETERS carrid TYPE char128.
DATA : BEGIN OF itab OCCURS 0,
carrid TYPE sflight-carrid,
END OF itab.
*Declare internal tables and work area.
DATA : rtab TYPE TABLE OF ddshretval WITH HEADER LINE,
ptab TYPE TABLE OF ddshretval WITH HEADER LINE,
ls_sel TYPE ddshretval,
ls_mark TYPE ddshmarks.
REFRESH rtab.
rtab-fieldname = 'CARRID'.
APPEND rtab.
*for f4 help use AT SELECTION-SCREEN ON VALUE-REQUEST
AT SELECTION-SCREEN ON VALUE-REQUEST FOR carrid.
SELECT carrid FROM sflight INTO TABLE itab.
IF sy-subrc = 0.
SORT itab BY carrid.
DELETE ADJACENT DUPLICATES FROM itab COMPARING carrid.
ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
retfield = 'CARRID'
* PVALKEY = ' '
dynpprog = sy-repid
dynpnr = sy-dynnr
* DYNPROFIELD = ' '
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
value_org = 'S'
multiple_choice = 'X' " Allows to select multiple records
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* mark_tab = ls_mark
* IMPORTING
* USER_RESET =
TABLES
value_tab = itab
* FIELD_TAB =
return_tab = rtab " This holds multiple records
* DYNPFLD_MAPPING =
* EXCEPTIONS
* PARAMETER_ERROR = 1
* NO_VALUES_FOUND = 2
* OTHERS = 3 .
.
IF sy-subrc = 0.
*After F4 event rtab holds one value only so store them in other internal table
ptab[] = rtab[].
ENDIF.
LOOP AT ptab INTO DATA(ls_tab).
IF sy-tabix NE 1 AND ls_tab-fieldval IS NOT INITIAL.
CONCATENATE carrid ',' ls_tab-fieldval INTO carrid.
ELSE.
carrid = ls_tab-fieldval.
ENDIF.
CLEAR ls_tab.
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
3 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 |