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

radio button.

Former Member
0 Likes
1,244

Hi Abap Guru,

I have one doubt in screen layout. If i click the radioutton on screenlayout i want some msg on different screen like "your ans is correct".

Please help me to olve this problem.

Thanks

10 REPLIES 10
Read only

Former Member
0 Likes
1,220

hi

u can use <b>pop_to_inform</b> function module.

regards

ravish

<b>plz dont forget to reward points if helpful</b>

Read only

Former Member
0 Likes
1,220

Hi,

At selection-screen output.

If Radio = 'X'.

message text-001 type 'S'.

endif.

regards,

Ruchika

Read only

Former Member
0 Likes
1,220

Hi,

Check this code..



PARAMETERS: P_R1 RADIOBUTTON GROUP G1 USER-COMMAND USR
                                                          DEFAULT 'X',
                         P_R2 RADIOBUTTON GROUP G1.

AT SELECTION-SCREEN.

* Check if the radio button is pressed..
IF SY-UCOMM = 'USR' AND P_R1 = 'X'.

* display the message.
  MESSAGE I208(00)  with 'Message raised'.
  

ENDIF.

Thanks

Naren

Read only

0 Likes
1,220

My pgm is

data: radio1(1) type c,

radio2(1) type c,

ok_code type sy-ucomm,

save_ok type sy-ucomm.

call screen 100.

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE USER_COMMAND_0100 INPUT.

save_ok = ok_code.

clear ok_code.

case save_ok.

when 'button'.

if radio2 = 'x'.

write 'x'.

else .

write 'w'.

endif.

when 'CANCEL'.

leave program.

endcase.

ENDMODULE. " USER_COMMAND_0100 INPUT

form read.

endform.

My requirement is that if i click radiobutton radio2 i want the msg

Read only

Former Member
0 Likes
1,220

HI,

see the system defined program demo_dynpro_check_radio.it will be helpful for u.

reward points if helpful.

rgds,

bharat.

Read only

S0025444845
Active Participant
0 Likes
1,220

Hi,

try this at selection-screen output.

if radiobutton = 'X'

message 'your ans is correct' type 'S'.

endif.

regards,

sudha

Read only

Former Member
0 Likes
1,220

hi,

use this piece of code

if p_rb = 'X'.

message i000(zz) with 'correct'.

endif.

zz- is message class.

Read only

Former Member
0 Likes
1,220

hi,

To define the input field of a parameter as a radio button, you use the following syntax:

<b>PARAMETERS <p> ...... RADIOBUTTON GROUP <radi>......</b>

<b>follow this logic.</b>

REPORT demo_sel_screen_user_command.

PARAMETERS:  rad1 RADIOBUTTON GROUP rad ,
                         rad2 RADIOBUTTON GROUP rad,
                         rad3 RADIOBUTTON GROUP rad.


AT SELECTION-SCREEN.
  IF rad1 = 'X'.
  MESSAGE i001  WITH 'your ans is correct'.
  ElSEIF rad2 = 'X'.
  MESSAGE i002  WITH 'your ans is not correct'.

  START-OF-SELECTION.
  WRITE text-002.

<b>or</b>

<b>SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.

PARAMETERS: R1 RADIOBUTTON GROUP RAD1 DEFAULT 'X',

R2 RADIOBUTTON GROUP RAD1,

R3 RADIOBUTTON GROUP RAD1.

SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.

PARAMETERS: R4 RADIOBUTTON GROUP RAD2 DEFAULT 'X',

R5 RADIOBUTTON GROUP RAD2,

R6 RADIOBUTTON GROUP RAD2.

SELECTION-SCREEN END OF BLOCK B2.

AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD1.

IF R1 = 'X'.

MESSAGE I040 WITH 'your ans is correct'.

ELSEIF R2 ='X'.

MESSAGE I041 WITH 'your ans is not correct'

AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD2.

IF R4 = 'X'.

MESSAGE W040(HB).

ENDIF.</b>

regards,

Ashokreddy.

Read only

Former Member
0 Likes
1,220

Hi,

In the RADIO button properties..there is a field called FctCode..Where you can use this field to assign a function code..Lets say if you had given the value RAD1

Then use this function module in the PAI..


CASE SY-UCOMM.

  WHEN 'RAD1'.    " Radio button is pressed.

***                       " Do all your code here..

Thanks

Naren

Read only

Former Member
0 Likes
1,220

hI AJAY,

USE THE CODE LIKE THIS.

TABLES:SSCRFIELDS.

PARAMETERS: radio1 RADIOBUTTON GROUP RAD1 USER-COMMAND BUTTON,

radio2 RADIOBUTTON GROUP RAD1.

AT SELECTION-SCREEN.

CASE SSCRFIELDS-UCOMM.

when 'BUTTON'.

if radiO1 = 'X'.

MESSAGE I000(Z_MSG_TAB).

else .

MESSAGE I001(Z_MSG_TAB).

endif.

endcase.

rgds,

bharat.