How to get PO from sales order item in CRM

Hi,
I am building a BI extractor which needs PO for a given complaint. I am able to get the sales order/item for a complaint using crm_order_read FM. Is there anyway to get the PO based on this SO-item. Are their tables that link these two.
Thanks!

Table CRMD_ORDERADM_I -> Give Item GUID in filed GUID and get the document header guid in field HEADER. Then use function module CRM_ORDER_READ and table ET_SALES to get the Sales Data for the right item. The PO you are interested in can be any of the fields related to PO in this set. Usually it is PO_NUMBER_UC.
Alternately, if you want to use only the table reads use this.
1. Table CRMD_LINK --> get the record with GUID = Item GUID and OBJTYPE_SET = 11 (for Sales Set)
2. Table CRMD_SALES --> get the record with GUID = CRMD_LINK-GUID_SET
Get your PO information from this Sales set record for your item. But since, PO is usually associated with the header, you can do the same as above but with the GUID = Header GUID in the CRMD_LINK table.

Similar Messages

  • Getting Item Text  from sale order items

    Hi All,
    I am trying to get sale order item text using Include text in smartforms.
    my text object  is VBBP and my text id is 0004.
    What should I pass in Text Name  ?.---Order Number or Item Nunmber or Both.
    If both can you guys explain how to pass both ?.
    will be REVARDED.

    Hi,
    When you see the texts in the line item of va03..
    Double click on the text..
    Then in the menu..Goto -> Header..
    There you can find the Text name..
    Generally if it is Item text..Then the text name will be
    order number + line item
    Thanks
    Naren

  • Project Revenue Plan Not Update from Sales Order Item

    I am generating a network and project from the sales order item using Assembly processing. I am using milestone billing on the sales order item and the milestones attached to the project network activities are appearing as billing blocks on the sales order item billing plan. However, the project revenue is not getting updated from the sales order billing plan. Can someone please help?
    I have deleted the billing plan on the billing WBS element and activated revenue planning update from sales order in cusomization for PS. I am looking at CNS41 under the project revenue sched in version 0. Is there a different report I should be looking at?
    Regards,
    Venkat.

    HI Venkat,
    You are looking at the correct report & I believe you have also done the necessary customization. If you create a sales order and reference it to a quotation, the related plan values in the WBS element are refreshed automatically.
    When the payment data is recorded, the terms of payment and the customer payment history are taken into consideration. One of the probable causes could be the credit limit of the customer might have been exceeded. Take help of your SD consultant & increase the credit limit for that customer (from the sales document), t-code FD32 if it is permitted in the business.
    After the new credit limit is set execute the following steps:
    u2022     Go to the t-code Change billing request (VA02)
    u2022     Open the required billing request
    u2022     Remove the account assignment of WBS element from each line item
    u2022     Save the billing request
    u2022     Reopen the billing request in change mode
    u2022     Reassign the WBS elements to all line items
    u2022     Now the changed credit limit will take affect
    u2022     Check the Planned Revenue for the said project in CNS41, it should get updated.
    Rgds
    Deepak

  • Get quotation from Sales Order?

    Hi,
    I have the following code and its taking a lot of time on the database. Could you help me fine tune this?
      SELECT k~vbeln      "Sales Document
             p~posnr      "Sales Document Item
             k~vkorg      "Sales Organization
             k~vkbur      "sales office
             k~vtweg      "Distribution Channel
             p~werks      "plant
             p~lgort      "storage location
             k~spart      "Division
             p~matnr      "Material Number
             p~vrkme      "unit of measure
             p~netwr      "net value
             p~waerk      "currency
             p~arktx      "Short Text for Sales Order Item
             p~kwmeng     "Target quantity in sales units
             p~pstyv      "Sales document item category
             a~kunnr      "Sold-to-To Party
             k~auart      "sales type               
             k~audat      "sales order doc. date    
             k~bstdk      "cust. PO date
             k~bstnk      "cust. PO no. (text)      
        INTO CORRESPONDING FIELDS OF TABLE gt_item
    *Sales Document: Header Data
        FROM vbak AS k
    *Sales Document: Item Data
        INNER JOIN vbap AS p
        ON pvbeln = kvbeln
    *Sales Document: Partner
        INNER JOIN vbpa AS a
        ON ( avbeln = kvbeln
         AND a~posnr = '000000'
         AND a~parvw = c_sold_to )
        WHERE k~vbeln IN s_vbeln
          AND k~auart IN s_auart
          AND k~erdat IN s_erdat
          AND k~vkorg IN s_vkorg
          AND k~vtweg IN s_vtweg
          AND k~spart IN s_spart
          AND k~vkbur IN s_vkbur
          AND p~lgort IN s_lgort
          AND a~kunnr IN s_kunnr.
    After selecting the sales data I need to check whether there exists any Quotation for the above SO's. I wrote the following code but its taking a hell lot of time bcoz im trying to find out a preceding document from subsequent document.
    SELECT VBELV
            POSNV
            VBELN
            POSNN
            VBTYP_N INTO TABLE GT_VBFA_B
                    FROM VBFA
                    FOR ALL ENTRIES IN GT_ITEM
                    WHERE VBELN = GT_ITEM-VBELN
                      AND POSNN = GT_ITEM-POSNR
                      AND VBTYP_V = C_QUOTATION.
    Any suggestions would be greatly appreciated.

    Hi karthik,
    I think why not have th first query as an inner join between vbak and vbap only usin all its primary keys and then use other query to select data from partner tablbe in other internal table and then read it into the final table with your required structure.
    This will help in having all required data faster because the vbpa's data will be on application server while you are readeing the sam for the final table and hence it will make the execution.
    I think this should work because with more inner joins the underlying database would have to run many queries to get the actual data from database , and everything else seems to be fine as you have used appropriate tables and appropriate keys in the select query , just try this option out.
    Thank You!
    Regards.
    Sunmit.

  • Price in invoice is not getting copied from Sales order

    Hi,
    In my case when i create a sales order...my VPRS condition is taking price 4.020,24 (@335.02/PC). When i create a Invoice it is coming with 4.020,22 value and .02 is coming in different condition type ZDIF ( Rounding diff) automatically. When i check my PGI accounting document there also price 4.020,22  hits the G/L account.
    Now able to understand why .02 value is going in the ZDIF condition ?
    Need help
    Regards
    Nitin

    Hi Nitin,
    Rounding condition is coming in picture because there will some difference in PR00 and VPRS.
    Generally VPRS is a statistical condition type and it is just used for viewing purpose not a part of calculation.
    So you can go to V/08, select your pricing procedure and then control data.
    In that find out VPRS condition type and click on statistical, then it wont come in calculation.
    If you want that this should be copied then you have to made changes in copy control.
    Go to VTFA if you are making billing document with reference to order document.
    Go to VTFL if you are making billing document with reference to delivery document.
    Select your combination of billing document and delivery document/order document.
    Then go to item level and select you item category and then click on detail
    In that you will find pricing type just change that pricing type to D.
    Now it will copy pricing as it is from sales order.
    Hope so it will solve your problem
    Regards
    Raj.

  • How to do INIT for Sales order Itema Data (DS 2LIS_11_VAITM)

    Hi all
    I have a report on sales order item data, I have to reload it. DS 2LIS_11_VAITM
    Can any of you pls explain me the steps to do the INIT? Refill set up tables etc
    Many Thanks in advance
    Ishi

    Hi Hari
    Many Thanks for the explanation and steps. I deleted set up tables and executed to fill it.
    It says in R/3 Start of Processing, I ticked to continue and its still running.
    In the mean time I checked RSA3 and it says 1007 records selected. I am refreshing it and the no. of records are still the same.
    Can you tell me how long it takes to fill the table?
    And the R/3 system is still running (Start of Processing)
    Thanks again
    Ishi

  • Copy variant characteristics from Sales Order/Item to Production Order

    Dear All,
    I have a requirement wherein I have to copy variant characteristics fromSales Order/Item to Production Order. In this regard I was looking at Enhancement "CLFM0002". Is it possible to copy the variant characteristics automatically from the Sales Order/Item to Production Order?
    Thanks,
    Pravat.

    Pravant,
    If you are implementing Variant Configuration, or using configurable material in that case you will have to maintain
    Characteristics in CT04
    Classes in CL02
    Configuration Profile CU41
    The material that you are mentioning must have class and charcteristics activated or mentioned in material master. undre classification view. In production you maintain Configurable material BOM  we will be using the same material
    Regards
    Sathya

  • How to block deleteion of sales order items

    We need to be able to block users from deleting sales order items. The objects V_VBAK_VKO and V_VBAK_AAT can be used at the 'order header' level but these do not prevent a user deleting an individual item in an order. Does anyone know of a way of achieving this through authorisations?

    Thanks for your responses. We have decided to use USEREXIT_CHECK_XVBAP_FOR_DELET in MV45AFZB with some code based on the AUTHORITY-CHECK syntax below:
    AUTHORITY-CHECK OBJECT 'S_CARRID'
                      ID 'CARRID' FIELD pa_carr
                      ID 'ACTVT' FIELD '03'.
      IF sy-subrc = 4.
        MESSAGE e045(sabapdocu) WITH pa_carr.
      ELSEIF sy-subrc <> 0.
        MESSAGE e184(sabapdocu) WITH text-010.
      ENDIF.
    In our case we will reference object V_VBAK_AAT.

  • How to enable GOS at sales order item

    Hi Experts,
    I have a requirement where I have to provide the customer an option to see the workflow overview at sales order item level (using Generic Object Services).
    I have developed a class based custom workflow for sales order approval and wish to intergrate GOS in VA02/VA03 at item level and not header level. I know that this is possible at header level using Business Object 2032. But I wish to know if this is possible at item level and that too in a class based workflow approach.
    Please provide your valuable suggestions.
    Thanks,
    Ajay

    Hi Janos,
    Thanks a lot for your reply. The breakpoint wasn't triggered in FM SUSR_USER_LOGONDATA_GET. Please check if the steps I followed are correct.
    1. Set external breakpoint in the FM SUSR_USER_LOGONDATA_GET.
    2. Run transaction VA02 for an order pending approval.
    Am I missing something here ? Do I need any authorization ?
    Thanks,
    Ajay

  • How to know if a Sales order item created with or without reference

    Hi,
    I am working on user exit USEREXIT_MOVE_FIELD_TO_VBAP, and I just wanted to know if there is a way to know if a sales order item is created with or without reference to a contract.
    I need to write the code in USEREXIT_MOVE_FIELD_TO_VBAP, however, when an SO line item is created with reference the userexit is being called twice and when the SO line item is created without reference the user exit is being called only once.
    My aim is to check if a SO line item is created with reference to a valid contract. If the item is without reference to a contract or the referenced contract is not valid, then I will have to determine the contract based on the customer contracts.
    Any help on this would be greatly appreciated.
    Best regards,
    Siva

    Hi Vindo,
    The Userexit USEREXIT_MOVE_FIELD_TO_VBAP is called twice when the SO line item is created with reference to contract. The first time the user exit is called there will be no value filled in vbap-vgbel and the second time it comes to the userexit then vbap-vgbel will have a value. I think CVBAK-VBELN will contain the reference if the so line item is created with reference and the value of CVBAK-VBELN contrains blank if the item is not referenced. Anyway thanks for your reply.
    Best regards,
    Siva

  • How to supress tab for Sales Order item (VA01)

    Hi,
    Please suggest the ways to suppress tab (example "Country") which appears at Sales Order item for some countries.
    Thanks,
    Edited by: Dipesh Kothari on Oct 6, 2009 8:34 PM

    Hi
    If you want to suppress the tab which is appearing at sales order line item then using t.code SHD0  and give the t.code VA01 and business object as BUS2032 and then select the line item data and then you can suppress the fields as per your requirement
    Kindly let us know  why you want to suppress the fields ?
    Regards
    Srinath

  • How to get a Deleted Sales Order Header Data ?

    Hi Guys,
                   I need to get KNUMV field of deleted sales order to track the deleted entries in KONV table.
    But when I check in CDPOS, I am getting only the sales order NO. but not full header data of the deleted sales order or
    is there is any history table maintained for KONV ?
    My requirement is to update a custom defined table having same entries like KONV, which is used to update Data warehouse system.
    Thanks
    AJ

    Whenever any condition record is deleted then there is a deletion indicator at the Condition record level which get activated and through this field you can track then the condition record which are deleted. At this moment, i don't have access to SAP system and i unable to highlight the exact table name, please check the SAP standard table KONV for deletion indicator.
    thanks
    chaitanya

  • How to get 'linenum' from the order form matrix

    I'v been trying to get this to work for the past 4 hours now and I can't find a solution.
    I have a button on the sales order form, when the user clicks on this button a second screen will appear with more information (stored in a usertable).
    However to be able to get this information from my usertable I need to have the linenum of the selected line (in the matrix).
    I know I can get the 'row' property but this doesn't give me the linenum (wich is the unique key in the RDR1 table).
    Also the 'visorder' column doesn't work since I have textlines in the order that can be placed anywhere and can be more than 1.
    Consider the following scenario:
    Order with the following lines:
    Textline
    article line (actual orderline)  (linenum = 1 / visorder = 0 / row = 2)
    article line (actual orderline)  (linenum = 2 / visorder = 1 / row = 3)
    article line (actual orderline)  (linenum = 3 / visorder = 2 / row = 4)
    textline
    article line (actual orderline)  (linenum = 4 / visorder = 3 / row = 6)---- (this line has been deleted)
    article line (actual orderline)  (linenum = 5 / visorder = 3 / row = 6)
    So in total 6 lines.
    How do I get the 'linenum' from the last line (note that linenum 4 has disappeared because of the deleted row)?
    I looked into using the dbdatasource but with this I gets the entire RDR1 table (for that order) and can't get the linenum (correct one) out off it since the textlines mess up the order.
    Anyone know how to do this?

    Hi Marc,
    Assuming the document is saved, you can use something like the following:
    SAPbouiCOM.Form sboForm = (SAPbouiCOM.Form)_sboApp.Forms.GetForm(ItemEvent.FormTypeEx, ItemEvent.FormTypeCount);
    SAPbouiCOM.Matrix sboMatrix = (SAPbouiCOM.Matrix)sboForm.Items.Item("38").Specific;
    // Get the document number
    SAPbouiCOM.EditText sboEdit = (SAPbouiCOM.EditText)sboForm.Items.Item("8").Specific;
    string sDocNum = sboEdit.Value;
    if (sDocNum == "") // No document is selected in this window so report error
        _sboApp.SetStatusBarMessage("No document has been selected", SAPbouiCOM.BoMessageTime.bmt_Short, true);
    else
        if (sboForm.Mode == SAPbouiCOM.BoFormMode.fm_ADD_MODE || sboForm.Mode == SAPbouiCOM.BoFormMode.fm_UPDATE_MODE) // Document must be saved to ensure VisOrder is correct in the database
            _sboApp.SetStatusBarMessage("Please save the document first", SAPbouiCOM.BoMessageTime.bmt_Short, true);
        else
            int iVisOrder = -1;
            string sMessage = "The Line Numbers on this document are: " + System.Environment.NewLine;
            for (int i = 1; i < sboMatrix.RowCount; i++) // Last row is always blank so loop while i is LESS than RowCount
                SAPbouiCOM.ComboBox sboCombo = (SAPbouiCOM.ComboBox)sboMatrix.Columns.Item("257").Cells.Item(i).Specific;
                string sLineType = sboCombo.Selected.Value.ToString();
                if (sLineType == "") // Not a text line or a subtotal
                    iVisOrder++; // Increment your counter to get the next VisOrder value
                    SAPbobsCOM.Recordset sboRec = (SAPbobsCOM.Recordset)_sboCompany.GetBusinessObject(BoObjectTypes.BoRecordset);
                    try
                        sboRec.DoQuery("select T0.LineNum from RDR1 T0 inner join ORDR T1 on T0.DocEntry = T1.DocEntry where T0.VisOrder = " + iVisOrder.ToString() + " and T1.DocNum = " + sDocNum);
                        if (!sboRec.EoF)
                            sMessage += "Row " + i.ToString() + " in the matrix is LineNum " + sboRec.Fields.Item("LineNum").Value.ToString() + System.Environment.NewLine;
                    finally
                        System.Runtime.InteropServices.Marshal.ReleaseComObject(sboRec);
                        sboRec = null;
                        GC.Collect();
            _sboApp.MessageBox(sMessage, 1, "Ok", "", "");
    Basically you have a counter that you increment if the matrix line is not a text or subtotal line. This will match the VisOrder value in the RDR1 table which you can use to get the LineNum value.
    Kind Regards,
    Owen

  • How to get know the Sales Order IDOC#, if I know the created Sales Order#?

    Hi Experts,
    Let me know that, How to get know the IODC #, if I know the Sales Order#?
    Scenario is that, sales order(say 12345678) was created from Inbound EDI. I also Know the MATERIAL too.
    So, How to pull the associated Inbound ORDERS idoc, which is created this Sales order-12345678?
    Is it from EDID4 table? or EDIDC? or any thing else?
    reples r appreciated.
    thanq
    Edited by: SAP ABAPer on Sep 8, 2008 5:29 AM

    Hello
    This can be done much easier using fm SREL_GET_NEXT_NEIGHBORS:
    Input:
    OBJECT-OBJKEY = <number of sales order>  " with leading zeros!!!
    OBJECT-OBJTYPE = 'BUS2032'
    MAX_HOPS = '01'
    Result:
    NEIGHBORS-OBJKEY = <IDoc number with leading zeros>
    NEIGHBORS-OBJTYPE = 'IDOC'
    NEIGHBORS-ROLETYPE = 'INIDOC'.
    Regards
      Uwe

  • How to retrun goods from sales order (OPM 11.5.2)

    Dear all
    Have anybody know how to return stock from the OPM order fulfillment module? Please guide me the step and procedure.
    I have read the OPM user guide no return stock but I applied by using the quantity form and reason code to identify the sale order return mapping account to subledger.
    Thanks in advance
    CC.

    Dear all
    Have anybody know how to return stock from the OPM order fulfillment module? Please guide me the step and procedure.
    I have read the OPM user guide no return stock but I applied by using the quantity form and reason code to identify the sale order return mapping account to subledger.
    Thanks in advance
    CC.

Maybe you are looking for

  • Credit memo t for inter company bill-problem in acct posting

    Hi Guru's, Problem occured when intercompany prices were missing therefore was corrections made manually.but some invoices were blocked (no accounting docs generated).Strange is that one invoice got accounting docs and not blocked (same correction wa

  • Creative Cloud Issue After Using Apple's Migration Assistant

    I bought a new Mac and used Apple's Migration assistant to transfer everything from the old Mac to the new. Everything works with all apps except Creative Cloud. Creative Cloud states that some files are missing and prompts me to download and install

  • Payment advisory mail attachment in OTF format unable to open

    Hi All, We have copied the function module from BTE 00002040 and made the changes c_finaa-nacha = '1'. We have also assigned this FM in FIBF transaction. After doing all the settings we are able to send the payment advisory note copy to vendor email

  • How to get sequence nextvalue in stored procedure?

    Hi, guys, I am trying to obtain the nextvalue of a sequence in a stored procedure, ultimately this value shall be returned to caller, but how do I assign or get the sequence value inside a stored procedure? Thanks jim

  • Photoshop CS5 64x partially freezes up after trying to save a file !

    Photoshop CS5 freezes up after trying to save a file.   It doesnt freeze up totally .It just leaves me about 3 choices from the drop down menu. This only happens with the installed 64 bit version and not with the installed 32 bit version? My Operatin