‎2008 Mar 14 1:36 AM
Hi Gurus
Can Anyone correct my report to display a simple report for internal table
It is giving error on select fkdat ..........into it_s903
the error is workarea (or internal table) IT_S903 is not flat or contains reference or internal tables as components
&----
*& Report Z_CUSTOMER_SOLD *
*& *
&----
&----
&----
REPORT Z_CUSTOMER_SOLD
line-size 132
line-size 110
line-count 65
no standard page heading.
Declaring Tables
tables:
s903,
s901,
vbak,
vbap,
kna1.
Constants Declaration
constants mark value 'x'.
Type Declaration
types:
begin of ty_s903,
vbeln like s903-vbeln, " billing document
fkdat like s903-fkdat, " billing date for billing index and printout
pkunag like s903-pkunag," sold to party
vkorg like s903-vkorg, " sales organization
matnr like s903-matnr, " material no
fkart like s903-fkart,
fksto like s903-fksto,
fkimg like s903-fkimg, " actual invoice quantity
werks like s903-werks, " plant
prctr like s903-prctr,
vkbur like s903-vkbur, " sales office
netwr like s903-netwr, " net value of billing item document currency
vgbel like s903-vgbel,
vgpos like s903-vgpos, "
vrkme like s903-vrkme, " sales unit
end of ty_s903,
ty_it_s903 type ty_s903 occurs 0.
Data Declarations
DATA: gv_title1 TYPE sylisel, " Report title
gv_dial. " Color flag
Internal Tables
data:
Internal table to store
it_s903 type standard table of ty_it_s903.
work areas
data:
wa_s903 type ty_s903.
SELECTION OPTONS
selection-screen: begin of block b1 with frame title text-001.
select-options:
s_dat for s903-fkdat, " Delivery OBLIGATORY,
s_pkunag for s903-pkunag,
s_vrkme FOR S903-vrkme,
s_fkimg for s903-fkimg,
s_werks for s903-werks.
selection-screen end of block b1.
start of selection
START-OF-SELECTION.
fetch mail data.
PERFORM fetch_data.
*TOP OF PAGE
TOP-OF-PAGE.
*
WRITE:/50(40) ' CUSTOMER SOLD BY QUANTITY' CENTERED ,2 'Page', SY-PAGNO.
WRITE:/50(40) '---------------------------------------' CENTERED .
FORMAT INTENSIFIED OFF.
WRITE:/2 SY-DATUM COLOR 3, SY-UZEIT .
ULINE.
"CENTERED.
skip.
"FORMAT COLOR COL_HEADING.
ULINE.
FORMAT COLOR 3.
*
WRITE:/1 SY-VLINE,
*
2 'DATE SOLD',12 SY-VLINE,
13 'PARTY' ,25 SY-VLINE,
26 'NAME' ,70 SY-VLINE,
71 'UOM' ,76 SY-VLINE,
77 'QUANTITY' , 85 SY-VLINE,
86 'PLANT' ,110 SY-VLINE.
ULINE.
FORMAT COLOR 3 OFF.
ULINE.
END-OF-PAGE.
*&----
& Form Fetch_data
*&----
Fetching s903 details from database and inserting into internal tables
FORM fetch_data.
clear it_s903.
refresh it_s903.
SELECT fkdat pkunag vrkme fkimg werks from s903
into table it_s903
WHERE
fkdat in s_dat
and
pkunag in s_pkunag
and
vrkme in s_vrkme
and
fkimg in s_fkimg
and
werks in s_werks.
if sy-subrc ne 0.
message s001(zgen).
exit.
endif
loop at it_s903 into wa_s903
AT NEW FKDAT.
WRITE:/1 wa_s903-fkdat.
ENDAT.
WRITE:/1 SY-VLINE,
wa_s903-fkdat, "under 'DATE SOLD',12 SY-VLINE,
wa_s903-pkunag, "under 'PARTY' ,25 SY-VLINE,
wa_s903-vrkme, "under 'UOM' LEFT-JUSTIFIED ,76 SY-VLINE,
wa_s903-fkimg, "under 'QUANTITY' centered , 85 SY-VLINE,
wa_s903-werks. "under 'PLANT' ,110 SY-VLINE.
uline.
endloop.
ENDFORM.
‎2008 Mar 14 2:43 AM
Hi,
Write like below bold letters.
SELECT fkdat pkunag vrkme fkimg werks from s903
into CORRESPONDING FIELDS OF table it_s903
WHERE
fkdat in s_dat
and
pkunag in s_pkunag
and
vrkme in s_vrkme
and
fkimg in s_fkimg
and
werks in s_werks.
Even still not working.
data:
**Internal table to store
it_s903 type standard table of ty_it_s903 WITH HEADER LINE.
Pls. reward if useful....
‎2008 Mar 14 2:43 AM
Hi,
Write like below bold letters.
SELECT fkdat pkunag vrkme fkimg werks from s903
into CORRESPONDING FIELDS OF table it_s903
WHERE
fkdat in s_dat
and
pkunag in s_pkunag
and
vrkme in s_vrkme
and
fkimg in s_fkimg
and
werks in s_werks.
Even still not working.
data:
**Internal table to store
it_s903 type standard table of ty_it_s903 WITH HEADER LINE.
Pls. reward if useful....
‎2008 Mar 14 2:57 AM
Hello Murlikrishna
I implement your report but after doing changes itis displaying as
field corresponding is unknow it is neither in one of the specified table nor defined by DATA statement
Please comment
regards
Piroz
‎2008 Mar 14 3:38 AM
‎2008 Mar 14 3:46 AM
Hi Piroz,
can you give me teh description of table s903 and what type of table is it???
regards,