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

Table control Overwrite ok_code code.

amysh95
Participant
0 Likes
1,788

Hey,

I made a table control and use my validation in PAI as.

in PAI.

loop at itab.

chain.

field1..

field 2..

field 3 module validate.

endchain.

.

.

now on screen if i press my back (pf-status) this validation code overwrite my back code (leave to screen 0.).

How can i resolve this issue?

1 ACCEPTED SOLUTION
Read only

former_member378318
Contributor
1,465

Take a look at the SAP Help for ON EXIT-COMMAND.

6 REPLIES 6
Read only

former_member378318
Contributor
1,466

Take a look at the SAP Help for ON EXIT-COMMAND.

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,465

What means "this validation code overwrite my back code" ?

Read only

Former Member
1,465

Have you defined a variable in the ok code field for the screen? (It's generally the last field on the element list).

Rich

Read only

0 Likes
1,465

yes. i already did.

Read only

former_member378318
Contributor
0 Likes
1,465

As I already said. If you want the BACK/EXIT/CANCEL functions to override the PAI logic then you can use on-exit command.

1) In your gui status for the function code BACK set the Functional Type to E (Exit Command)

2) In your PAI make this your first statement (before your PAI logic):

MODULE handle_exit AT EXIT-COMMAND.

loop at itab.

chain.

field1..

field 2..

field 3 module validate.

endchain.

3) Code your exit module like you want:

MODULE handle_exit INPUT.
CASE ok_code.
WHEN 'BACK' OR '????'.
SET SCREEN 0.
LEAVE SCREEN.
ENDCASE.

ENDMODULE.

Read only

DoanManhQuynh
Active Contributor
0 Likes
1,465

first if you defined back button in gui status = type E (on exit command) and call a module with extend: ON EXIT-COMMAND, when you click back button it will not go through the chain loop but go to that module.

second, you said "this validation code overwrite my back code", so i must guess you didnt define back button as exit type also you change or clear ok code inside validation method.