Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

select date from likp lips and vbak table

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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

0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

Thank you Narayana murthy .your answer is really helpful.Thanks a lot