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

Making a radiobutton default after calling tcode...

aris_hidalgo
Contributor
0 Likes
1,380

Hello experts,

In my report, when a user presses back, I am calling the tcode of my report. Now, is it possible that

when I call the tcode the last radiobutton that the user clicked will be the default after calling

the tcode? for example, I have 3 radiobuttons in my selection-screen namely display, add and edit.

when the user chooses to add and then he decides to cancel(BACK) I will call the tcode but on the selection-screen

the default now is the add radiobutton?

Help would be greatly appreciated. Again, thanks a lot guys and have a nice day!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,203

Hello Viray,

I think if you set the pf status it may solve your problem.

set pf-status pfstat.

Regards,

Amit

11 REPLIES 11
Read only

Former Member
0 Likes
1,204

Hello Viray,

I think if you set the pf status it may solve your problem.

set pf-status pfstat.

Regards,

Amit

Read only

former_member186741
Active Contributor
0 Likes
1,203

instead of calling the tcode, why not submit the abap and set the radiobutton in the call?

eg

SUBMIT (sy-repid) VIA SELECTION-SCREEN

WITH p_rad eq 'X''.

Read only

0 Likes
1,203

Hi Neil,

Thanks for the helpful reply. Anyway, I have another problem, After writing the results, when I press BACK it does not go to the selection-screen instead it goes back to the surce code, which is wrong. By the way, I have 2 selection-screens in my report. So what I want to do is that after displaying the results(this is normal display not ALV) and when I press BACK/CANCEL/EXIT it would go back to the previous selection-screen.

Help would be appreciated. Thanks a lot and have a nice day!

Read only

0 Likes
1,203

Hi Viraylab,

could you please post the selection screen definitions so that i can see what the two screens are?

Read only

0 Likes
1,203

Hi again,

This is the code for the 2 selection-screens:

*selection-screen for controllers

SELECTION-SCREEN BEGIN OF SCREEN 500.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pr_upld RADIOBUTTON GROUP grp2 USER-COMMAND ucomm1.

SELECTION-SCREEN COMMENT 2(20) text-007 FOR FIELD pr_upld.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 03(15) text-a11 FOR FIELD p_flnme.

PARAMETERS: p_flnme LIKE rlgrap-filename DEFAULT 'C:\'.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pr_list1 RADIOBUTTON GROUP grp2.

SELECTION-SCREEN COMMENT 2(7) text-003 FOR FIELD pr_list1.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN END OF SCREEN 500.

*selection-screen for non-controllers.

SELECTION-SCREEN BEGIN OF SCREEN 1500.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(22) text-002 FOR FIELD p_dcode.

PARAMETERS: p_dcode LIKE vbak-kunnr,

p_name1 LIKE kna1-name1.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pr_list2 RADIOBUTTON GROUP grp USER-COMMAND ucomm2.

SELECTION-SCREEN COMMENT 2(7) text-003 FOR FIELD pr_list2.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pr_add RADIOBUTTON GROUP grp.

SELECTION-SCREEN COMMENT 2(3) text-005 FOR FIELD pr_add.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pr_edit RADIOBUTTON GROUP grp.

SELECTION-SCREEN COMMENT 2(4) text-006 FOR FIELD pr_edit.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 03(20) text-a12 FOR FIELD p_code.

PARAMETERS: p_code LIKE zts0001-cdseq.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN END OF SCREEN 1500.

INITIALIZATION.

SELECT SINGLE kunnr comp_flag INTO (gc_kunnr,v_compflag)

FROM zsoemailid

WHERE bname = sy-uname.

IF sy-subrc <> 0.

MESSAGE i000 WITH

'You are not authorised to use this transaction'.

LEAVE PROGRAM.

ENDIF.

IF v_compflag = 'X'.

CALL SCREEN 500.

ELSE.

CALL SCREEN 1500.

ENDIF.

Read only

0 Likes
1,203

when you do the submit set the new parameter 'p_cflag' from the current value and TRY THIS:

Hi again,

This is the code for the 2 selection-screens:

*selection-screen for controllers

SELECTION-SCREEN BEGIN OF SCREEN 500.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pr_upld RADIOBUTTON GROUP grp2 USER-COMMAND ucomm1.

SELECTION-SCREEN COMMENT 2(20) text-007 FOR FIELD pr_upld.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 03(15) text-a11 FOR FIELD p_flnme.

PARAMETERS: p_flnme LIKE rlgrap-filename DEFAULT 'C:\'.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pr_list1 RADIOBUTTON GROUP grp2.

SELECTION-SCREEN COMMENT 2(7) text-003 FOR FIELD pr_list1.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN END OF SCREEN 500.

*selection-screen for non-controllers.

SELECTION-SCREEN BEGIN OF SCREEN 1500.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(22) text-002 FOR FIELD p_dcode.

PARAMETERS: p_dcode LIKE vbak-kunnr,

p_name1 LIKE kna1-name1.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pr_list2 RADIOBUTTON GROUP grp USER-COMMAND ucomm2.

SELECTION-SCREEN COMMENT 2(7) text-003 FOR FIELD pr_list2.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pr_add RADIOBUTTON GROUP grp.

SELECTION-SCREEN COMMENT 2(3) text-005 FOR FIELD pr_add.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pr_edit RADIOBUTTON GROUP grp.

SELECTION-SCREEN COMMENT 2(4) text-006 FOR FIELD pr_edit.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 03(20) text-a12 FOR FIELD p_code.

PARAMETERS: p_code LIKE zts0001-cdseq.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN END OF SCREEN 1500.

<b>parameters p_cflag no-display.</b>

INITIALIZATION.

SELECT SINGLE kunnr comp_flag INTO (gc_kunnr,<b>p_cflag</b>)

FROM zsoemailid

WHERE bname = sy-uname.

IF sy-subrc <> 0.

MESSAGE i000 WITH

'You are not authorised to use this transaction'.

LEAVE PROGRAM.

ENDIF.

<b>at selection-screen.</b>

IF <b>p_cflag</b> = 'X'.

CALL SCREEN 500.

ELSE.

CALL SCREEN 1500.

ENDIF.

Read only

0 Likes
1,203

Hi again Neil,

Thanks again for the very helpful reply. Anyway, I have another question if its not too much. After displaying my report, when I press BACK/CANCEL/EXIT buttons it is going back to the source code and not on the selection-screen(either 500 or 1500). I want it to go back to the previous selection-screen. Also, I cannot capture its sy-ucomm when I press back. How do I do this?

Read only

0 Likes
1,203

Hi,

Try with using event ON EXIT-COMMAND like this.

AT SELECTION_SCREEN ON EXIT-COMMAND.

IF sy-dynnr EQ 'scr.no'.

CALL SELECTION-SCREEN 'scr.no'

ENDIF.

Regards,

Suresh

Read only

0 Likes
1,203

for the selection screen fields to remember the user last entered value (within the same session.) just use the addition MEMORY ID.

Example in selection screen.

parameters: kokrs like csks-kokrs memory id abc .

Regards

Raja

Read only

Former Member
0 Likes
1,203

Hi Viray,

This is regarding when u press back it should go back to the previous screen but not to the source code.

1) If it is normal report display, anyway it comes back to the previuos selection-screen.

2) If it is a screen display, then u need to do the following.

*-- In flow logic

PROCESS AFTER INPUT.

MODULE USER_COMMAND_0200.

*-- Module definition

MODULE user_command_0200 INPUT.

ok_code = sy-ucomm.

CASE ok_code.

WHEN 'EXIT' OR 'CANC'.

PERFORM f4000_free_objects.

WHEN 'BACK'.

PERFORM f4000_free_objects.

<b>SET SCREEN '0'.

LEAVE SCREEN.</b>

WHEN OTHERS.

PERFORM f4000_free_objects.

ENDCASE.

ENDMODULE. " USER_COMMAND_0200 INPUT

Hope this will help u in some way.

Read only

Former Member
0 Likes
1,203

hello viraylab,

As i know , if u r using call transaction at click back it means that ur program will run initially no data will remain, so that it is not possible because i used this trick in my module programming but it's not worked.

with regard

chetan vishnoi