Skip to Content
author's profile photo Former Member
Former Member

Regarding Reports

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

9 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 13, 2008 at 04:33 AM

    HI ,

    Loop on the internal table with VBAK

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 13, 2008 at 04:37 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 13, 2008 at 04:37 AM

    Hi,

    Always loop on item table.

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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 13, 2008 at 04:39 AM
    LOOP the table VBAK.
    
    
    LOOP VBRP WHERE VGBEL = VBAK-VBELN.
    READ TABLE VBRK with key VBELN.
    
    READ KNA1.
    append final table.
    ENDLOOP.
    ENDLOOP.
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 13, 2008 at 04:45 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 13, 2008 at 04:46 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 13, 2008 at 04:50 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 13, 2008 at 05:14 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 13, 2008 at 05:23 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.