2008 May 13 6:54 AM
Hi Experts
I have the requirement as follows:
When I press /N or Exit Button(Yellow Arrow) from the screen, it shoud trigger a subroutine to reset some variables or entries.
How to do this?
Rewardable
Santo!
2008 May 13 6:57 AM
hi,
Check the ok code of it in debug mode and write the perform based on that ... check out SY-UCOMM to know that ...
Regards,
Santosh
Hi Experts
I have the requirement as follows:
When I press /N or Exit Button(Yellow Arrow) from the screen, it shoud trigger a subroutine to reset some variables or entries.
How to do this?
Rewardable
Santo!
2008 May 13 6:57 AM
hi,
Check the ok code of it in debug mode and write the perform based on that ... check out SY-UCOMM to know that ...
Regards,
Santosh
2008 May 13 7:12 AM
Hi,
in PAI, create a module EXIT_COMMAND.
module EXIT_COMMAND.
if ok_code = 'BACK'.
...
endif.
endmodule.
2008 May 13 7:21 AM
hope you are having this requirement for a custom screen and not a standart sap screen.
for custom screen, you would have set the ok code for the yellow button in the PF-STATUS settings. Use that ok code and catch it in your program and write your code accordingly there.
I am not very sure if there is an exit/badi available for doing this in a standard SAP Screen.
2008 May 13 7:33 AM
Hi
TABLES kna1.
*-- Declaring the structure,internal table and workarea for Kna1 table.--*
TYPES:BEGIN OF st_kna1,
kunnr TYPE kna1-kunnr,
name1 TYPE kna1-name1,
ort01 TYPE kna1-ort01,
pstlz TYPE kna1-pstlz,
regio TYPE kna1-regio,
stras TYPE kna1-stras,
END OF st_kna1.
DATA:wa_kna1 TYPE st_kna1,
it_kna1 TYPE STANDARD TABLE OF st_kna1.
--
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'DISPLAY'.
SELECT kunnr
name1
ort01
pstlz
regio
stras
FROM kna1
INTO TABLE it_kna1
WHERE kunnr = kna1-kunnr.
IF sy-subrc EQ 0.
LOOP AT it_kna1 INTO wa_kna1.
kna1-kunnr = wa_kna1-kunnr.
kna1-name1 = wa_kna1-name1.
kna1-ort01 = wa_kna1-ort01.
kna1-pstlz = wa_kna1-pstlz.
kna1-regio = wa_kna1-regio.
kna1-stras = wa_kna1-stras.
ENDLOOP.
ELSE.
MESSAGE i001.
ENDIF.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
when 'EXIT'.
PERFORM LEAVING_SCREEN.
ENDCASE.
ENDMODULE. "USER_COMMAND_0100 INPUT
--
MODULE status_0100 OUTPUT.
SET PF-STATUS 'S0100'.
SET TITLEBAR 'S100'.
ENDMODULE. " STATUS_0100 OUTPUT
&----
*& Form LEAVING_SCREEN
&----
text
----
--> p1 text
<-- p2 text
----
form LEAVING_SCREEN .
LEAVE PROGRAM.
endform. " LEAVING_SCREEN
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |