‎2009 Feb 09 11:36 AM
Hi,
I wanted to have my internal table data output on screen.
My code is as follows:---
tables: kna1.
types: begin of zkna1,
kunnr type kna1-kunnr,
name1 type kna1-name1,
end of zkna1.
data: it_kna1 type standard table of zkna1,
wa_kna1 like line of it_kna1.
select kunnr name1 from kna1 into table it_kna1 up to 5 rows.
call screen 100 starting at 10 2 ending at 100 12.
INCLUDE ZSC_STATUS_0100O01.
INCLUDE ZSC_USER_COMMAND_0100I01.
*************************************************************
----
***INCLUDE ZSC_STATUS_0100O01 .
----
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS '100'.
SET TITLEBAR '100'.
SUPPRESS DIALOG.
***LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
LEAVE TO LIST-PROCESSING .
loop at it_kna1 into wa_kna1.
write: / wa_kna1-kunnr, wa_kna1-name1.
endloop.
ENDMODULE. " STATUS_0100 OUTPUT
***********************************
----
***INCLUDE ZSC_USER_COMMAND_0100I01 .
----
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
MODULE USER_COMMAND_0100 INPUT.
data : save_ok_code(4).
move sy-ucomm to save_ok_code.
case save_ok_code.
when 'CANC'.
LEAVE program.
endcase.
ENDMODULE. " USER_COMMAND_0100 INPUT
On the screen, the output is displayed.
But, when I click the 'CANCEL' button its not working and Iam not able to close the screen.
What may be d problem??
Thanks,
Shivaa......
‎2009 Feb 09 11:41 AM
‎2009 Feb 09 11:42 AM
‎2009 Feb 09 11:44 AM
Hi,
Check the OK CODE of cancel button
whtheer it is CANC or CANCEL.
u can debug ur code and can check.
Regards,
Nagaraj
‎2009 Feb 09 11:45 AM
Hi,
check the name of the cancle button given by you in screen painter.
i.e weather it is 'CANC' or anything else.
hope it can be useful 4 u.
Regards
Rajesh Kumar
‎2009 Feb 09 11:46 AM
Hi,
First check out the sy-ucomm value for cancel..i.e..whether sy-ucomm value is coming or not by debugging..if it is, then check the PF-status CANCEL name is properly called into u r program
i.e at when 'CANC'
check this value and pf-status cancel text
or not...or else..
In your program,just write like this..
when 'CANC'.
LEAVE to screen.
endcase.
‎2009 Feb 09 11:46 AM
hi
case save_ok_code.
when 'CANC'.
LEAVE program.
endcase.
here it should be when 'rw' ( put rw as cancel in pf-status) instead of CANC
it will work fine
Thanks
Viquar Iqbal
‎2009 Feb 09 11:50 AM
Hi nagaraj,
I debugged the code. the PF-STATUS is pretty fine.
But, whats happening is even b4 the display of internal table output on the sub-screen,. not only PBO module but also PAI module is getting executed.
After display of oputput on Screen, when I press the CANC button, th control is not going to PAI module at all.
What may be the reason???
Please have a re-look at my code.
‎2009 Feb 09 11:54 AM
Hi,
Please use the code given below. hope it helps you...
tables: kna1.
types: begin of zkna1,
kunnr type kna1-kunnr,
name1 type kna1-name1,
end of zkna1.
data : save_ok_code(4).
data: it_kna1 type standard table of zkna1,
wa_kna1 like line of it_kna1.
select kunnr name1 from kna1 into table it_kna1 up to 5 rows.
call screen 100 starting at 10 2 ending at 100 12.
INCLUDE ZSC_STATUS_0100O01.
INCLUDE ZSC_USER_COMMAND_0100I01.
*************************************************************
-
***INCLUDE ZSC_STATUS_0100O01 .
-
&----
*& Module STATUS_0100 OUTPUT
&----
text
-
MODULE STATUS_0100 OUTPUT.
if save_ok_code <> 'CANC'.
SET PF-STATUS '100'.
SET TITLEBAR '100'.
SUPPRESS DIALOG.
***LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
LEAVE TO LIST-PROCESSING .
loop at it_kna1 into wa_kna1.
write: / wa_kna1-kunnr, wa_kna1-name1.
endloop.
endif.
ENDMODULE. " STATUS_0100 OUTPUT
***********************************
-
***INCLUDE ZSC_USER_COMMAND_0100I01 .
-
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
-
MODULE USER_COMMAND_0100 INPUT.
move sy-ucomm to save_ok_code.
case save_ok_code.
when 'CANC'.
LEAVE program.
endcase.
ENDMODULE. " USER_COMMAND_0100 INPUT
If it doesn't work please try debugging and let me know where exactly the problem is...
Regards,
Siddarth
‎2009 Feb 09 12:21 PM
Hi Iqbal,
When i kept 'rw' ( put rw as cancel in pf-status) instead of CANC, its really working yaar........
wats this 'rw'???
1 more thing I also have 2 more buttons with fcodes 'DIS' (Display) and 'CHG' (Change), but these are not working.
What should I do now??
Plz reply....