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

Internal table data on screen problem

Former Member
0 Likes
1,095

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......

9 REPLIES 9
Read only

Former Member
0 Likes
1,069

Hi Shiva,

Please re-check the PF Status once.

Thanks

Kalyan

Read only

Former Member
0 Likes
1,069

hi....

you should try with

data: save_ok_code(5).

regards

Read only

former_member404244
Active Contributor
0 Likes
1,069

Hi,

Check the OK CODE of cancel button

whtheer it is CANC or CANCEL.

u can debug ur code and can check.

Regards,

Nagaraj

Read only

Former Member
0 Likes
1,069

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

Read only

Former Member
0 Likes
1,069

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.

Read only

viquar_iqbal
Active Contributor
0 Likes
1,069

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

Read only

Former Member
0 Likes
1,069

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.

Read only

Former Member
0 Likes
1,069

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

Read only

Former Member
0 Likes
1,069

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....