‎2008 Aug 08 11:19 AM
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.
‎2008 Aug 08 11:28 AM
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.
‎2008 Aug 08 11:30 AM
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
‎2008 Aug 08 11:32 AM
Hi Sasidhar,
Hope the following threads help you reach a solution:
https://forums.sdn.sap.com/click.jspa?searchID=14992756&messageID=5856700
https://forums.sdn.sap.com/click.jspa?searchID=14992756&messageID=5740894
Have A Good Day
Chaitanya.
‎2008 Aug 08 11:39 AM
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
‎2008 Aug 08 11:47 AM
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