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

Report :Write Statement

radhushankar
Participant
0 Likes
578

Hi all

i have created a report, in this when i try to execute instead of showing the output which i mentioned in the write statement, its getting out of the transaction,even i debugging the write statement is getting updated..here the code is.

&----


*

*& Report ZRECOVERY_PERCENTAGE

*&

&----


*&

*&

&----


REPORT zrecovery_percentage line-size 250 no standard page heading.

TABLES:VBRK,

VBRP,

VBAK,

VBAP,

KONV.

                                            • SCREEN DECLARATION*********************

SELECTION-SCREEN : BEGIN OF BLOCK sd WITH FRAME TITLE text-001.

SELECT-OPTIONS : date FOR sy-datum . " DATE

PARAMETERS:zkunnr LIKE vbak-kunnr. " CUSTOMER NUMBER

PARAMETERS:zmatnr LIKE vbap-matnr. "MATERIAL NUMBER

SELECTION-SCREEN: END OF BLOCK sd.

****************************************************************

data : valid_kunnr like vbak-kunnr.

data : valid_matnr like vbap-matnr.

data : begin of itab occurs 0,

vbeln like vbak-vbeln,

erdat like vbak-erdat,

end of itab.

data : begin of itab1 occurs 0,

vbeln like vbap-vbeln,

matnr like vbap-matnr,

erdat like vbap-erdat,

end of itab1.

data : begin of itab2 occurs 0,

erdat like vbak-erdat,

vbeln like vbak-vbeln,

knumv like vbak-knumv,

end of itab2.

data : begin of itab3 occurs 0,

knumv like konv-knumv,

kawrt like konv-kawrt,

end of itab3.

data : begin of final_itab occurs 0,

erdat like vbak-erdat,

vbeln like vbak-vbeln,

kawrt like konv-kawrt,

end of final_itab.

data: final_itab_wa like line of final_itab.

***************validation of screen fields***********************

at selection-screen on date.

if date is initial.

message e001(1) with 'Enter the date'.

endif.

at selection-screen on zkunnr.

if zkunnr is initial.

message e001(1) with 'Enter the customer number'.

else.

select single kunnr

from vbak

into valid_kunnr

where kunnr = zkunnr.

if sy-subrc ne 0.

message e001(1) with 'Enter a valid customer number'.

endif.

endif.

at selection-screen on zmatnr.

if zmatnr is initial.

message e001(1) with 'Enter the material number'.

else.

select single matnr

from vbap

into valid_matnr

where matnr = zmatnr.

if sy-subrc ne 0.

message e001(1) with 'Enter a valid material number'.

endif.

endif.

********************************************************************************

clear itab.

refresh itab.

select vbeln erdat

from vbak

into itab

where

kunnr = zkunnr and

auart = 'ZOQT' and

erdat in date.

append itab.

clear itab.

endselect.

clear valid_matnr.

clear itab1.

refresh itab1.

loop at itab.

select vbeln matnr erdat

from vbap

into itab1

where matnr = zmatnr and

vbeln = itab-vbeln.

append itab1.

clear itab1.

endselect.

endloop.

if sy-subrc ne 0.

message e001(1) with 'Enter a valid details'.

endif.

clear itab2.

refresh itab2.

loop at itab1.

select erdat vbeln knumv

from vbak

into itab2

where vbeln = itab1-vbeln.

append itab2.

clear itab2.

endselect.

endloop.

clear itab3.

refresh itab3.

loop at itab2.

select knumv kawrt

from konv

into itab3

where knumv = itab2-knumv and

kschl = 'ZR00'.

append itab3.

clear itab3.

endselect.

endloop.

loop at itab2.

loop at itab3 where knumv = itab2-knumv.

final_itab-erdat = itab2-erdat.

final_itab-vbeln = itab2-vbeln.

final_itab-kawrt = itab3-kawrt.

append final_itab.

clear final_itab.

endloop.

endloop.

loop at final_itab into final_itab_wa.

write:/ final_itab_wa-erdat.

endloop.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
556

when u execute in debugging mode just check whether itab2 & itab3 internal tables have any data in it. If there is data, then check whether final_itab has data in it.

If there is no data in final_itab, then the report comes out without displaying any data.

4 REPLIES 4
Read only

Former Member
0 Likes
557

when u execute in debugging mode just check whether itab2 & itab3 internal tables have any data in it. If there is data, then check whether final_itab has data in it.

If there is no data in final_itab, then the report comes out without displaying any data.

Read only

0 Likes
556

i checked ramesh my final_itab is having data.i want to make u one thing clear that its not taking me to the report output screen.its going out of the transaction.

Read only

0 Likes
556

Check the definition of the transaction code calling the report - there was a similar posting a couple of weeks ago where we resolved it by re-creating the transaction as a report not module (you can tell from the PF-STATUS that is showing in the report parameter screen). See:

Read only

0 Likes
556

Thanks jonathan i forgot to add some events and while creating the tcode also i failed to select it for reports and selection-screen..thanks for ur advice..i have awarded u the points.