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

Adding a parameter in selection screen dynamicaaly

Former Member
0 Likes
763

Hello All,

Can any one tell me how to add a parameter in the selection screen dynamically.

Thanks in advacne.

Best Regards,

Sasidhar Reddy Matli.

5 REPLIES 5
Read only

Former Member
0 Likes
667

Hi,

Follow this code


parameters:
  w_char like spfli-carrid,
  w_connid like spfli-connid.
Data:
  w_flag type c.

 at selection-screen output.
   if w_flag is initial.
    loop at screen.
      if screen-name cs 'w_connid'.
         screen-active = 0.
         modify screen.
      endif.
    endloop.
   endif.

 at selection-screen.
   if w_char eq 'LH'.
     w_flag = 'X'.
   endif.

Read only

Former Member
0 Likes
667

Hi

You can check for the condition in at selection-screen output and can make the required parameters appear dynamically

check the following code

at selection-screen output.
  if w_flag eq 'N'.
    loop at screen.
      if screen-group1 eq 'G1'.
        screen-active = 0.
      endif.                           " IF SCREEN-GROUP1 EQ 'G1'
      modify screen.
    endloop.                           " LOOP AT SCREEN
  else.
    loop at screen.
      if screen-group1 eq 'G1'.
        screen-active = 1.
        w_flag1 = 'Y'.
      endif.                           " IF SCREEN-GROUP1 EQ 'G1'
      if screen-name = 'P_USER'.
        screen-input = 0.
      endif.                           " IF SCREEN-NAME EQ P_USER
      modify screen.
    endloop.                           " LOOP AT SCREEN

    w_flag = 'N'.
  endif.                               " IF W_FLAG EQ 'N'

regards,

padma

Read only

Former Member
0 Likes
667
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
667

Hello,

Try this piece of logic:

Initially the parameter P_WAERS is invisible. But when radio-button P_RB2 is selected, then it gets displayed.


PARAMETERS:
  P_BANKS LIKE BNKA-BANKS,
  P_WAERS LIKE TCURC-WAERS MODIF ID ABC,

  P_RB1 RADIOBUTTON GROUP RAD1 DEFAULT 'X',
  P_RB2 RADIOBUTTON GROUP RAD1.

INITIALIZATION.

  LOOP AT SCREEN.
    IF SCREEN-GROUP1 EQ 'ABC'.
      SCREEN-ACTIVE = 0.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

AT SELECTION-SCREEN OUTPUT.
  IF P_RB2 = 'X'.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 EQ 'ABC'.
        SCREEN-ACTIVE = 1.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

Hope this helps.

BR,

Suhas

Read only

Former Member
0 Likes
667

Hi Sashidhar,

One way is to create a include having selection screen.

Write another program in which you read CODE of this include and modify your code wherein you insert lines to define parameters dynamically.

Write a small BDC code to activate this include.

Remember not to include above INCLUDE in your current program as you will not get active version if you try to activate from the same program in which you are programmatically activating your include.

Submit the program in which you have modified selection screen (modified INCLUDE program).

Regards,

Mohaiyuddin