Document flow issue

Hi,
I have configured the order related intercompany billing in which intercompany billing doc generated with reference to end customer billing doc.But when i see the document flow in that intercompany billing doc is missing and when go to intercompany billling doc and see the document dlow then it is showing end customer billing doc and intercopamy doc as a external transaction.
My document flow should be
Contract->order>end customer billing doc-->intercompany billing doc
but now it is like this
Contract>order>End customer Billing Doc
No intercompany doc
How to update my document flow?
Regards,
Satya

Hi,
In your case the document flow is not getting updated from one Billing Doc to another Billing doc.
Go to T.code VTFF where in you maintain the copying requirements to copy documents from Billing to Billing.
Select the Source and the target billing types and select the item tab and select the relevant item category and check the Cpying requirement maintained here.
regards,
Ranjith

Similar Messages

  • Issue in Updating Sales Order Document flow

    Hi Experts,
    We have developed a Z Program for posting Material document for the deliveries of Sales Order. This program runs in Batch job everyday.
    Here we are getting an issue like in some of the cases it's not updating the Document flow of the Sales order though its Posting Material Document for the Delivery of Sales Order. If there will be a bulk amount of data then its creating issue in updating the Document flow ( Either the 1st set of record or last set of records).
    We are using BAPI 'BAPI_GOODSMVT_CREATE' for posting Material Document for the delivery and FM 'RV_DOCUMENT_FLOW_UPDATE_U' for updating the document flow.
    It seems it giving issue with bulk amount of data. Will it a time issue?
    If any one have faced such issue, please throw some pointers.
    Thanks in advance!
    Regards,
    Priyabrata.

    It could be a timing issue. After you create the material document, try to enque the material document and move to the next step  only if the enque is successful.  Keep trying to enque the material document until u are successful. But make sure you exit the loop after certain number of tries to avoid endless loops.  Here is a sample code:
      DO 20TIMES.
        CALL FUNCTION ;'ENQUEUE_EMMKPF'
          EXPORTING
            MODE_MKPF      = co_e
           MBLNR          = xxxxx
          MJAHR           = xxxx
          EXCEPTIONS
            foreign_lock   = 1
            system_failure = 2
            OTHERS         = 3.
        IF sy-subrc EQ 0.
    dequeue/unlock the notification again
          CALL FUNCTION DEQUEUE_EMMKPF
            EXPORTING
              MODE_MKPF= co_e
           MBLNR          = xxxxx
          MJAHR           = xxxx
         EXIT.
        ELSE.
    in case of no success, wait 1 seconds, before try again
          CALL FUNCTION 'RZL_SLEEP'
            EXPORTING
              seconds        = 1
            EXCEPTIONS
              argument_error = 1
              OTHERS         = 2.                               "#EC *
        ENDIF.
      ENDDO.
    Regards,
    Jitendar

  • Confirmation of service in the document flow, where it comes from?

    Dear all,
    I found a confirmation of service after I picking and posting goods issue, from the document flow.
    I just wondering, where it comes from? Or, how can I configure it on or off for display?
    (This is a standard ERP system, should not involve in the CRM module)
    Thanks,
    Edited by: Peng Li on Apr 29, 2008 10:04 AM
    Edited by: Peng Li on Apr 29, 2008 10:38 AM

    Hi Peng,
    This usually happens for inbound deliveries usually happens when a movement type is not found for the relevant item. Please check in the delivery item if a movement type is maintained.
    Another possibility is that the material is a non-stock (service) material type for which goods movement are not relevant. Check the material type from the material master.
    Regards
    Nikhilesh

  • Sale order document flow-u0091Service Documentsu0092 is coming which should't aper

    New Issue with Sales order document flow:
    When linking from a sales order in document flow, we were reviewing why the description information varied.  In looking at different values, we clicked on a new item within document flow that allows you to like to ‘Service Documents’.   This is new in 6.0, or it was previously deactivated in 4.6C.  If you link from a sales order to a service document, in ECC 6.0, you will get a short dump because the document flow is so great (viewing order #any in VA03 and use document flow and then select the service documents button    as seen on the screen below
    A Short dump will occur in program SAPLDOCUMENT_FLOW_ALV.
    Here in ECC 6.0 is how it looks from sales order 9806:
    Documents created from 2004 through 2007 are coming up as linked to this sales order and that is incorrect.  There is some type of linkage issue.  In the 4.6 C environments, the ‘service documents’ link is not visible from document flow.
    Can any body functional / technical Help on this urgent???

    Hi Sanjay,
    Go to the order VA03 --> Environment --> status overview. The exact status of the header and item can be found here. You may have chances to know why the status is being processed.
    Also 
    Check whether you have checked 'document flow update' field at item level in copy control
    Check your settings for completion rule in item category
    If it is due to incorrect status message, run report SDVBUK00. That might fix the error. It is recommended to run this first in test mode.
    Br, Sats.

  • Sales Document Flow - Ref. Value not showing correct currency

    I have a question about document flow currency in ECC6.0.  We recented upgraded to ECC6.0 from 4.7 and noticed the changes to document flow.  We are a US based company with sales offices in Europe.  Our European offices are finding that that document flow in ECC6.0 shows in base currency of USD.  Even thought the sales order was entered in EUR euros.  Is this intended to be this way; since it is causing our offices in Europe some confusion?  I searched forums an SAP notes and did not find any references.  Has anyone see this in ECC6.0
    Example Document Flow: Line Level (I do not see Ref Value at header level)
    Note Sales Document was entered in EUR euros.
    Document     Quantity     Unit     Ref. Value     Currency
    Standard Order 0025082768 / 10     12 EA     5,207.54 USD
    ...Delivery 0080211725 / 10     12 EA
    .....Picking request 20100423 / 10     12 EA
    .....Handling unit 0001221687 / 1     12 EA
    .....GD goods issue:delvy 4901261948 / 1     12 EA     1,690.08 GBP
    ...Invoice 0092006736 / 10                           12 EA     5,207.55 USD
    Accounting document 0092006736     12 EA
    If I highlight top line in document flow, I see the following in lower part of screen.  This is the currency entered on the sales order.
    0025082768     10          12     EA     3,847.80     EUR

    Smile,
    Thanks for pointing those configuration points out.   I checked my system and found the following.  I do not see any change documents for the configuration points, so they have been set this way since our implemenation in 2005.
    XD02 is customer master change, the customer on my order is set to EUR in sales in distribution tabs.
    OX02 - Company Code
    1000     Middleton     USD...ok
    2000     London     GBP   ok
    2100     Munich     EUR...ok
    2210     Amsterdam     EUR...ok
    4000     Hong Kong     USD...ok
    I think OVX5 is not set correctly, should be same as OX02.  If I change them, do I need to run an update in the system for old data?  Or is it as simple as changing the value here?  I'm hesitant to change this not knowing how this will affect the system.  Do you know?
    OVX5 - Sales Org
    1000     Middleton     USD...ok
    2000     London     USD   should be GBP
    2100     Munich     USD   should be EUR
    2210     Amsterdam     USD...should be EUR
    4000     Hong Kong     USD...ok
    Thanks,
    Tony Romain

  • Delivery document flow show as a Archived,

    Dear Experts,
    My some of delivery document show in document flow as a archived, I want to know, Why delivery document archived,
    I also want to not list of archived delivery document,
    Can anybody give me t.code for list of delivery document archived,
    Regards:
    Happy

    Hi,
    Are these delivery actually archived by archiving job? Is there any subsequent document after the delivery?
    Technically, if an delivery doesn't exist in LIKP table, but it exist in VBFA table, it will show "archived" in document flow.
    As of why the delivery doesn't exist in LIKP, there could be two possibilities:
    -  it's deleted by archiving job.
    - for unknown reason, it's gone.
    To know why it's gone, it's necessary to reproduce the issue. If you can reproduce, please raise a message to SAP support.
    What you need to do:
    - If this delivery is really archived by your archivng job, you should also archive the preceding sales document.
    - If this delivery is not supposed to be archived, but misisng, you need ot delete this dummy entry from VBFA table, and then recreate delivery.
    To get a list of this kind of archived document, there is no standard report or transaction to do that. You need to write your own report to do that. As mentioned above, technically, if delivery exist in VBFA but doesn't exist in LIKP, it will be displayed like that. You may selecting VBFA and LIKP tables to get your list.
    Regards,
    Harry

  • Document flow of Inbound Delivery

    Dear Gurus,
    We have upgraded to support pack SAPKH60018 from SAPKH60010.
    Earlier the process for goods receipt was followed as described below
    1. Purchase order
    2. Inbound Delivery
    3. GR in to Blocked stock against Inbound Delivery (mvmt type 103)
    3. Release GR blocked stock (mvmt type 105)
    Now after upgrading the support pack when GR blocked stock is made against the Inbound Delivery system is not updating the Document number in the document flow and PGR button is not disabled though 103 mvmt type document is made through migo.
    System is also not allowing to make the Release GR block stock through MIGO and prompting to use Inbound Delivery Dialog instead.
    Request for immediate assitance in regard to this issue.
    Regards
    Danish Alam.

    With the support pack in case if material is serialized for such plant you can post goods receipt only in VL32N which would happen only during 105 mvt type and you cannot post goods receipt using MIGO.

  • Document flow is not updated for Scheduling agreement

    Hi Gurus,
    Can you please advise on the below issue..
    Some deliveries created with reference of schedule agreement are not displayed in scheduling agreement in forecast delivery schedule under delivery tab and as well as not updated in document flow for VBFA table.
    There are two ways to create delivery with reference of Scheduling agreement , 1)  Create Delivery order (Order Type   : TAM) with reference of SA, then delivery for TAM order.
    2) we can add the line item in existing TAM order with reference of SA .
    Advance thanks for your valid points.
    Best regards,
    Venkat.

    Hi Ram,
    Thanks for the reply, there is no issue in copy control settings.
    Best regards,
    Venkat.

  • BAP_SALES_ORDER_CREATE_WITH_REFERENCE - Document flow

    Hi, I have a problem with the bapi for create sales order with reference, When the line items be created, the Update indicator for flow table(VBAP-UPFLU) be created whit the value 'X'(Create document flow records).
    If the sales order is manual, the value of the Indicator for flow table is '2'(Create document flow records except for delivery/goods issue/billing documents), acording to the configuration, but, the bapi assing 'X' for the same reference document.
    Then, when change positions of outbound delivery or billing document the performance of the system is afected because the "Document number of the reference document" have to many reference, and read all the flow document of the contrat.
    I think that maibe need indicate someting aditional to the bapi at position level.
    Thanks a lot for your help.
    Regards,
    Fernando Jiménez.
    Edited by: Julius Bussche on Jul 24, 2009 9:54 PM

    http://www.sap-img.com/abap/bapi-salesorder-createfromdat2.htm

  • Contract not visible in sales order document flow

    Hi
    I am supposed to create sales order from Contract.The requirement is that only header data should be copied.Thus  In Copy Control configuration I did not maintain item level and schedule line level settings for these document types. The issue is that after running the whole cycle from Contract -->SO --> Delivery --> Invoice when I see the Sales Order document flow I can see all other documents but not the contract.Also In Contract document flow I can see only sales order but not delivery and invoice.Please guide.

    Hello,
    Update Document Flow option is available only at Item Level in copy control setting from Contract to Sales Order.
    Check out your Copy Control Records at Item Level. There would be "2" mentioned in "pdate document flow" box.
    2 means Create doc. flow records except for dely/goods issue/billdoc. Here you to maintain "X" for Complete Document flow.
    Hope this helps,
    Thanks,
    Jignesh Mehta

  • Regarding invoice no. displaying in non-invoice no.list in document flow

    Hi All,
    I have 3 radio buttons. if i select 1st one only orders with invoice list should be displayed and for 2nd only orders without invoice list should be displayed and for the 3rd both should be displayed.
    but here the problem was when i select the 2nd radiobutton and see the output it was showing all the orders without invoice no. but when i see the document flow for the first order it was showing invoice no. in DOCUMENT FLOW. but it was not displaying in the output.
    So any one can help me in this issue, i am sending the select statements i have used,
      Get the invoice numbers and the corresponding order numbers for the
      date range specified on the selection screen.
        SELECT vbrkvbeln vbrpposnr vbrp~matnr
               vbrpaubel vbfaposnv
          INTO CORRESPONDING FIELDS OF TABLE i_invoice_items FROM vbrk
          INNER JOIN vbpa ON vbrkvbeln = vbpavbeln
          INNER JOIN vbrp ON vbrkvbeln = vbrpvbeln
          INNER JOIN vbfa ON vbrkvbeln = vbfavbeln  AND
                             vbrpposnr = vbfaposnn  AND
                             vbrpaubel = vbfavbelv
          WHERE vbrk~fkdat BETWEEN s_fkdat-low AND s_fkdat-high AND
                vbrk~bukrs  IN s_bukrs    AND
                vbpa~parvw   = 'WE'       AND
                vbpa~kunnr  IN s_kunnr    AND
                vbrk~vkorg  IN s_vkorg    AND
                vbrp~prodh  IN s_prdha    AND
                vbrp~werks  IN s_werks    AND
                vbfavbelv   = vbrpaubel AND
                vbfa~vbtyp_n = 'M'        AND
                vbfa~vbtyp_v = 'C'.
    get all open orders i.e. orders that have not been invoiced - Start.
      Step 1 - Get all invoiced orders.
        SELECT vbfavbelv vbfaposnv
          INTO CORRESPONDING FIELDS OF TABLE i_inv_ord_items
          FROM vbfa
          INNER JOIN vbpa ON vbfavbelv = vbpavbeln
          INNER JOIN vbak ON vbfavbelv = vbakvbeln
          INNER JOIN vbap ON vbfavbelv = vbapvbeln AND
                             vbfaposnv = vbapposnr
          WHERE vbtyp_n        = 'M'     AND
                vbtyp_v        = 'C'     AND
                vbpa~parvw     = 'WE'    AND
                vbpa~kunnr    IN s_kunnr AND
                vbak~vkorg    IN s_vkorg AND
                vbak~bukrs_vf IN s_bukrs AND
                vbap~abgru     = ' '     AND
                vbap~werks    IN s_werks AND
                vbap~prodh    IN s_prdha.
      STEP 2 - Get all orders that have not been invoiced.
      Step 2a) Get all orders that match the filters specified on the selection screen
        SELECT vbakvbeln vbapposnr matnr
          INTO CORRESPONDING FIELDS OF TABLE i_ord_items FROM vbak
          INNER JOIN vbap ON vbakvbeln = vbapvbeln
          INNER JOIN vbpa ON vbakvbeln = vbpavbeln
          WHERE vbpa~parvw     = 'WE'    AND
                vbpa~kunnr    IN s_kunnr AND
                vbak~vkorg    IN s_vkorg AND
                vbak~bukrs_vf IN s_bukrs AND
                prodh         IN s_prdha AND
                werks         IN s_werks AND
                vbap~abgru     = ' '.
        SORT i_ord_items BY vbeln posnr.
      Step 2b) Delete orders that have been invoiced by
               deleting records found in Step 1
        LOOP AT i_inv_ord_items INTO wa_inv_ord_items.
          READ TABLE i_ord_items
            INTO wa_ord_items
            WITH KEY vbeln = wa_inv_ord_items-vbelv
                     posnr = wa_inv_ord_items-posnv
            BINARY SEARCH.
          IF sy-subrc = 0.
            gv_index = sy-tabix.
            DELETE i_ord_items
              INDEX gv_index.
          ENDIF.
        ENDLOOP.
      Step 2c) Remove entries that exist in the invoiced orders internal table
      to avoid duplicate entries
        SORT i_ord_items BY vbeln posnr.
        LOOP AT i_invoice_items INTO wa_invoice_items.
          READ TABLE i_ord_items
            INTO wa_ord_items
            WITH KEY vbeln = wa_invoice_items-aubel
                     posnr = wa_invoice_items-posnv
            BINARY SEARCH.
          IF sy-subrc = 0.
            gv_index = sy-tabix.
            DELETE i_ord_items
              INDEX gv_index.
          ENDIF.
        ENDLOOP.
    get all open orders i.e. orders that have not been invoiced - End.
      Combine the open orders and invoiced orders into one internal table
    --Code added by CHHEDAM.SMS129705.Date- 03/28/2007--
      Clear 'invoiced' orders if open orders are opted.
        IF g_open EQ 'X'.
          CLEAR: i_invoice_items[].
        ENDIF.
    --End of code added by CHHEDAM.SMS129705.Date- 03/28/2007--
        IF g_open EQ 'X' OR g_both EQ 'X'.       
          LOOP AT i_ord_items INTO wa_ord_items.
            CLEAR wa_invoice_items.
            MOVE: wa_ord_items-vbeln TO wa_invoice_items-aubel,
                  wa_ord_items-posnr TO wa_invoice_items-posnv,
                  wa_ord_items-matnr TO wa_invoice_items-matnr.
            APPEND wa_invoice_items TO i_invoice_items.
          ENDLOOP.
        ENDIF.                                   
        SORT i_invoice_items BY vbeln.
        IF i_invoice_items[] IS NOT INITIAL.
          SELECT *
            FROM vbak
            INTO TABLE gt_vbak_table
            FOR ALL ENTRIES IN i_invoice_items
            WHERE vbeln = i_invoice_items-aubel.
          IF sy-subrc = 0.
            DELETE gt_vbak_table
              WHERE vkorg    NOT IN s_vkorg OR
                    bukrs_vf NOT IN s_bukrs OR
                    auart    NOT IN s_auart.
          ENDIF.
          SORT gt_vbak_table BY vbeln.
          IF gt_vbak_table[] IS NOT INITIAL.
            SELECT *
              FROM vbap
              INTO TABLE gt_vbap_table
              FOR ALL ENTRIES IN gt_vbak_table
              WHERE vbeln = gt_vbak_table-vbeln.
            IF sy-subrc = 0.
              DELETE gt_vbap_table
                WHERE werks NOT IN s_werks OR
                      prodh NOT IN s_prdha.
            ENDIF.
          ENDIF.
        ENDIF.
        SORT gt_vbak_table BY vbeln.
        SORT gt_vbap_table BY vbeln posnr.
    LOOP AT i_invoice_items INTO wa_invoice_items.
          READ TABLE gt_vbak_table
            INTO gt_vbak_table_line
            WITH KEY vbeln = wa_invoice_items-aubel
            BINARY SEARCH.
          IF sy-subrc = 0.
            display_table_line-aubel     = gt_vbak_table_line-vbeln.
            display_table_line-vkorg     = gt_vbak_table_line-vkorg.
            display_table_line-auart     = gt_vbak_table_line-auart.
            display_table_line-bukrs_vf  = gt_vbak_table_line-bukrs_vf.
            display_table_line-bill_to   = gt_vbak_table_line-kunnr.
            display_table_line-vdatu     = gt_vbak_table_line-vdatu.
            display_table_line-faksk     = gt_vbak_table_line-faksk.
            display_table_line-lifsk     = gt_vbak_table_line-lifsk.
          ENDIF.
          READ TABLE gt_vbap_table
            INTO gt_vbap_table_line
            WITH KEY vbeln = wa_invoice_items-aubel
                     posnr = wa_invoice_items-posnv
            BINARY SEARCH.
          IF sy-subrc = 0.
            display_table_line-posnr     = gt_vbap_table_line-posnr.
            display_table_line-matnr     = gt_vbap_table_line-matnr.
            display_table_line-kdmat     = gt_vbap_table_line-kdmat.
            display_table_line-maktx     = gt_vbap_table_line-arktx.
            display_table_line-werks     = gt_vbap_table_line-werks.
            display_table_line-prodh     = gt_vbap_table_line-prodh.
            display_table_line-kwmeng    = gt_vbap_table_line-kwmeng.
            display_table_line-vrkme     = gt_vbap_table_line-vrkme.
            display_table_line-waerk     = gt_vbap_table_line-waerk.
            display_table_line-net_price = gt_vbap_table_line-netwr.
            display_table_line-kzwi1     = gt_vbap_table_line-kzwi1.
            display_table_line-kzwi2     = gt_vbap_table_line-kzwi2.
            display_table_line-kzwi3     = gt_vbap_table_line-kzwi3.
            display_table_line-kzwi4     = gt_vbap_table_line-kzwi4.
            display_table_line-kzwi5     = gt_vbap_table_line-kzwi5.
            display_table_line-wavwr     = gt_vbap_table_line-wavwr.
            display_table_line-mwsbp     = gt_vbap_table_line-mwsbp.
          ENDIF.
          display_table_line-vbeln = wa_invoice_items-vbeln.
          APPEND display_table_line TO display_table_line.
          CLEAR wa_invoice_items.
          CLEAR display_table_line.
        ENDLOOP.
      Get the Purchase Order Number, Sales District and Desc
        IF display_table_line[] IS NOT INITIAL.
          CLEAR: gt_vbkd_table.
          CLEAR: gt_t171t_table.
          SELECT *
            FROM vbkd
            INTO TABLE gt_vbkd_table
            FOR ALL ENTRIES IN display_table_line
            WHERE vbeln = display_table_line-aubel.
          SORT gt_vbkd_table  BY vbeln.
          IF gt_vbkd_table[] IS NOT INITIAL.
            SELECT *
              FROM t171t
              INTO TABLE gt_t171t_table
              FOR ALL ENTRIES IN gt_vbkd_table
              WHERE bzirk = gt_vbkd_table-bzirk.
          ENDIF.
          SORT gt_t171t_table BY bzirk.
        ENDIF.
      Get Ship To Account
        IF display_table_line[] IS NOT INITIAL.
          CLEAR: gt_vbpa_table.
          SELECT *
            INTO TABLE gt_vbpa_table
            FROM vbpa
            FOR ALL ENTRIES IN display_table_line
            WHERE vbeln = display_table_line-aubel.
          IF sy-subrc = 0.
            DELETE gt_vbpa_table
              WHERE parvw <> 'WE'.
          ENDIF.
        ENDIF.
        SORT gt_vbpa_table BY vbeln parvw.
    Get Ship To Name and City
        IF gt_vbpa_table[] IS NOT INITIAL.
          CLEAR: gt_kna1_table.
          SELECT *
            INTO TABLE gt_kna1_table
            FROM kna1
            FOR ALL ENTRIES IN gt_vbpa_table
            WHERE kunnr = gt_vbpa_table-kunnr.
        ENDIF.
        SORT gt_kna1_table BY kunnr.
        IF display_table_line[] IS NOT INITIAL.
          CLEAR: gt_vbpa2_table.
          SELECT *
            INTO TABLE gt_vbpa2_table
            FROM vbpa
            FOR ALL ENTRIES IN display_table_line
            WHERE vbeln = display_table_line-aubel.
          IF sy-subrc = 0.
            DELETE gt_vbpa2_table
              WHERE parvw <> 'ZS' .
          ENDIF.
        ENDIF.
        SORT gt_vbpa2_table BY vbeln parvw.
        IF gt_vbpa2_table[] IS NOT INITIAL.
          CLEAR: gt_kna12_table.
          SELECT *
            INTO TABLE gt_kna12_table
            FROM kna1
            FOR ALL ENTRIES IN gt_vbpa2_table
            WHERE kunnr = gt_vbpa2_table-kunnr.
        ENDIF.
        SORT gt_kna12_table BY kunnr.
    Get Sales Group and Desc
        IF display_table_line[] IS NOT INITIAL.
          CLEAR: gt_knvv_table.
          SELECT *
            INTO TABLE gt_knvv_table
            FROM knvv
            FOR ALL ENTRIES IN display_table_line
            WHERE kunnr = display_table_line-bill_to  AND
                  vkorg = display_table_line-vkorg    AND
                  vtweg = '01'.
          SORT gt_knvv_table BY kunnr vkorg vtweg.
          IF gt_knvv_table[] IS NOT INITIAL.
            CLEAR: gt_tvgrt_table.
            SELECT *
              INTO TABLE gt_tvgrt_table
              FROM tvgrt
              FOR ALL ENTRIES IN gt_knvv_table
              WHERE vkgrp = gt_knvv_table-vkgrp AND
                    spras = sy-langu.
          ENDIF.
          SORT gt_tvgrt_table BY vkgrp spras.
        ENDIF.
    Get Order Status for the line items in the sales orders
        IF display_table_line[] IS NOT INITIAL.
          CLEAR: gt_vbup_table.
          SELECT *
            INTO TABLE gt_vbup_table
            FROM vbup
            FOR ALL ENTRIES IN display_table_line
            WHERE vbeln = display_table_line-aubel AND
                  posnr = display_table_line-posnr.
        ENDIF.
        SORT gt_vbup_table BY vbeln posnr.
        IF gt_vbup_table[] IS NOT INITIAL.
          CLEAR: gt_tvbst_table.
          SELECT *
            INTO TABLE gt_tvbst_table
            FROM tvbst
            FOR ALL ENTRIES IN gt_vbup_table
            WHERE spras = sy-langu AND
                  tbnam = 'VBUP'   AND
                  fdnam = 'GBSTA'  AND
                  statu = gt_vbup_table-gbsta.
        ENDIF.
        SORT gt_tvbst_table BY spras tbnam fdnam statu.
    Get Blocked Reason Text for Billing and Delivery Block
        IF display_table_line[] IS NOT INITIAL.
          CLEAR: gt_tvfst_table.
          SELECT *
            INTO TABLE gt_tvfst_table
            FROM tvfst
            FOR ALL ENTRIES IN display_table_line
            WHERE spras = sy-langu AND
                  faksp = display_table_line-faksk.
        ENDIF.
        SORT gt_tvfst_table BY spras faksp.
        IF display_table_line[] IS NOT INITIAL.
          CLEAR: gt_tvlst_table.
          SELECT *
            INTO TABLE gt_tvlst_table
            FROM tvlst
            FOR ALL ENTRIES IN display_table_line
            WHERE spras = sy-langu AND
                  lifsp = display_table_line-lifsk.
        ENDIF.
        SORT gt_tvlst_table BY spras lifsp.
        SORT display_table_line BY vbeln aubel posnr matnr.
        DELETE ADJACENT DUPLICATES
          FROM display_table_line
          COMPARING aubel posnr matnr .
        LOOP AT display_table_line INTO display_table_line.
          gv_index = sy-tabix.
      Get the Purchase Order Number, Sales District and Desc
          READ TABLE gt_vbkd_table
            INTO gt_vbkd_table_line
            WITH KEY vbeln = display_table_line-aubel
            BINARY SEARCH.
          IF sy-subrc = 0.
            display_table_line-bstkd = gt_vbkd_table_line-bstkd.
            display_table_line-bzirk = gt_vbkd_table_line-bzirk.
            READ TABLE gt_t171t_table
              INTO gt_t171t_table_line
              WITH KEY bzirk = gt_vbkd_table_line-bzirk
              BINARY SEARCH.
            IF sy-subrc = 0.
              display_table_line-bztxt = gt_t171t_table_line-bztxt.
            ENDIF.
          ENDIF.
      Get Ship To Account
          READ TABLE gt_vbpa_table
            INTO gt_vbpa_table_line
            WITH KEY vbeln = display_table_line-aubel
                     parvw = 'WE'
            BINARY SEARCH.
          IF sy-subrc = 0.
            display_table_line-ship_to = gt_vbpa_table_line-kunnr.
          ENDIF.
    Get Ship To Name and City
          READ TABLE gt_kna1_table
            INTO gt_kna1_table_line
            WITH KEY kunnr = display_table_line-ship_to
            BINARY SEARCH.
          IF sy-subrc = 0.
            display_table_line-ship_to_name = gt_kna1_table_line-name1.
            display_table_line-ship_to_city = gt_kna1_table_line-ort01.
          ENDIF.
    Get Ship To Salesman Number
          READ TABLE gt_vbpa2_table
            INTO gt_vbpa2_table_line
            WITH KEY vbeln = display_table_line-aubel
                     parvw = 'ZS'
            BINARY SEARCH.
          IF sy-subrc = 0.
            display_table_line-salesrep = gt_vbpa2_table_line-kunnr.
          ENDIF.
    Get Ship To Salesman
          READ TABLE gt_kna12_table
            INTO gt_kna12_table_line
            WITH KEY kunnr = display_table_line-salesrep
            BINARY SEARCH.
          IF sy-subrc = 0.
            display_table_line-ship_to_srep = gt_kna12_table_line-name1.
          ENDIF.
    Get Sales Group and Desc
          READ TABLE gt_knvv_table
            INTO gt_knvv_table_line
            WITH KEY kunnr = display_table_line-bill_to
                     vkorg = display_table_line-vkorg
                     vtweg = '01'
            BINARY SEARCH.
          IF sy-subrc = 0.
            display_table_line-vkgrp = gt_knvv_table_line-vkgrp.
            READ TABLE gt_tvgrt_table
              INTO gt_tvgrt_table_line
              WITH KEY vkgrp = gt_knvv_table_line-vkgrp
                       spras = sy-langu
              BINARY SEARCH.
            IF sy-subrc = 0.
              display_table_line-bezei = gt_tvgrt_table_line-bezei.
            ENDIF.
          ENDIF.
    Get Order Status for the line items in the sales orders
          READ TABLE gt_vbup_table
            INTO gt_vbup_table_line
            WITH KEY vbeln =  display_table_line-aubel
                     posnr =  display_table_line-posnr
            BINARY SEARCH.
          IF sy-subrc = 0.
            display_table_line-gbsta = gt_vbup_table_line-gbsta.
          ENDIF.
          READ TABLE gt_tvbst_table
            INTO gt_tvbst_table_line
            WITH KEY spras = sy-langu
                     tbnam = 'VBUP'
                     fdnam = 'GBSTA'
                     statu = display_table_line-gbsta
            BINARY SEARCH.
          IF sy-subrc = 0.
            display_table_line-status = gt_tvbst_table_line-bezei.
          ENDIF.
    Get Blocked Reason Text for Billing and Delivery Block
          READ TABLE gt_tvfst_table
            INTO gt_tvfst_table_line
            WITH KEY spras = sy-langu
                     faksp = display_table_line-faksk
            BINARY SEARCH.
          IF sy-subrc = 0.
            display_table_line-fakskt = gt_tvfst_table_line-vtext.
          ENDIF.
         SELECT SINGLE vtext INTO display_table_line-lifskt
          READ TABLE gt_tvlst_table
            INTO gt_tvlst_table_line
            WITH KEY spras = sy-langu
                     lifsp = display_table_line-lifsk
            BINARY SEARCH.
          IF sy-subrc = 0.
            display_table_line-lifskt = gt_tvlst_table_line-vtext.
          ENDIF.
    Get Total Net and Total Gross Invoice Amount
          display_table_line-brtwr = display_table_line-kzwi1 -
                                     display_table_line-kzwi2 -
                                     display_table_line-kzwi3 -
                                     display_table_line-kzwi4 -
                                     display_table_line-kzwi5.
    Calculate Discount
          display_table_line-disc = display_table_line-kzwi2 +
                                    display_table_line-kzwi4.
         Unit Price and cost.
          IF display_table_line-kwmeng NE 0.
            display_table_line-unit_price = display_table_line-brtwr /
                                            display_table_line-kwmeng.
            display_table_line-wavwr = display_table_line-wavwr /
                                       display_table_line-kwmeng.
          ELSE.
            display_table_line-wavwr = 0.
          ENDIF.
        Calculate the GPM percentage.
          IF display_table_line-unit_price NE 0.
            display_table_line-gpm_perc = ( ( display_table_line-unit_price -
                                              display_table_line-wavwr ) /
                                              display_table_line-unit_price ) * 100.
          ENDIF.
        Update the internal table.
          SHIFT display_table_line-matnr   LEFT DELETING LEADING '0'.
          SHIFT display_table_line-bill_to LEFT DELETING LEADING '0'.
          SHIFT display_table_line-ship_to LEFT DELETING LEADING '0'.
          SHIFT display_table_line-vbeln   LEFT DELETING LEADING '0'.
          SHIFT display_table_line-aubel   LEFT DELETING LEADING '0'.
          WRITE display_table_line-vdatu   TO   display_table_line-vdatu_char MM/DD/YYYY.
          MODIFY display_table_line
            INDEX gv_index
            FROM display_table_line
            TRANSPORTING vbeln      aubel        bzirk        bztxt
                         bill_to    ship_to      ship_to_name ship_to_city
                         salesrep   ship_to_srep vkgrp        bezei
                         bstkd      gbsta        status       fakskt
                         lifskt     matnr        vdatu        brtwr
                         disc       unit_price   wavwr        gpm_perc
                         vdatu_char.
          CLEAR: display_table_line, tvbst_wa.
        ENDLOOP.
        IF  s_vkgrp[] IS NOT INITIAL.
          DELETE display_table_line WHERE vkgrp NOT IN s_vkgrp.
        ENDIF.
        IF  s_bzirk[] IS NOT INITIAL.
          DELETE display_table_line WHERE bzirk NOT IN s_bzirk.
        ENDIF.
        IF s_srep[] IS NOT INITIAL.
          DELETE display_table_line WHERE salesrep NOT IN s_srep.
        ENDIF.
        SORT display_table_line BY vkorg vkgrp ship_to_srep bill_to.
        DELETE display_table_line WHERE aubel = ' '.
      ENDMETHOD.                    "read_main_data
      METHOD display_report.
        CALL METHOD alv_class->set_table_for_first_display
       EXPORTING
         I_BUFFER_ACTIVE               =
         I_BYPASSING_BUFFER            =
         I_CONSISTENCY_CHECK           =
         I_STRUCTURE_NAME              =
         IS_VARIANT                    =
         I_SAVE                        =
         I_DEFAULT                     = 'X'
         is_layout                     = gv_layout
         IS_PRINT                      =
         IT_SPECIAL_GROUPS             =
         IT_TOOLBAR_EXCLUDING          =
         IT_HYPERLINK                  =
         IT_ALV_GRAPHICS               =
         IT_EXCEPT_QINFO               =
         IR_SALV_ADAPTER               =
         CHANGING
           it_outtab                     = display_table_line[]
           it_fieldcatalog               = gt_field_cat
         IT_SORT                       =
         IT_FILTER                     =
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4
        IF sy-subrc <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDMETHOD.                    "display_report
    Thanks in Advance,
    Ramana Prasad.T

    Hi Janakiraman,
    unfortunately we don't have an upload storage here in the SDN. At this point we have two options:
    a) you could upload the screenshots to a website that provides storage and then you can paste the url to the screenshots here
    b) we can route this through our support channel. You can send a message to our support team in the <a href="http://service.sap.com/smb/sbo/support">SAP Business One Support Center</a> in our <a href="http://service.sap.com/smb/sbo">SAP PartnerEdge Portal</a>.
    Please use the method that works best for you.
    Thanks,
    Torsten

  • Reclamations and returns DOCUMENT FLOW

    Hi,
    I ve to enhance the QM01/02/03 ,DOCUMENT FLOW when ever we press document flow push button,
    QM02-
    provide any QN number,
    in the menu
    extras -> document notifications->document flow->list
    rifht now it is showing only 2/3 documents in tree
    but it should be modified to
    The standard SAP Document Flow, but it must be modified, in order to show all the subsequent documents, and the user must be able to go directly to each subsequent documents.  
    The flow must follow this hierarchy: 
    For documents type ZS/ZV
    - Purchase Order
        - QM Notif.
            - Stock transfer or Scrapping
                 - Return Purchase Order
                       - Delivery
                           - Goods issue
                              - Goods receipt
                                 - Invoice
    For document Type: ZC.
    - Reference document
    - QM Notif.
    - Return Sales Order or Credit memo req. or Debit memo req.
                                              - Return invoice or Credit memo or Debit memo
    This document flows should be shown for each QN in the QM11 transaction.
    menu
    Notification -> Display Document flow
    It is a network flow that should  as is but all the documents it should show.
    it is internally calling Business objects
    1. Goto transaction "QM02",
    2. Provide some QN number
    Observe: LIST
                     GRAPHIC
    If u goto the sytem&#8594;status u ll find the program “SAPLIQS0”
    Find the Function code responsible for “DOCF”
    It will call a report program “RIBELF20”
    For other “GRAPHIC” shown in above picture
    U will find form exit “FORM fcode_docf2_f00”
    Where we can create new program like above and we can insert our own Z Program.
    But if u go to the program level and debug,
    There is one FM "DISPLAY_DOCUMENT_FLOW_ALV" that is responsible for such type of display,
    No issues,
    But internally before that he extracted all the business Objects responsible for that.
    How can I get all the business objects that are required to me to show the all the documents that I have already sent to u.
    Below are my findings about the document flow at QM11 level.
    When ever u press the Display document flow.
    The O/P is
    1. QM11 is the standard transaction using program “RQMELL10”.
        We can not modify the standard SAP transaction, and insert our code in this program.
         Alternative: we have to copy the program in Z namespace and attach the same to Z transaction code.
        Confirm the same whether the users are ready to use the “Z” transaction.
    2. Even though they accept for this:
        The function Module responsible for the Network type of display is “QM11_LESEN_BELEGDATEN_ALLG”.
        With the input parameters as (a) QN number (b) Business Object i.e.  BUS2078 (Quality notification number) (c) maximum number of steps
        The standard function module should be used in Z namespace program; the standard function module internally calls one more Function module 
        “NERL_GET_NEIGHBOURHOOD” that is responsible for the getting business objects of the corresponding number.
         But this function module gets the only three documents data but not the else that are mentioned in the FD.
    <b>Kindly provide any function module, which can meet such criteria, and the business objects of the related documents in the flow that is required.</b>

    Hi,
    Goto the T.Code "VOV7".
    Select your item category.
    Details.
    Maintain the Completion rule as "A(Item is completed with the first reference)".
    Save.
    If you do this after the follow on document is created,the item is completed and you cannot reject the item.
    For your second question,
    Goto the T.Code "VTLA".
    Select your valid combination.
    Click on item.Select your item category.Details.
    There is a check box called as "Update document flow".Tick that one.
    Save.
    Regards,
    Krishna.

  • Delivery Document Lock Issue in Z Program using BAPI(s)

    Hi,
    I am a functional consultant posting this in ABAP forum. We have developed a Z-Program.
    User enters the Service Order no. in this program and executes it.
    The program then updates the following linked documents in the following sequence using BAPI(s)
    Outbound Delivery
    Service Notification
    Service Order (This is done using BDC of IW32)
    It sometimes happens that once the Program reaches the iw32 bdc, it gives error "Delivery XXXXXXXX is locked by User ID XXXXXX"
    The user ID being that of the person executing the transaction.
    This happens like 3 out of 100 times in the Production Server. We are unable to replicate this issue in Quality or Development Server.
    We believe it to be a performance issue (database updating is slow)
    However Client wants us to investigate the Program and see what is possible.
    We are thinking of putting WAIT after the BAPI(s) of the Delivery Update.
    Any suggestions, please help.

    Hello Suhas,
    Thanks for the reply.
    These documents are seperate objects but are interlinked. i.e I can see in the Document Flow for Service Order, which is the Service Notification and Outbound Delivery for the Material.
    Also, If I'm in change mode in the Outbound Delivery, I cannot go into the change mode of the Service Order.
    Yes, we are using BAPI_TRANSACTION_COMMIT after each BAPI in the Program. We have used the Wait Statement in all BAPIs for the Service Notification. These BAPI(s) are before the IW32 BDC.
    I am copying code from one of the commit BAPI(s)
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
                    EXPORTING
                      wait = c_x.
                  WAIT UP TO 1 SECONDS.
    I noticed in the Outbound Delivery BAPI(s) (two of them) don't have the wait in the BAPI_TRANSACTION_COMMIT. Hence I though if we add this, could this resolve the issue?
    Service Order gets updated last through BDC for IW32 after all the BAPI(s) are executed for Outbound Delivery and Service Notification.
    I understand WAIT would increase processing time, that is why I am posting this to know if we have some other solution available for such a lock issue.

  • Cancelled billing document number missing in document flow

    Hello Experts,
    there is a MAM sales order in which one line item created as a separate billing document is cancelled.however in the document flow the cancelled billing document is not visible.any suggestions how to slove the issue?
    Regards,
    Raj

    closing,as no response received.

  • BAPI_GOODSMVT_CREATE not updating document flow

    I created a function to create an inbound delivery against a PUrchase Order and then Post the goods receipt against that inbound delivery. The inbound delivery and the material document are created correctly in the DEV environment.
    The issue is that in our QA environment the document are created correctly but the document flow is not updated at all!! Any idea of where should I be looking at to see difference between these environments?
    I'm using BAPI BAPI_GOODSMVT_CREATE  to Post the Goods Receipt.
    Thanks.

    sort delivery by vbeln posnr.
    loop at delivery.
    Populate BAPI variables ready for call
      goodsmvt_header-pstng_date = sy-datlo.
      goodsmvt_header-doc_date = sy-datlo.
      goodsmvt_header-bill_of_lading = delivery-lifex.
      goodsmvt_header-ref_doc_no = delivery-lifex.
      goodsmvt_header-pr_uname = sy-uname.
      goodsmvt_header-header_txt = 'Auto GR of I/Bound Del'.
      goodsmvt_code-gm_code = con_move_code.
      goodsmvt_item-material = delivery-matnr.
      goodsmvt_item-plant = delivery-werks.
      goodsmvt_item-stge_loc = delivery-lgort.
      goodsmvt_item-move_type = con_move_type.
      goodsmvt_item-vendor = delivery-lifnr.
      goodsmvt_item-entry_qnt = delivery-lfimg.
      goodsmvt_item-entry_uom = delivery-meins.
      goodsmvt_item-mvt_ind = con_move_item.
      goodsmvt_item-deliv_numb_to_search = delivery-vbeln.
      goodsmvt_item-deliv_item_to_search = delivery-posnr.
      append goodsmvt_item.
      clear goodsmvt_item.
    endloop.
    *Call BAPI
    call function 'BAPI_GOODSMVT_CREATE'
      exporting
       goodsmvt_header       = goodsmvt_header
       goodsmvt_code        = goodsmvt_code
      TESTRUN           = ' '
      importing
       goodsmvt_headret      = goodsmvt_headret
       materialdocument      = materialdocument
       matdocumentyear       = matdocumentyear
      tables
       goodsmvt_item        = goodsmvt_item
      GOODSMVT_SERIALNUMBER    =
       return           = return.
    Check BAPI RETURN table to ensure call was successful
    loop at return where type = 'E'.
      exit.
    endloop.
    if sy-subrc eq 0.
      rollback work.
      message e999 with 'GR BAPI Failed, process delivery manually'.
    endif.

Maybe you are looking for