Application Development 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: 

Table control Overwrite ok_code code.

amysh95
Participant
0 Kudos

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

former_member378318
Contributor

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

6 REPLIES 6

former_member378318
Contributor

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

Sandra_Rossi
Active Contributor
0 Kudos

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

former_member182550
Active Contributor

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

Rich

0 Kudos

yes. i already did.

former_member378318
Contributor
0 Kudos

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.

DoanManhQuynh
Active Contributor
0 Kudos

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.