The goal of the following code is to help to extract data of TCODE: TVARV (Table TVARVC). Used a class for extract data, function module for create the code automatic and display for copy the code.
Access to Tcode: TVARV and click en new code "Generation Code" and display a Source code for extract data of the table TVARVC
Advantage:
Access centralized of TVARVC
Automatic Code Generation for to extract data
Can be used for generation range for multiple value.
Centralizederror messages (when the data in TVARVC not are found it).
Disadvantages:
Modify the standar code of STVARV - Selection variable maint. (TVARV) , but only in DEV Server
Video Demo
The following video display "How do you do for extract data"
Group Function ZTVARV & Function Module Z_TVARV_GEN_CODE (Not necessary transport to Production)
Class with statics methods ZCL_TVARV (This class must be transport to Producction)
Test Program: ZTVARV_TEST (Not necessary transport to Production)
The following changeshave tobe done manually:
Modify standar SAP program (Small modification :razz: ) (Not necessary transport to Production)
Include MS38VI50 of SAPMS38V (Not necessary transport to Production)
WHEN 'ZZCODE'.
DATA: lw_tvarvc TYPE tvarvc.
CASE 'X'.
WHEN rb_type_p.
READ TABLE i_tvarvc_params WITH KEY mark = 'X'.
MOVE-CORRESPONDING i_tvarvc_params TO lw_tvarvc.
CALL FUNCTION 'Z_TVARV_GEN_CODE'
EXPORTING
ex_tvarvc = lw_tvarvc.
WHEN rb_type_s.
READ TABLE i_tvarvc_selops WITH KEY mark = 'X'.
MOVE-CORRESPONDING i_tvarvc_selops TO lw_tvarvc.
CALL FUNCTION 'Z_TVARV_GEN_CODE'
EXPORTING
ex_tvarvc = lw_tvarvc.
ENDCASE.
Status GUI: CATS of MS38VI50 (Not necessary transport to Production)
Class Message ZTVARV (This class must be transport to Producction)
000 & & & &
001 Not found variable in the string & sperated by &
002 Not found variable in the string & sperated by & position &
003 Not found the variable in TVARVC &
004 Error en Field Symbol &, en method &. Contact to Developer.
005 & line(s) copy to clipboard
Pendient
The application only work ith table TVARVC " Table of Variant Variables (Client-Specific)", pending for incorporate the table TVARV "Table of variables in selection criteria".