‎2006 Oct 06 9:37 AM
Hi Experts,
My requirement is, I have two parameters, and two radio buttons like C and D and one Pushbutton (P) in selection screen. When user enter two parameter values, and select Radiobutton C or D, then this data should be inserted into ztable and Flag is set to either C/ D accordingly. When I click on the pushbutton, then the parameter value should be clear.
Selection screen designed, i need only code support.
Thanks in advance.
Regs
Rams
Max rewards will be given
‎2006 Oct 06 9:56 AM
Hi,
You can write code similar to below. You have to use USER-COMMAND with Radio button definition in the selection-screen.
PARAMETERS:
PARAMETERS P0 RADIOBUTTON GROUP RADI USER-COMMAND CM1,
PARAMETERS P1 RADIOBUTTON GROUP RADI USER-COMMAND CM2.
AT SELECTION-SCREEN OUTPUT.
IF SY-UCOMM = 'CM1'.
UPDATE ZTABLE.
ELSEIF SY-UCOMM = 'CM2'.
UPDATE ZTABLE.
ELSEIF SYUCOMM = 'BUT1'.
CLEAR DATA
ENDIF.
Thanks,
Ramakrishna
‎2006 Oct 06 9:56 AM
Hi,
You can write code similar to below. You have to use USER-COMMAND with Radio button definition in the selection-screen.
PARAMETERS:
PARAMETERS P0 RADIOBUTTON GROUP RADI USER-COMMAND CM1,
PARAMETERS P1 RADIOBUTTON GROUP RADI USER-COMMAND CM2.
AT SELECTION-SCREEN OUTPUT.
IF SY-UCOMM = 'CM1'.
UPDATE ZTABLE.
ELSEIF SY-UCOMM = 'CM2'.
UPDATE ZTABLE.
ELSEIF SYUCOMM = 'BUT1'.
CLEAR DATA
ENDIF.
Thanks,
Ramakrishna
‎2006 Oct 06 11:09 AM
‎2006 Oct 06 11:48 AM
hi,
try:
SELECTION-SCREEN FUNCTION KEY 1.
parameters : p1(10).
AT SELECTION-SCREEN.
if sy-ucomm = 'FC01'.
clear p1.
endif.A.
‎2006 Oct 06 11:54 AM
Hi Ramesh,
You may have to make some changes to the below code.
I assumed that you are using a table ZTABLE with fields FIELD1 & FIELD2.
REPORT ZTEST1.
TABLES: ZTABLE.
PARAMETERS:
PARAMETERS P0 RADIOBUTTON GROUP RADI USER-COMMAND CM1,
PARAMETERS P1 RADIOBUTTON GROUP RADI USER-COMMAND CM2.
PARAMETERS FIELD1 TYPE ZTABLE-FIELD1.
PARAMETERS FIELD2 TYPE ZTABLE-FIELD2.
AT SELECTION-SCREEN OUTPUT.
IF SY-UCOMM = 'CM1'.
CLEAR ZTABLE.
ZTABLE-FIELD1 = FIELD1.
ZTABLE-FIELD2 = FIELD2.
INSERT ZTABLE FROM ZTABLE.
ELSEIF SY-UCOMM = 'CM2'.
ZTABLE-FIELD1 = FIELD1.
ZTABLE-FIELD2 = FIELD2.
INSERT ZTABLE FROM ZTABLE.
ELSEIF SYUCOMM = 'BUT1'.
CLEAR: ZTABLE, FIELD1, FIELD2.
ENDIF.
START-OF-SELECTION.
ANY FURTHER LOGIC CAN BE WRITTE HERE
Hope this helps you.
Ramakrishna
‎2006 Oct 06 11:04 AM
hi ramesh,
tables: sscrfields.
selection-screen PUSHBUTTON 20(10) but1 USER-COMMAND clr.
parameters: p1 like lfa1-lifnr,
p2 like lfa1-name1.
AT SELECTION-SCREEN.
case sscrfields.
WHEN 'CLR'.
clear p1.
clear p2.
endcase.
hope this helps,
do reward if it helps,
priya.