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

using sy-ucomm

Former Member
0 Likes
1,286

Hi friends, this is the first time I post a question.

Nowadays I deal with the dialog programming. I have four screens: 0100, 0101, 0102, 0103..

And this screens have 'save' and 'back' pushbuttons on them.

I control the flow of screens at the screen '1000' (selection-screen), however, whenever I clicked on the Back button pf the screens and come back to screen 1000, and want to open another screen it is not possible, the code window is opened.

Here pEntry, pCar etc are radiobuttons defined from Parameter keyword:

data:OK_CODE TYPE sy-UCOMM, saveokcode TYPE sy-UCOMM.

if pEntry eq 'X'.

CAll SCREEN 0100.

ELSEIF pcar eq 'X'.

call SCREEN 0101.

ELSEIF pCarexit eq 'X'.

CALL SCREEN 0103.

ELSEIF pDriver eq 'X'.

call SCREEN 0104.

endif.

All the screens have the following format:

MODULE USER_COMMAND_0100 INPUT.

saveokcode = OK_CODE.

CASE saveokcode.

WHEN 'SAVE'.

PERFORM SAVE_DATA.

WHEN 'BACK'.

call SELECTION-SCREEN 1000.

LEAVE PROGRAM.

endcase.

When I clicked on back button on one of the screens, the second time I cannot use the radio button, it directs to the code window.

Should ı CLEAR the ok_code?

Thanks for your answers.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,230

Welcome to SDN!

This should help you:

WHEN 'BACK'.

SET SCREEN 0.

LEAVE SCREEN.

This should bring you back to the selection screen and should let you select options again.

Hope this helps.

Sudha

6 REPLIES 6
Read only

Former Member
0 Likes
1,231

Welcome to SDN!

This should help you:

WHEN 'BACK'.

SET SCREEN 0.

LEAVE SCREEN.

This should bring you back to the selection screen and should let you select options again.

Hope this helps.

Sudha

Read only

0 Likes
1,230

thanks for your help.

the mainly it is ok but, not I at once it goes back to the screen 0. I can go at twice. At first the radio buttons are not displayed and after second F3 I can go to the screen 0.And the radios are also displayed at the second time.Also It does not go the code window.Here is ok.

Thanks.

Read only

0 Likes
1,230

Have you tried debugging to see what happens when BACK is pressed the first time, and why it doesnt work?

It might have to do with the ok_code clearing, as Rich suggested.

Sudha

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,230

The correct syntax would be like so.

MODULE USER_COMMAND_0100 INPUT.

saveokcode = OK_CODE.

CASE OK_CODE.
WHEN 'SAVE'.
          clear ok_code.
          PERFORM SAVE_DATA.

WHEN 'BACK'.
          clear ok_code.
          call SELECTION-SCREEN 1000.
          LEAVE PROGRAM.
endcase.

ENDMODULE.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,230

Hii

you are using this piece of code

call SELECTION-SCREEN 1000.

LEAVE PROGRAM.

instead of using leave program use leave screen.

leave program will take you back to the code as it leaves the entire program

Read only

Former Member
0 Likes
1,230

"Set screen 0.

Leave program."

This contributed to solve the problem and it is now ok..

Thanks.