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

step-loop and dynpro ok_code

Former Member
0 Likes
996

Hi all,

I have step-loop with buttons, which normaly get OK-CODE, but it is the same for all buttons. My problem is that I don't know which button is pressed(in PAI), because they all have same ok_code? Any idea how to get this information?

thx

Mario

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
889

Hi

If the user presses a push button of step-loop, this is the last action he has done, so in PAI process:

PROCESS PAI.

LOOP.

MODULE GET_LINE.

ENDLOOP.

MODULE USER_COMMAND.

MODULE GET_LINE.

GET CURSOR LINE VN_LINE.

ENDMODULE.

MODULE USER_COMMAND.

CASE OK_CODE.

WHEN 'STEP'.

  • Calculate the absolute value of lines:

VN_lINE = TOP_LINE + VN_LINE - 1.

Another solution is to insert an OK_CODE value like this:

STEP%

The system'll replace % with the index of the line selected:

MODULE USER_COMMAND.

IF OK_CODE(4) = 'STEP'.

MOVE OK_CODE+4 TO VN_LINE.

  • Calculate the absolute value of lines:

VN_lINE = TOP_LINE + VN_LINE - 1.

Max

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
889

Interesting, I would think that you would want to make each button have a different ok_code, maybe you can use GET CURSOR statement to find out where the cursor is?

GET CURSOR FIELD fieldname.

Regards,

Rich Heilman

Read only

0 Likes
889

ok that helps, but how can I do that?

Read only

0 Likes
889

i mena different ok codes, how can i do that?

thx

m.

Read only

Former Member
0 Likes
890

Hi

If the user presses a push button of step-loop, this is the last action he has done, so in PAI process:

PROCESS PAI.

LOOP.

MODULE GET_LINE.

ENDLOOP.

MODULE USER_COMMAND.

MODULE GET_LINE.

GET CURSOR LINE VN_LINE.

ENDMODULE.

MODULE USER_COMMAND.

CASE OK_CODE.

WHEN 'STEP'.

  • Calculate the absolute value of lines:

VN_lINE = TOP_LINE + VN_LINE - 1.

Another solution is to insert an OK_CODE value like this:

STEP%

The system'll replace % with the index of the line selected:

MODULE USER_COMMAND.

IF OK_CODE(4) = 'STEP'.

MOVE OK_CODE+4 TO VN_LINE.

  • Calculate the absolute value of lines:

VN_lINE = TOP_LINE + VN_LINE - 1.

Max