Application Development and Automation 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: 
Read only

Report

Former Member
0 Likes
734

Hi experts,

i am developing one report.....

i am selecting customer-name from vbak table and delivery order data of customer from lips table.

but i am confused how do i take data of customer and related delivery data of that customer from lips table, since my customer data is in vbak and delivery data in lips?

Regards

Saurabh

1 ACCEPTED SOLUTION
Read only

SantoshKallem
Active Contributor
0 Likes
716

VBAK-KUNNR = KNA1-KUNNR, WITH THIS RELATION U CAN RETRIVE THE DATA FROM KNA1 ( I THINK U NEED NAME HERE)

VBAP-VBELN = LIPS-VGBEL AND

VBAP-POSNR = LIPS-VGPOS.

SELECT VBAK~VBELN

VBAK~KUNNR

VBAK~VKORG

VBAK~ERDAT

VBAK~NETWR

VBAP~POSNR

LIPS~MATNR

VBAP~KWMENG

LIKP~VBELN

LIKP~LFDAT

LIPS~LFIMG

LIKP~NETWR

KNA1~NAME1

FROM VBAK INNER JOIN VBAP ON VBAKVBELN = VBAPVBELN

INNER JOIN LIPS ON LIPSVGBEL = VBAPVBELN AND

LIPSVGPOS = VBAPPOSNR

INNER JOIN LIKP ON LIKPVBELN = LIPSVBELN

INNER JOIN KNA1 ON VBAKKUNNR = KNA1KUNNR

INTO TABLE ITAB

WHERE VBAK~VBELN IN S_ORDER AND

VBAK~VKORG IN ORG AND

VBAK~KUNNR IN CUST.

REGARDS..

SANTHOSH REDDY

10 REPLIES 10
Read only

former_member378318
Contributor
0 Likes
716

Hi,

Use the SELECT statement with the addition JOIN on tables VBAK and LIPS.

Read only

Former Member
0 Likes
716

i think you can vblen is the primary key

use that for selecttion

Read only

Former Member
0 Likes
716

hi,

which field should be used in innerjoin condition?

Read only

0 Likes
716

SELECT ....

INTO ...

FROM VBAK AS VBAK

JOIN LIPS AS LIPS

ON LIPSVBELN EQ VBAKVBELN

WHERE ...

Hope it helps.

Read only

Former Member
0 Likes
716

Hi,

u can link vbak and lips thru vbap table .

lips-vgbel = vbap-vbeln and lips-vgpos = vbap-posnr and

vbap-vbeln = vbak-vbeln

Regards,

Ashok...

Read only

Former Member
0 Likes
716

Hi,

try this

SELECT ....

INTO TABLE.....

FROM VBAK

INNER JOIN LIPS

ON vbakvbeln = lipsvbeln

WHERE ...

If helpful reard points.

Read only

Former Member
0 Likes
716

Hi,

<b>vbeln </b> is the primary key for vbak and lips. if u want to join then,do this

select vbeln from lips

into itab

for all entries in itab-vbak

where vbeln = itab-vbak-vbeln

this is much faster than joining the two tables.

reward if usefull..

Read only

0 Likes
716

Mackoy,

Your example makes little sense, if you can get it to work please post the exact syntax again.

Read only

SantoshKallem
Active Contributor
0 Likes
717

VBAK-KUNNR = KNA1-KUNNR, WITH THIS RELATION U CAN RETRIVE THE DATA FROM KNA1 ( I THINK U NEED NAME HERE)

VBAP-VBELN = LIPS-VGBEL AND

VBAP-POSNR = LIPS-VGPOS.

SELECT VBAK~VBELN

VBAK~KUNNR

VBAK~VKORG

VBAK~ERDAT

VBAK~NETWR

VBAP~POSNR

LIPS~MATNR

VBAP~KWMENG

LIKP~VBELN

LIKP~LFDAT

LIPS~LFIMG

LIKP~NETWR

KNA1~NAME1

FROM VBAK INNER JOIN VBAP ON VBAKVBELN = VBAPVBELN

INNER JOIN LIPS ON LIPSVGBEL = VBAPVBELN AND

LIPSVGPOS = VBAPPOSNR

INNER JOIN LIKP ON LIKPVBELN = LIPSVBELN

INNER JOIN KNA1 ON VBAKKUNNR = KNA1KUNNR

INTO TABLE ITAB

WHERE VBAK~VBELN IN S_ORDER AND

VBAK~VKORG IN ORG AND

VBAK~KUNNR IN CUST.

REGARDS..

SANTHOSH REDDY

Read only

Former Member
0 Likes
716

Hi,

ooppsss... sori for that! this will clear you up.

select vbeln from lips into itab-lips

for all entries in vbak

where vbeln = vbak-vbeln.

regards,

Mackoy.