01-30-2010 12:34 PM
hi friends,i have developed a report which provide us following informatin :
1) sales order with corresponding outbound no,invoice no,freight per invoice,tax per invoice etc.
the report is working fine.only the thing is that the sale order no in the sale order field of report is repeating.
I think it is due to append and clear. i have tried a lot adjusting the things but still not working
plz help. a part of my code is :
Edited by: achalmehra on Jan 30, 2010 1:35 PM
01-30-2010 12:37 PM
select * from VBAK WHERE vkorg IN s_vkorg AND vtweg IN s_vtweg AND spart IN s_spart and KALSM = 'ZMSALE' and VBTYP = 'C'.
select * from VBAP where vbeln = vbak-vbeln .
select * from LIPS where VGPOS = VBAP-POSNR.
select * from LIKP where VKORG in s_vkorg and WADAT_IST in s_date and VBTYP = 'J'and VBELN = LIPS-VBELN.
sale_ord = VBAK-VBELN.
cust_no = VBAK-KUNNR.
dist_channel = VBAK-VTWEG.
nature_sale = VBAK-SPART.
move sale_ord to itab1-field1.
move cust_no to itab1-field2.
move dist_channel to itab1-field4.
move nature_saLe to itab1-field3.
outbnd_no = LIPS-VBELN.
del_date = LIKP-WADAT_IST.
move outbnd_no to itab1-field5.
move del_date to itab1-field6.
select * from VBRP where VGBEL = LIPS-VBELN and VGPOS = LIPS-POSNR.
invoice = VBRP-VBELN.
move invoice to itab1-field7.
select * from VBRK where VBELN = VBRP-VBELN.
s_tax_amt = VBRK-NETWR + VBRK-MWSBK.
move s_tax_amt to itab1-field8.
select * from KONV where KNUMV = VBRK-KNUMV.
if KONV-KSCHL = 'ZM07'or KONV-KSCHL ='ZM04'.
freight = KONV-KWERT.
move freight to itab1-field9.
endif.
if KONV-KSCHL = 'ZM02'or KONV-KSCHL ='ZM03'.
s_tax_amt = KONV-KWERT.
move freight to itab1-field8.
endif.
if KONV-KRECH = 'A'.
rate_tax = ( KONV-KBETR ) / 10.
else.
rate_tax = KONV-KBETR.
endif.
endif.
move rate_tax to itab1-field10.
endselect.
endselect.
append itab1.
clear itab1.
endseLect.
clear itab1.
endselect.
endselect.
clear itab1.
endselect.
clear itab1.
endselect.
END-OF-SELECTION.
Edited by: achalmehra on Jan 30, 2010 1:41 PM