2020 Aug 07 11:41 AM
We have a dashboard transaction where we are planning to allow only the required TVARV variables to be maintained. Hence looking at option to call the Individual variable maintenance rather than entire TVARV option.
Is there a way to call tcode STVARV individual maintenance screen directly with Input as Variable name.
In TCODE: STVARV - there is an option (button) that allows Individual Maintenance (single variable to be maintained) - is there a way to call that screen directly by passing the required variable as well.
Screen 1 : Program: SAPMS38V - Initial Screen - there is option from this screen to call Individual maintenance

Screen: 1002 - Individual Maintenance screen 
is there a way to call this screen 1002 directly and provide a variable as input.
Partial Solution: Created a custom tcode with program as SAPMS38V and Screen as 1002 - however there is no option to provide the Variable as Input.
Is there a way to call this Individual maintenance and allow only that variable to be maintained ?
2020 Aug 07 12:59 PM
With the following report, which you can create a transaction for, you would overcome the issue of having the right variable preselected.
The report will open the transaction STARV, switch to edit mode, then switch to the screen "Individual maintenance" and preselect the variable ZVARIABLE. If the user goes 'back' or hits F3, the programme will exit.
However, the user will still have all the availaible options for the screen "individual maintenance". There are no limitations done this way.
REPORT ZSTVARVINDMAINT.
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
PERFORM bdc_dynpro USING 'SAPMS38V' '1100'. " switch to edit mode
PERFORM bdc_field USING 'BDC_OKCODE' '=TOGGLE'.
PERFORM bdc_dynpro USING 'SAPMS38V' '1100'. " switch to ind.maint.
PERFORM bdc_field USING 'BDC_OKCODE' '=SINGLE'.
PERFORM bdc_dynpro USING 'SAPMS38V' '1001'. " enter variable
PERFORM bdc_field USING 'TVARVC-NAME' 'ZVARIABLE'.
PERFORM bdc_dynpro USING 'SAPMS38V' '1100'.
PERFORM bdc_field USING 'BDC_OKCODE' '=RETN'. " When returning exit
PERFORM bdc_dynpro USING 'SAPMS38V' '1100'.
PERFORM bdc_field USING 'BDC_OKCODE' '/EE'. " Exit BDC
CALL TRANSACTION 'STVARV' USING bdcdata MODE 'E'. " start transaction and run bdc-script
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM.
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM.
With the following report, which you can create a transaction for, you would overcome the issue of having the right variable preselected.
The report will open the transaction STARV, switch to edit mode, then switch to the screen "Individual maintenance" and preselect the variable ZVARIABLE. If the user goes 'back' or hits F3, the programme will exit.
However, the user will still have all the availaible options for the screen "individual maintenance". There are no limitations done this way.
REPORT ZSTVARVINDMAINT.
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
PERFORM bdc_dynpro USING 'SAPMS38V' '1100'. " switch to edit mode
PERFORM bdc_field USING 'BDC_OKCODE' '=TOGGLE'.
PERFORM bdc_dynpro USING 'SAPMS38V' '1100'. " switch to ind.maint.
PERFORM bdc_field USING 'BDC_OKCODE' '=SINGLE'.
PERFORM bdc_dynpro USING 'SAPMS38V' '1001'. " enter variable
PERFORM bdc_field USING 'TVARVC-NAME' 'ZVARIABLE'.
PERFORM bdc_dynpro USING 'SAPMS38V' '1100'.
PERFORM bdc_field USING 'BDC_OKCODE' '=RETN'. " When returning exit
PERFORM bdc_dynpro USING 'SAPMS38V' '1100'.
PERFORM bdc_field USING 'BDC_OKCODE' '/EE'. " Exit BDC
CALL TRANSACTION 'STVARV' USING bdcdata MODE 'E'. " start transaction and run bdc-script
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM.
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM.
2020 Aug 07 12:54 PM
I don't know an official way. A supported solution would be to create a custom program with batch input on transaction code STVARV with display mode 'E' (important) (CALL TRANSACTION ... USING ...), to access directly the maintenance screen of the variable, and when the user leaves the screen to return to the variable selection screen (SAPMS38V 1001), the BDC data table tells to terminate so that everything appears hidden to the user, as if there was only one screen to maintain the given variable.
2020 Aug 07 12:59 PM
With the following report, which you can create a transaction for, you would overcome the issue of having the right variable preselected.
The report will open the transaction STARV, switch to edit mode, then switch to the screen "Individual maintenance" and preselect the variable ZVARIABLE. If the user goes 'back' or hits F3, the programme will exit.
However, the user will still have all the availaible options for the screen "individual maintenance". There are no limitations done this way.
REPORT ZSTVARVINDMAINT.
DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
PERFORM bdc_dynpro USING 'SAPMS38V' '1100'. " switch to edit mode
PERFORM bdc_field USING 'BDC_OKCODE' '=TOGGLE'.
PERFORM bdc_dynpro USING 'SAPMS38V' '1100'. " switch to ind.maint.
PERFORM bdc_field USING 'BDC_OKCODE' '=SINGLE'.
PERFORM bdc_dynpro USING 'SAPMS38V' '1001'. " enter variable
PERFORM bdc_field USING 'TVARVC-NAME' 'ZVARIABLE'.
PERFORM bdc_dynpro USING 'SAPMS38V' '1100'.
PERFORM bdc_field USING 'BDC_OKCODE' '=RETN'. " When returning exit
PERFORM bdc_dynpro USING 'SAPMS38V' '1100'.
PERFORM bdc_field USING 'BDC_OKCODE' '/EE'. " Exit BDC
CALL TRANSACTION 'STVARV' USING bdcdata MODE 'E'. " start transaction and run bdc-script
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM.
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM.
2020 Aug 07 3:10 PM
ganu.k, with the above coding, you will be able to just open the screen for individual TVARV variable maintenance with the variable preset. When the user leaves the screen, the programm will be terminated. However, the user can still maintain new and other existing variables.
2020 Aug 09 11:57 AM
Finally its the good old BDC -:) thanks i think that will do
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |