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

USER_COMMAND logic

Former Member
0 Likes
1,256

I have below code

{MODULE user_command_0100 INPUT.

DATA : ok_code LIKE sy-ucomm,

save_ok LIKE ok_code,

output LIKE ok_code.

ok_code = sy-ucomm.

save_ok = ok_code.

CLEAR ok_code.

CASE save_ok.

WHEN '&F03' OR '&F15' OR '&F12'.

LEAVE PROGRAM.

WHEN 'DISPLAY'.

LEAVE TO SCREEN 100.

WHEN OTHERS.

output = save_ok.

ENDCASE.

ENDMODULE. " USER_COMMAND_0100 INPUT}

In the above code I want to also add command for following functions

1) find 2) print 3) First Page 4) Next page 5) last page

what is the code to be written for these functions? is there a list of these functions like I have written for 'LEAVE PROGRAM'.

Regards,

Santosh

5 REPLIES 5
Read only

Former Member
0 Likes
839

Hello

Find - %SC

Print - &RNT

First page - P--

Next page - P+

Last page - P++

Read only

Former Member
0 Likes
839

But I am not getting how to add it to the code.

should i do like this ???

{} CASE save_ok.

WHEN '&F03' OR '&F15' OR '&F12'.

LEAVE PROGRAM.

WHEN 'DISPLAY'.

LEAVE TO SCREEN 100.

WHEN '%SC'.

FIND.

WHEN '&RNT'.

Print.

WHEN OTHERS.

output = save_ok.

ENDCASE.

Read only

Former Member
0 Likes
839

But I am not getting how to add it to the code.

should i do like this ???

{} CASE save_ok.

WHEN '&F03' OR '&F15' OR '&F12'.

LEAVE PROGRAM.

WHEN 'DISPLAY'.

LEAVE TO SCREEN 100.

WHEN '%SC'.

FIND.

WHEN '&RNT'.

Print.

WHEN OTHERS.

output = save_ok.

ENDCASE. {}

Read only

Former Member
0 Likes
839

But I am not getting how to add it to the code.

should i do like this ???

 CASE save_ok.
    WHEN '&F03' OR '&F15' OR '&F12'.
      LEAVE PROGRAM.
    WHEN 'DISPLAY'.
      LEAVE TO SCREEN 100.
    WHEN '%SC'.
       FIND.
     WHEN '&RNT'.
        Print.
    WHEN OTHERS.
      output = save_ok.
  ENDCASE. 

Read only

0 Likes
839

Hi,

You need to declare as below :

case ok_code.

when 'BACK'. leave to screen 0.

when 'EXIT'. leave to screen 0.

WHEN '%SC'.

perform find_field using ok_code.(If you want to find any value)

Thanks and Regards,

P.Bharadwaj