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

Regarding Reports

Former Member
0 Likes
990

Hi Gurus,

I have 4 tables VBRK,VBAK,VBRP & KNA1 and i need to display out put from them when i am taking the internal tables , with which one i need to loop the internal tables and read the data. i.e which is the main internal table & hw can i select that ?

waiting for ur reply

Regards

Srinath

9 REPLIES 9
Read only

Former Member
0 Likes
927

HI ,

Loop on the internal table with VBAK

Edited by: A kumar on Aug 13, 2008 6:40 AM

Read only

Former Member
0 Likes
927

hi,

VBAK contains Sales Order Header Data.

Loop that Table.

VBRK and VBRP provides Billing Header and Item Data which is based on SAles Document No.

KNA1 have Customer Information.

Regadrs

Sumit Agarwal

Read only

Former Member
0 Likes
927

Hi,

Always loop on item table.

Here u have to loop on Billing Document: Item Data VBRP.

Read only

Former Member
0 Likes
927
LOOP the table VBAK.


LOOP VBRP WHERE VGBEL = VBAK-VBELN.
READ TABLE VBRK with key VBELN.

READ KNA1.
append final table.
ENDLOOP.
ENDLOOP.
Read only

Former Member
0 Likes
927

Hi ...

Some are saying one table & others saying other tables . How exactly i will come to know which is the main table and hw to select and loop on that table?

Regards

Srinath

Read only

Former Member
0 Likes
927

hi,

wt ever our friends said is correct if u want only header data ...

& corresponding item data , partner data and customet info...

it will give u only one record...

it multiple line items contains per single sales order it wont give correct anss..

u may miss some records..

if u sales order have more than one line items & u want to display all items..

loop the VBRK internal table pass the rest info....

Regards..

Raju Mummidi.

Read only

Former Member
0 Likes
927

Do like below code.

Loop at it_vbrk.

Loop at it_vbrp where vbeln eq it_vbrk-vbeln.

Read table it_kna1.

Read table it_vbak.

Endloop.

Endloop.

rgds

rajesh

Read only

Former Member
0 Likes
927

Hi you can do like this :

There are two ways like if the billing data mandatory then do like this :

1.

Loop at vbrk. " because for vbrk you need item details

Loop at vbrp where vbeln equals vbrk-vbeln. item details

Read table vbak.

if sy-subrc eq 0

Read table kna1 for kunnr .

endif.

Endloop.

Endloop.

2.

Loop at vbak.

Read table kna1 for kunnr .

read table vbrk for vbeln

if sy-subrc = 0

Loop at vbrp where vbeln equals vbrk-vbeln. item details

Endloop.

endif.

Endloop.

Read only

Former Member
0 Likes
927

Hi,

VBAK(Sales Document: Header Data) is the Main table.

LOOP the table VBAK.

LOOP The table VBRK .

Read the table VBRP.

Read the Table KNA!.

append final internal table.

ENDLOOP.

Regards,

Srinivasa Janardhan.