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

reg logic required for selection-screen.

Former Member
0 Likes
1,153

Hi,

i have one requirement

on selection screen 2 radio button

1 for service

2 for account

Parameter FILE LOCALFILE Filename

If the radiobutton ACCOUNT is selected the default name for file will be:

‘Rev_acc_com_&system_time_stamp&.dat’

Elseif the radiobutton SERVICE is selected the default name for file will be:

‘Rev_srv_com_&system_time_stamp&.dat’

some body can give the logic for this.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,124

This works


parameters:
  rb1 radiobutton group rb1 default 'X' USER-COMMAND sel,
  rb2 radiobutton group rb1,
  zfile              LIKE rlgrap-filename.

*____________________________________________ Screen Actions
AT SELECTION-SCREEN OUTPUT.
  if rb1 = 'X'.
    concatenate 'File Name 1_' sy-datum into zfile.
  else.
    concatenate 'File Name 2_' sy-datum into zfile.
  endif.

7 REPLIES 7
Read only

Former Member
0 Likes
1,124

Hi,

You write the code like this in initialization.

initialization.

if rad1 = 1. "service

write code for file name = ‘Rev_srv_com_&system_time_stamp&.dat’

elseif rad1 = 2. "account

write code for file name = ‘Rev_acc_com_&system_time_stamp&.dat’

endif.

Reward.

Read only

Former Member
0 Likes
1,124

take the following solution

data: tstamp type TZNTSTMPS.

data: filename type string.

call function 'CONVERT_INTO_TIMESTAMP'

exporting

I_DATLO = sy-datum

I_TIMLO = sy-uzeit

importing

E_TIMESTAMP = tstamp.

if ACCOUNT is selected then

concatenate 'Rev_srv_com_' tstamp '.dat' into filename.

else if SERVICE is selected then

concatenate 'Rev_srv_com_' tstamp '.dat' into filename.

the filename variable will be containing ur required file name..

reward points if useful....

Read only

Former Member
0 Likes
1,124

Hi,

try this code.


TABLES:sscrfields.
PARAMETER:service RADIOBUTTON GROUP rad default 'X',
          account RADIOBUTTON GROUP rad.

PARAMETER FILE TYPE string.

AT SELECTION-SCREEN OUTPUT.
    CASE 'X'.
      WHEN account.
        file = 'Rev_acc_com_&system_time_stamp&.dat'.
      WHEN service.
        file = 'Rev_srv_com_&system_time_stamp&.dat'.
    ENDCASE.

rgds,

bharat.

Read only

Former Member
0 Likes
1,125

This works


parameters:
  rb1 radiobutton group rb1 default 'X' USER-COMMAND sel,
  rb2 radiobutton group rb1,
  zfile              LIKE rlgrap-filename.

*____________________________________________ Screen Actions
AT SELECTION-SCREEN OUTPUT.
  if rb1 = 'X'.
    concatenate 'File Name 1_' sy-datum into zfile.
  else.
    concatenate 'File Name 2_' sy-datum into zfile.
  endif.

Read only

Former Member
0 Likes
1,124

Hi Jamshad,

Try with codes.

SELECTION-SCREEN BEGIN OF BLOCK B1 .

PARAMETERS: ACCOUNT RADIOBUTTON GROUP RAD1 DEFAULT ' Rev_acc_com_&system_time_stamp&.dat ' ,

service RADIOBUTTON GROUP RAD1 default 'service',

SELECTION-SCREEN END OF BLOCK B1.

if ACCOUNT = ' X '.

write your logic to process

elseif service = 'X'.

write

endif.

athanks ,

Manas

Read only

Former Member
0 Likes
1,124

hi,

selection-screen begin of block b1 with frame title text-001.

selection-screen begin of line.

parameters : rb1 radiobutton group g1 default 'X'.

selection-screen end of line.

parameters : p_file like rlgrap-filename default 'c:\test'.

selection-screen end of block b2.

selection-screen begin of line.

parameters : rb2 radiobutton group g1.

selection-screen end of line.

parameters : p_file like rlgrap-filename default 'c:\test'.

selection-screen end of block b1.

reward if helpful,

N.Rekha

Read only

Former Member
0 Likes
1,124

If not p_account is initial.

then u give your default name here

endif.

if not p_service is initial.

here give its respective condition.

endif.

Thanks