Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 1

 How to use TVARV table in my dialog program


 Maintain list of variable ***************
 - use STVARV to maintain list of  values,
 - select tab SELECTION OPTIONS
 -enter name ZFIELD001
 -click on yellow arrow
 -write down list of value

 ******* AT value request ***************
 PROCESS ON VALUE-REQUEST.
 field   ZTAB-FIELD001     MODULE f4_field001.

 ***** Module *******
 MODULE  f4_field001  INPUT.
 data:
       lt_outtab        type table of DDSHRETVAL ,
       ls_outtab        type          DDSHRETVAL.
 select * from TVARVC into GT_TVARVC where name = 'ZFIELD001''.
   CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
     EXPORTING
       DDIC_STRUCTURE  = 'TVARVC'
       RETFIELD        = 'LOW'
       VALUE_ORG       = 'S'
     TABLES
       VALUE_TAB       = GT_TVARVC
       RETURN_TAB      = lt_outtab
     EXCEPTIONS
       PARAMETER_ERROR = 1
       NO_VALUES_FOUND = 2
       OTHERS          = 3.
 if sy-subrc = 0.
     read table lt_outtab into ls_outtab index 1.
     if sy-subrc = 0.
       ZTAB-FIELD001 = ls_outtab-FIELDVAL.
       endif.
   endif.
   clear: lt_outtab ,ls_outtab,gt_knvk, gs_knvk.

You might also like