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

At Exit-command not working

Former Member
0 Likes
2,678

Hi experts.

I am working on At Exit command and in my screen i have field validation and i have coded AT EXIT COMMAND in my PAI to execute when we exiting BACK/CANCEL/EXIT. I have taken Function type as "E' in GUI. but too i am not able to exit without field validation and when i debug the control is not coming to At exit Module. plz help me on this..

waiting for your suggestions.

Mahesh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,777

hi,

Check the demo program DEMO_DYNPRO_AT_EXIT_COMMAND

8 REPLIES 8
Read only

sarbajitm
Contributor
0 Likes
1,777

At Exit-command must be the first statement in the flow logic under PAI. Have tou written it as the first statement?

Read only

Former Member
0 Likes
1,778

hi,

Check the demo program DEMO_DYNPRO_AT_EXIT_COMMAND

Read only

Former Member
0 Likes
1,777

Hi,

let me clarify from you..have u coded like this...

PROCESS AFTER INPUT.

loop at <int table>

endloop.

MODULE < module name> AT EXIT-COMMAND.

in between module and endmodule....

case sy-ucomm.

when 'BACK'.

ur code.

endcase.

Outside the loop plz use the user command module.

Hope this will help..

Plz let me know if ur coding is like this and still it is not working.

Regards,

Rohan.

Read only

Former Member
0 Likes
1,777

Hi,

Write 'At Exit-Command' as the first statement in PAI.

Read only

faisalatsap
Active Contributor
1,777

Hi,

I am using the following way and it is working fine for me.

PROCESS AFTER INPUT.
  MODULE user_exit_command AT EXIT-COMMAND.

*&---------------------------------------------------------------------*
*&      Module  user_exit_command  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module user_exit_command input.

  data: ok_code_0002 type sy-ucomm.
  case ok_code_0002.
    when 'BACK'.
      clear ok_code_0002.
      leave to screen 0.
    when 'EXIT'.
      clear ok_code_0002.
      leave program.
    when 'CANCEL'.
      clear ok_code_0002.
*      leave to transaction 'ZFSLSCB'.
  endcase.
endmodule.                 " user_exit_command  INPUT

Hope will help you to solve your problem,

Kind Regards,

Faisal

Read only

Former Member
0 Likes
1,777

Hi Mahesh,

Please try following code.

PROCESS AFTER INPUT.

MODULE leave_dynpro AT EXIT-COMMAND.

CHAIN.

FIELD v_lifnr.

FIELD wv_ebeln.

MODULE check_ebeln ON CHAIN-REQUEST.

ENDCHAIN.

FIELD v_lifnr MODULE check_lifnr ON REQUEST.

CHAIN.

FIELD wv_lfsnr.

MODULE validate_delivery_no ON CHAIN-REQUEST.

ENDCHAIN.

MODULE user_command_0100.

PROCESS ON VALUE-REQUEST.

FIELD wv_lfsnr MODULE f4_vbeln.

&----


*& Module LEAVE_DYNPRO INPUT

&----


  • text

----


MODULE leave_dynpro INPUT.

PERFORM leave_dynpro.

ENDMODULE. " LEAVE_DYNPRO INPUT

Regards,

Anil

Read only

Former Member
0 Likes
1,777

Hi Mahesh,

Use EXIT statement inside your module. Hope this will soove your issue.

Read only

Former Member
0 Likes
1,777

hi,

thank you all of you for replying to me..

i have rewarded to all of you.

the problem is resolved.

thank you,

Mahesh