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

At selection screen-calling two events

Former Member
0 Likes
1,597

Hi experts,

I have the following requirement-

I am supposed to have 2 radio buttons and a text box to enter a file name on the selection-screen and based on the button the user selects i need to provide F4 help for the text box. If the user selects the 1st radio button, i need to provide F4 help to get a presentation server file and if he chooses the 2nd one an F4 help for application server file needs to be triggered.

I have 2 at selection-screen events- one for radio button and the other for F4 help and the problem is only one gets triggered at one go.

Could somebody please tell me how to capture radio button values in the event at selection-screen on value request?

Thanks and Regatrds,

Pallavi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,566

code-

data:lw_flag(1).

PARAMETERS:p_mode1 RADIOBUTTON group g1 default 'X',

p_mode2 RADIOBUTTON group g1 .

parameter p_desti type string.

AT SELECTION-SCREEN.

if sy-ucomm eq 'g1'.

if p_mode1 eq 'X'.

lw_flag = 'X'.

elseif p_mode2 eq 'X'.

lw_flag = ' '.

endif.

endif.

IF p_desti IS INITIAL.

MESSAGE E001(0).

ENDIF.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_desti.

*Display the pop up to accept the file name

if lw_flag = 'X'.

PERFORM f4_get_filename_presentation.

else.

PERFORM f4_get_filename_application.

endif.

Hi experts,

I have the following requirement-

I am supposed to have 2 radio buttons and a text box to enter a file name on the selection-screen and based on the button the user selects i need to provide F4 help for the text box. If the user selects the 1st radio button, i need to provide F4 help to get a presentation server file and if he chooses the 2nd one an F4 help for application server file needs to be triggered.

I have 2 at selection-screen events- one for radio button and the other for F4 help and the problem is only one gets triggered at one go.

Could somebody please tell me how to capture radio button values in the event at selection-screen on value request?

Thanks and Regatrds,

Pallavi

11 REPLIES 11
Read only

Former Member
0 Likes
1,566

Hi

in at selection-screen event validate your radio buttons and accordingly call the fms for the same

Regards

Shiva

Read only

Former Member
0 Likes
1,566

SUPPOSE YOU HAVE TWO RADIO BUTTONS

R1 AND R2. IF R1 IS CHOOSING BY USER YOU HAVE TO SHOW F4 HELP AND IF R2 IS CLICKED YOU DONT WANT TO SHOW THE F4 HELP.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.

IF R1 = 'X'.

CALL FM F4IF_INT_TABLE_VALUE_REQUEST<OR WHATEVER YOU NEED>

ENDIF.

REGARDS

SHIBA DUTTA

Read only

Former Member
0 Likes
1,566
use 2 events AT SELECTION-SCREEN  and   AT SELECTION-SCREEN ON VALUE-REQUEST

data : v_flag(1).
parameters : p_rad1 radiobutton group rad user-command 'ABC',
                   p_rad2 radiobutton group rad user-command 'ABC'.

at selection-screen.

if sy-ucomm eq 'ABC'.
  if p_rad1 eq 'X'.
       v_flag = 'X'.
  elseif p_rad2 eq 'X'.
     v_flag = ' '.
  endif.
endif.


at selection-screen on value-request.

if v_flag eq 'X'.
 *call presentation server
else.
 *call application server
endif.
Read only

Former Member
0 Likes
1,566

This may help u

Aparameters : fname like rlgrap-filename.
      DATA : filename TYPE string.
      DATA : table1 TYPE filetable,
             rc TYPE i.
DATA : VAL LIKE DYNPREAD-FIELDVALUE.
 
data: dynfields type table of dynpread with header line.
 
PARAMETERS : R1 RADIOBUTTON GROUP RG  modif id abc.
PARAMETERS : R2 RADIOBUTTON GROUP RG modif id def.
 
AT SELECTION-SCREEN ON VALUE-REQUEST FOR fname.
 
  CALL METHOD cl_gui_frontend_services=>file_open_dialog
      EXPORTING
        default_filename = '*.*'
      CHANGING
        file_table       = table1
        rc               = rc.
 
    IF sy-subrc <> 0.
      MESSAGE e000(zXXX) WITH 'Error'.
    ENDIF.
 
read table table1 index 1 into fname.
 
 
IF fname cs '.XLS'.             "substitute .csv
dynfields-fieldname = 'R1'.
dynfields-fieldvalue = 'X'.
append dynfields.
dynfields-fieldname = 'R2'.
dynfields-fieldvalue = ' '.
append dynfields.
 
elseif fname cs '.DOC'.
dynfields-fieldname = 'R1'.
dynfields-fieldvalue = ' '.
append dynfields.
dynfields-fieldname = 'R2'.
dynfields-fieldvalue = 'X'.
append dynfields.
 
ENDIF.
 
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
tables
dynpfields = dynfields
exceptions
others = 8.

Read only

Former Member
0 Likes
1,566

Hi guys,

i tried the same solutions but it is still not working.

i still unable to see the radio button values getting set .I tried out the code suggested by Chandrasekhar Jagarlamudi .The flag is always blank.

please help!

thanks and regards,

pallavi.

Read only

0 Likes
1,566

can you post ur code

Read only

Former Member
0 Likes
1,567

code-

data:lw_flag(1).

PARAMETERS:p_mode1 RADIOBUTTON group g1 default 'X',

p_mode2 RADIOBUTTON group g1 .

parameter p_desti type string.

AT SELECTION-SCREEN.

if sy-ucomm eq 'g1'.

if p_mode1 eq 'X'.

lw_flag = 'X'.

elseif p_mode2 eq 'X'.

lw_flag = ' '.

endif.

endif.

IF p_desti IS INITIAL.

MESSAGE E001(0).

ENDIF.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_desti.

*Display the pop up to accept the file name

if lw_flag = 'X'.

PERFORM f4_get_filename_presentation.

else.

PERFORM f4_get_filename_application.

endif.

Read only

0 Likes
1,566

pls try my code it will work

regards

shiba dutta

Read only

0 Likes
1,566

at selection-screen on value-request for <textfield you declare as parameter>.

if p_mode1 = 'X'.

PERFORM f4_get_filename_presentation.

else.

shiba dutta

Read only

0 Likes
1,566
try this

REPORT YCHATEST.

PARAMETERS:P_MODE1 RADIOBUTTON GROUP G1 USER-COMMAND ABC DEFAULT 'X' ,
           P_MODE2 RADIOBUTTON GROUP G1.


PARAMETER P_DESTI(100).
DATA : LW_FLAG.

LW_FLAG = 'X'.

AT SELECTION-SCREEN.
IF SY-UCOMM EQ 'ABC'.
IF P_MODE1 EQ 'X'.
LW_FLAG = 'X'.
ELSEIF P_MODE2 EQ 'X'.
LW_FLAG = ' '.
ENDIF.
ENDIF.

IF P_DESTI IS INITIAL.
MESSAGE E001(0).
ENDIF.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_DESTI.



*Display the pop up to accept the file name
IF LW_FLAG = 'X'.

PERFORM F4_GET_FILENAME_PRESENTATION.
ELSE.

PERFORM F4_GET_FILENAME_APPLICATION.
ENDIF.
Read only

Former Member
0 Likes
1,566

Hi chandrashekar,

Thanks a lot,it works.

Thanks again everybody.

regards,

pallavi.