2014 Jan 07 5:25 AM
Hi,
Im developing a module pool screen in which a screen is designed with certain fields and those fields are mandatory fields, and i want to exit from the screen when the mandatory fields are Initial it-self, How to achieve this
2014 Jan 07 6:16 AM
Hi Lokesh,
To exit from the module pool screen when the fields are mandatory you need to use At Exit Command.
Create a button or use any button in the starndard tool bar and set their function type as 'E'. Assume you gave function code as 'EXIT' Now creat a module under PAI to write your logic.
PAI.
Module AT_EXIT_COMMAND AT EXIT-COMMAND.
MODULE AT_EXIT_COMMAND INPUT.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.
When you click on the button system will ignore all other conditions and will look for At exit command module and excute the code.
Regards,
Kethan
Hi,
Im developing a module pool screen in which a screen is designed with certain fields and those fields are mandatory fields, and i want to exit from the screen when the mandatory fields are Initial it-self, How to achieve this
2014 Jan 07 5:31 AM
You can make use of back,exit and cancel buttons to do so. Design a gui status for your module pool.
Regards
2014 Jan 07 5:33 AM
Hi,
Check for the detail documentation or demo program in sap ( demo_dynpro*)
you have to handle it like below in other words
The' At Exit' is used in flow logic in module pool . When we click on back button it will bypass the required filed checks.
Code for AT EXIT-COMMAND in flow logic and in module pool program can be written as follows.
In Flow Logic:
PROCESS AFTER INPUT.
MODULE EXIT AT EXIT-COMAND.
In Module Pool Program:
MODULE EXIT.
2014 Jan 07 5:37 AM
Hi,
With out filling the mandatory fields you want to skip the screen then why you put those fields as mandatory. What is your exact requirement.
Use this function module in PBO of the particular screen.
if 'Mandatory fields ' are initial.
call function
'SAPGUI_SET_FUNCTIONCODE'
endif.
2014 Jan 07 6:15 AM
Hi Krishna,
The user get into transaction, But he don't want to process further and he want to exit the transaction at that time if he press the back button it has to go back to initial screen, due to the mandatory field it will not process any PAI, and it will throw error as fill required fields, it's not a good user interface .
To avoid this SAP provide an option AT-EXIT command and we can create icon or user command as type 'E'.
If the user press the exit commands then the AT-EXIT module will be processed automatically without checking the mandatory fields.In which we can write our logic to exit the screen or to process for next screens.
Regards,
KK
2014 Jan 07 6:34 AM
Hi,
Try with this function module.
CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
EXPORTING
FUNCTIONCODE = 'Exit function code'
* EXCEPTIONS
* FUNCTION_NOT_SUPPORTED = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
2014 Jan 07 5:49 AM
Hi Lokesh,
If you want to avoid automatic input check(Mandatory, foreignkey value and proper field format) in standard toolbar, please make that icon as type 'E'.
Then in flow logic,
After the PAI event.
Module mod at exit-command.
Arivazhagan S
2014 Jan 07 5:59 AM
Hi lokesh,
Consider that if your screen has mandatory fields and if you press enter or any other key the error message keeps on coming . So to avoid this you can code your exit code in special modules .
In the opening screen of our custom screen in PAI , create a module like
Module exit at exit-command.
after that double click on the exit , and write your normal coding for exit like Leave to screen 0 or etc., )
you can also alter the code as you wish .
Regards,
Sivaganesh
2014 Jan 07 6:16 AM
Hi Lokesh,
To exit from the module pool screen when the fields are mandatory you need to use At Exit Command.
Create a button or use any button in the starndard tool bar and set their function type as 'E'. Assume you gave function code as 'EXIT' Now creat a module under PAI to write your logic.
PAI.
Module AT_EXIT_COMMAND AT EXIT-COMMAND.
MODULE AT_EXIT_COMMAND INPUT.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE.
When you click on the button system will ignore all other conditions and will look for At exit command module and excute the code.
Regards,
Kethan
2016 Sep 14 8:06 AM
Nice Kethan, don't forget that in PF-STATUS the function code EXIT has to be defined with function type 'E'
2014 Jan 07 6:36 AM
2014 Jan 07 9:44 AM
2014 Jan 07 10:05 AM
Create a module with AT EXIT Command in the PROCESS AFTER INPUT of the screen that you are designing,
Example - Program SAPMV45A Screen no -101 for transcation VA01
MODULE FUNKTION_AUSFUEHREN AT EXIT-COMMAND.
2014 Jan 07 10:24 AM
hi lokesh,
Double click on the back , cancel logoff icons and maintain function codeas and Function type AS 'E'.
after that In PAI ... create a module..
module <modulename> at-exitcommand.
Regards,
Siva
2016 Sep 15 8:49 AM
you have to design PF-Status with exit button has to be defined with function type E and
you have write module module module_name at-exit command(key word).
then write logic
if sy-ucomm = 'EXIT'.
leave screen.
endif.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |