12-20-2006 1:56 AM
Hi friends,
i am working with shipping data. i am supposed to pick data from likp and lips and then perform loop on this internal table and pick order type from vbak and selct VSBED field from VBAK.also i have to extract VSTEL field name fromLIKP also.i am able to extract data from likp and lips but the looping and extracting data from vbak is what is not making sense.please help me as to how to approach this
Regards,
Ajith Saxena
12-20-2006 2:15 AM
Hi,
Use FOR ALL ENTRIES...
Example..
-
SELECT VBELN POSNR VGBEL
FROM LIPS
INTO TABLE T_LIPS
WHERE ...
IF NOT T_LIPS IS INITIAL.
SELECT VBELN VSBED AUART INTO TABLE T_VBAK
FROM VBAK
FOR ALL ENTRIES IN T_LIPS
WHERE VBELN = T_LIPS-VGBEL.
in the internal table T_VBAK..You will have all the order types and VSBED for the corresponding orders..
ENDIF.
Thanks,
Naren
12-20-2006 2:15 AM
Hi,
Use FOR ALL ENTRIES...
Example..
-
SELECT VBELN POSNR VGBEL
FROM LIPS
INTO TABLE T_LIPS
WHERE ...
IF NOT T_LIPS IS INITIAL.
SELECT VBELN VSBED AUART INTO TABLE T_VBAK
FROM VBAK
FOR ALL ENTRIES IN T_LIPS
WHERE VBELN = T_LIPS-VGBEL.
in the internal table T_VBAK..You will have all the order types and VSBED for the corresponding orders..
ENDIF.
Thanks,
Naren
12-20-2006 2:23 AM
Hi Narendran Murthy,
thank you very much for the code. I am also using LIKP table .so is it like i have to first select data on INNER JOIN on LIKP and LIPS using VBELN key field.
then loop on this table and selct data from vbak.
and more thing is do i need to create another internal table for holding VBAK data and then append it to final internal table by looping it.
12-20-2006 2:41 AM
Hi,
Yes..
1) Create an internal table for holding the values from LIKP & LIPS..Let's say IT_LIKP. Get the records from the LIKP & LIPS and store the records in the internal table IT_LIKP.
2) Create another internal table for holding the values from VBAK..Let's say IT_VBAK..Get the records from VBAK for the corresponding sales order number in the internal table IT_LIKP and store the resulting records in the internal table IT_VBAK..
3) Process the internal table IT_LIKP & IT_VBAK and merge it and store the records in the final internal table IT_FINAL..
Thanks,
Naren
12-20-2006 3:13 AM
Thank you Narayana murthy .your answer is really helpful.Thanks a lot