REPORT  ZTEST_11.
parameters :name(20) type c.
data:begin of itab occurs 0 ,
    value(20),
end of itab,  
choise like sy-tabix.
at selection-screen on value-request for name.
perform f4 changing name.
*&---------------------------------------------------------------------*
*&      Form  F4
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      <--P_NAME  text
*----------------------------------------------------------------------*
FORM F4  CHANGING P_NAME.
itab-value = 'sap'.
    append itab.
    itab-value = 'sap1'.
    append itab.
    itab-value = 'sap2'.
    append itab.
    CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
      EXPORTING
        ENDPOS_COL         = 40
        ENDPOS_ROW         = 12
        STARTPOS_COL       = 20
        STARTPOS_ROW       = 5
        TITLETEXT    = 'Select an ID'
    IMPORTING
         CHOISE       = choise
     TABLES
          VALUETAB     =  itab
     EXCEPTIONS
          BREAK_OFF    = 1
          OTHERS       = 2.
CHECK choise > 0.
clear screen.
READ TABLE itab INDEX choise.
name = itab-value.
    IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
ENDFORM.                    " F4
 
 
No comments:
Post a Comment