Skip to Content
0
Former Member
Jan 10, 2008 at 08:17 AM

Issue with WRITE statement from Internal Table

1737 Views

Hi All,

I have written the below code in a infoset query, the syntax check is ok & when i run the query in debugging mode, i find the internal table being filled with the values & the write statement outputing the values as well.

But the problem is when i execute the query the output does not show all the lines, instead just displays the last record . What could be the mistake?

Is it because i have defined Y_EBELN, Y_EBELP & Y_OPENQTY as nodes in the Extras Tab of the infoset & have chosen this for display in my query? How to display the output from my internal table in my query output?

Hope my problem is clear, await clarification.

Vivek

Code

types:

Begin of itab,

wl_ebeln type eket-ebeln,

wl_ebelp type eket-ebelp,

wl_openqty type eket-menge,

End of itab.

Data: il_po type table of itab with header line.

*Display open PO for materials

SELECT EKETEBELN EKETEBELP EKETMENGE EKETWEMNG EKET~EINDT

INTO (Y_EBELN, Y_EBELP, WL_MENGE, WL_WEMNG, Y_EINDT)

FROM EKET

INNER JOIN EKPO

ON EKETEBELN = EKPOEBELN

AND EKETEBELP = EKPOEBELP

INNER JOIN MARD

ON EKPOMATNR = MARDMATNR

AND EKPOWERKS = MARDWERKS

AND EKPOLGORT = MARDLGORT

WHERE EKPO~MATNR = MARD-MATNR

AND EKPO~WERKS = MARD-WERKS

AND EKPO~LGORT = MARD-LGORT

AND EKPO~LOEKZ = SPACE

AND EKPO~ELIKZ = SPACE.

*Display only still open qty per schedule line

Y_OPENQTY = WL_MENGE - WL_WEMNG.

il_po-wl_ebeln = Y_EBELN.

il_po-wl_ebelp = Y_EBELP.

il_po-wl_openqty = Y_OPENQTY.

append il_po.

ENDSELECT.

ENDIF.

Loop at il_po.

write:/ il_po-wl_ebeln, il_po-wl_ebelp, il_po-wl_openqty.

endloop.