Application Development 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: 

Push Button

Former Member
0 Kudos

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.

5 REPLIES 5

former_member386202
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi,

Instead of AT selection-screen event use AT User-command Event.

regards,

Santosh Thorat

Former Member
0 Kudos

I want to change my code

0 Kudos

<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

soumya_jose3
Active Contributor
0 Kudos

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.