Skip to Content
0
Former Member
Feb 29, 2008 at 01:41 PM

Re:for all entries

9 Views

I wrote the code like is this correct is it is code is correct , i am not using the is initial statement before using the for all entries statement but it will show the same results, in this code any mistakes can any one plz modify and give the correct code. THANKS in Advance

DATA : BEGIN OF i_sales OCCURS 5,

vbeln LIKE vbak-vbeln,

erdat LIKE vbak-erdat,

netwr LIKE vbak-netwr,

END OF i_sales.

DATA: BEGIN OF itab OCCURS 0,

vbeln LIKE vbap-vbeln,

posnr LIKE vbap-posnr,

matnr LIKE vbap-matnr,

END OF itab.

SELECT-OPTIONS sno FOR i_sales-vbeln.

SELECT vbeln

erdat

netwr

INTO TABLE i_sales

FROM vbak

where vbeln in sno.

*LOOP AT i_sales.

  • WRITE:/ i_sales-vbeln,i_sales-erdat,i_sales-netwr.

*ENDLOOP.

select vbeln

posnr

matnr

INTO TABLE itab

FROM vbap

FOR ALL ENTRIES IN i_sales

WHERE vbeln = i_sales-vbeln.

LOOP AT itab.

WRITE:/ itab-vbeln,itab-posnr,itab-matnr.

ENDLOOP.