‎2007 Dec 05 4:53 AM
Hi,
In this program when i click submit button i want to display Male if the Radio button is select in Male option otherwise i want to display Female. But it's not working fine, so please help me
REPORT ZJJ1.
tables : sscrfields.
parameters : p1 radiobutton group rg1,
p2 radiobutton group rg1.
selection-screen:
pushbutton /6(20) but1 user-command cli1.
initialization.
but1 = 'submit'.
at selection-screen.
if sscrfields-ucomm = 'cli1'.
if p1 = 'x'.
write 'male'.
elseif p2 = 'x'.
write 'female'.
endif.
endif.
‎2007 Dec 05 5:02 AM
Hi,
Refer this code
----
PARAMETERS & SELECT-OPTIONS *
----
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-011.
PARAMETERS : p_pay1 RADIOBUTTON GROUP grp USER-COMMAND fc DEFAULT 'X',
p_pay2 RADIOBUTTON GROUP grp.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_pernr FOR pa0000-pernr. "Personnel Number
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (31) text-018.
PARAMETERS : p_begda LIKE pa0000-begda OBLIGATORY. "Start Date
SELECTION-SCREEN COMMENT 52(05) text-019.
PARAMETERS : p_endda LIKE pa0000-endda OBLIGATORY. "End Date
SELECTION-SCREEN END OF LINE.
SELECT-OPTIONS : s_stat2 FOR pa0000-stat2, "Status
s_werks FOR pa0001-werks, "Personnel Area
s_raufnr FOR catsdb-raufnr MODIF ID md1. "Internal Order Number
SELECTION-SCREEN END OF BLOCK b2.
----
AT SELECTION-SCREEN *
----
AT SELECTION-SCREEN OUTPUT.
IF p_pay1 EQ 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'MD1'.
screen-active = '1'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF p_pay2 EQ 'X'.
LOOP AT SCREEN.
IF screen-group1 = 'MD1'.
screen-active = '1'.
screen-input = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Regards,
Prashant
‎2007 Dec 05 5:03 AM
Hi,
Instead of AT selection-screen event use AT User-command Event.
regards,
Santosh Thorat
‎2007 Dec 05 5:09 AM
‎2007 Dec 05 10:11 AM
<b>Hii
Modify ur program as follows..
n while executing.. after clicking the push button... execute the program.. otherwise u wont get the result
reward if helpful</b>
TABLES : sscrfields.
DATA:v_flag TYPE i VALUE 0.
PARAMETERS : p1 RADIOBUTTON GROUP rg1,
p2 RADIOBUTTON GROUP rg1.
SELECTION-SCREEN:
PUSHBUTTON /6(20) but1 USER-COMMAND cli1.
INITIALIZATION.
but1 = 'submit'.
AT SELECTION-SCREEN .
IF sscrfields-ucomm = 'CLI1'.
IF p1 = 'X'.
v_flag = 1.
ELSEIF
p2 = 'X'.
v_flag = 0.
ENDIF.
ENDIF.
START-OF-SELECTION.
IF v_flag = 1.
WRITE:'male'.
ELSE.
WRITE:'female'.
Message was edited by:
Sheeba Bhaskaran
‎2007 Dec 05 12:19 PM
Hi,
I have done some modifications to your program.
Push button's function code and check 'X' for P1 and P2 should be in capital letters.
Copy and paste the code below, it will work . I have checked it.
tables : sscrfields.
parameters : p1 radiobutton group rg1,
p2 radiobutton group rg1.
selection-screen:
pushbutton /6(20) but1 user-command cli1.
initialization.
but1 = 'submit'.
at selection-screen.
if sscrfields-ucomm = 'CLI1'.
if p1 = 'X'.
set pf-status ' '.
leave to list-processing and return to screen 1000.
write 'male'.
elseif p2 = 'X'.
set pf-status ' '.
leave to list-processing and return to screen 1000.
write 'female'.
endif.
endif.
Reward points if your problem is solved.
Regards,
Soumya.