‎2007 Apr 19 11:26 AM
Kindly write some sample code for the below Logic.
For a set of Deliveries entered on the selection screen get the relevant data from LIKP & LIPS.
for all the deliveries selected get the sales order data from VBAK & VBAP based on the VGBEL & VGPOS in LIPS.
The Output internal table should contain only deliveries which are created with reference to a sales order.
Thanx in Advance.
Akshitha.
‎2007 Apr 19 11:34 AM
Hi,
Select avbeln bposnr bmatnr blfimg bvgbel bvgpos into table ITAB
from likp as a join lips as b on Avbeln = bvbeln
where a~vbeln in s_vbeln..
if not itab[] is initial.
select avbeln bposnr b~matnr ... into table itab1 from vbak as a join vbap as b
on avbeln = bvbeln
for all entries in itab where avbeln = itab-vgbel and bposnr = itab-vgpos.
endif.
loop at itab.
read table itab1 with key vbeln = itab-vgbel posnr = itab-vgpos.
if sy-subrc <> 0.
delete itab index sy-tabix.
endif.
endloop.
Now ITAB will have only deliveries created against Sales orders.
reward points if useful
regards,
Anji
‎2007 Apr 19 11:37 AM
DATA:
t_likp type table of likp with header line,
t_lips type table of lips with header line,
t_vbak type table of vbak with header line,
t_vbap type table of vbap with header line.
SELECT *
from likp
into table t_likp
up to 10 rows.
if sy-subrc eq 0.
SELECT *
from lips
into table t_lips
for all entries in t_likp
where vbeln eq t_likp-vbeln.
if sy-subrc eq 0.
select *
from vbap
into table t_vbap
for all entries in t_lips
where vbeln eq t_lips-vbeln
and posnr eq t_lips-posnr.
endif.
Try this....