Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

TCODE: STVARV - Individual Maintenance screen call with Variable name as input

ganu_k
Participant
0 Likes
11,120

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 ?

1 ACCEPTED SOLUTION
Read only

michael_piesche
Active Contributor
8,474

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.

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 ?

4 REPLIES 4
Read only

Sandra_Rossi
Active Contributor
8,474

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.

Read only

michael_piesche
Active Contributor
8,475

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.
Read only

0 Likes
8,474

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.

Read only

8,474

Finally its the good old BDC -:) thanks i think that will do