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

Itab with data from VBFA

Hi,

for an sales order i found some entries in the VBFA and have will fill this

data in an internal table. I have to select only delivery, goods movement and Invoice for an sales order. Finding this data is no problem but i have problems

to fill the internal table.

DATA: begin of itab occurs 0,

vbeln_s like vbfa-vbelv, "Sales Order

vbeln_j like vbfa-vbeln, "Delivery

vbeln_r like vbfa-vbeln, "Goods movement

vbeln_m like vbfa-vbeln, "Invoice.

end of itab.

the itab shell be filled like this with 3 Deliveries and 5 invoices:

vbeln_s vbeln_j vbeln_r vbeln_m

2121 80000001 4900000001 90000001

2121 80000002 4900000002 90000002

2121 80000003 4900000003 90000003

2121 90000004

2121 90000005

Any idea? Thanks.

Regards, Dieter

The values 90000004 and 90000005 shell be under vbeln_M

Dieter

Message was edited by:

Dieter Gröhn

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Jul 11, 2007 at 08:13 AM

    HI,

    data : begin of itemp occurs 0,

    vbeln_r like vbfa-vbeln, "Goods movement

    vbeln_m like vbfa-vbeln, "Invoice.

    end of itemp.

    DATA: begin of itab occurs 0,

    vbeln_s like vbfa-vbelv, "Sales Order

    vbeln_j like vbfa-vbeln, "Delivery

    <b>---> Include table i_temp here</b>

    end of itab.

    Best regards,

    Prashant

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      delete itab where VBELM is initial.

      delete itab where VBELF is initial.

      loop at itab.

      at first VBELL.

      read table itab with key VBELL = itab-VBELL.

      write: itab.

      endat.

      endloop.

      Sorry AT NEW VBELL. not at first

      Message was edited by:

      Sumi Vasu

  • author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2007 at 02:49 PM

    Hi,

    thanks for answers!

    i solve in anoter way by reading VBFA

    2 times and fill 2 itabs.

    After this i put this 2 itabs

    to one itab.

    Regards, Dieter

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 11, 2007 at 07:46 AM

    Use FM - 'RV_ORDER_FLOW_INFORMATION'

    Call the FM RV_ORDER_FLOW_INFORMATION to get the subsequent document for the corresponding sales document.

    Reward points if helpful

    Message was edited by:

    Mayank Agarwal

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 11, 2007 at 08:34 AM

    TABLES: VBFA. "Vertriebsbelegflu├č

    *

    TYPES: BEGIN OF S_ITAB,

    VBELN LIKE VBAK-VBELN,

    VBELL LIKE LIKP-VBELN,

    VBELM LIKE MKPF-MBLNR,

    VBELF LIKE VBRK-VBELN,

    END OF S_ITAB.

    *

    DATA: ITAB TYPE TABLE OF S_ITAB.

    DATA: WA_ITAB TYPE S_ITAB.

    *

    DATA: VBELN LIKE VBFA-VBELN VALUE '0000001499'.

    *

    SELECT * FROM VBFA WHERE VBELV = VBELN.

    WA_ITAB-VBELN = VBFA-VBELV.

    CASE VBFA-VBTYP_N.

    WHEN 'J'. "Lieferung

    WA_ITAB-VBELL = VBFA-VBELN.

    COLLECT WA_ITAB INTO ITAB.

    WHEN 'R'. "Warenbewegung

    WA_ITAB-VBELM = VBFA-VBELN.

    COLLECT WA_ITAB INTO ITAB.

    WHEN 'M'. "Faktura

    WA_ITAB-VBELF = VBFA-VBELN.

    COLLECT WA_ITAB INTO ITAB.

    ENDCASE.

    ENDSELECT.

    *

    SORT ITAB.

    *

    LOOP AT ITAB INTO WA_ITAB.

    if l_vbeln ne wa_itab-vbeln.


    WRITE: / WA_ITAB-VBELN,
    WA_ITAB-VBELL,
    WA_ITAB-VBELM,
    WA_ITAB-VBELF.

    l_vbeln = wa_itab-vebln.

    append wa_itab to ITAB_NEW.
    endif.

    ENDLOOP.

    Message was edited by:

    Prashant Patil

    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.