How to add material characteristics in sales order via BAPI?

Hi all!
I'm trying to use BAPI_SALESORDER_CREATEFROMDAT1 to create a sales order with one item that has some characteristics, but i can't seem to get it work. It creates the salesorder with the item but without characteristics data. Can somebody tell me what could be wrong?
Here's the code:
header-doc_type   = 'TA'.
header-sales_org  = '3000'.
header-distr_chan = '10'.
header-division   = '00'.
items-itm_number = '000010'.
items-material   = 'CP-12'.
items-req_qty    = '1000'.
APPEND items.
partners-partn_role = 'AG'.
partners-partn_numb = '0000050000'.
APPEND partners.
c_ref-posex     = '000010'.
c_ref-config_id = '000001'.
c_ref-root_id   = '00000001'.
APPEND c_ref.
c_ins-config_id = '000001'.
c_ins-inst_id   = '00000001'.
c_ins-obj_type  = 'MARA'.
c_ins-obj_key   = 'CP-12'.
c_ins-complete  = 'T'.
c_ins-consistent = 'T'.
c_ins-quantity  = '0'.
c_ins-quantity_unit  = 'ST'.
c_ins-class_type = '300'.
APPEND c_ins.
c_val-config_id = '000001'.
c_val-inst_id   = '00000001'.
c_val-charc     = 'CP_12_ADD_ON'.
c_val-value     = 'F'.
c_val-valcode   = '1'.
APPEND c_val.
c_val-charc     = 'CP_12_COLOUR'.
c_val-value     = 'M'.
APPEND c_val.
c_val-charc     = 'CP_12_MODEL'.
c_val-value     = 'M'.
APPEND c_val.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT1'
  EXPORTING
    order_header_in           = header
    convert_parvw_auart       = 'X'
  IMPORTING
   salesdocument             = salesdoc
   return                    = return
  TABLES
    order_items_in            = items
    order_partners            = partners
   order_cfgs_ref            = c_ref
   order_cfgs_inst           = c_ins
   order_cfgs_part_of        = c_prt
   order_cfgs_value          = c_val

BAPI_SALESORDER_CREATEFROMDAT1
"(obsolete from 4.6 version)
BAPI_SALESORDER_CREATEFROMDAT2
please see the version  and change the BAPI
reward  points if it is usefull ....
Girish

Similar Messages

  • How to block material issuing after sales order invoiced?

    As the subject mentioned,  could be a possible to block material issuing since sales order invoiced, or
    in the another words, after the sales order completed?
    Or could be a possible to set sales order as closed, and then material issuing related with this sales order are
    forbidden?
    Thanks in advanced,
    Zhou Zhen

    Dear Friend
    A sales order is created say order no 10000 and for material X say 10 units this order is delivered and PGIed and invoiced and the payment too has come
    That means the order 10000 is closed
    Case 1
    Now an user goes to VA02 t code and put this order no 10000 and changes the material X qty from 10 to 12 and opens up the whole order once again
    This can be controlled by using t code OVAH choosing message class the V4 message no 083 and change from warning to error
    Case2
    But to avoid the user to add material Y to the existing order say 10000 then i think we have to go for user exit
    Because the system doesnot even throw a warning message too in case 2 (according to my knowledge) and allows another line item to be added in the same order
    But you can test it if it throws any warning message we can try to convert that error
    But in case 2 it is not happening(even warning is not there)
    Regards
    Raja

  • How to change material discription at sales order item level ?

    Dear Gurus,
            We have some requirement need to change material description at sales order item level , but in system it is in disable mode how to change that  into change mode in sales order item level?
    Thanks in advance
    Regards
    Venkat

    Not possible in SAP Standard.
    Instead why not create a Customer Material Info Record in T-Code - VD51?
    Alternatively it the requirement to change the Description is only for few Sales Order then create a Text ID & Enter the Description in Text Feild. Then in Smartform program wrie a code which will check for Material Description in the Text first & if not found then take from normal material Description in Sales Order.
    But Customer Material info Record seems to be the best solution.
    Hope this helps,
    Thanks,
    Jignesh Mehta

  • How to add line item to sales order item table?

    Kindly help me the with the below requirement .
    Add line item to sales order(va01) dynamically on click of button. The button is also custom created push button.
    In the above requirement I have added the pushbutton to va01 tcode. But when I click on that button I need to add line item to sales order item table.
    I tried a lot but I am not successful. If possible can u please help on this.
    Regards,
    Rachel

    Hi!
    It's quite easy even in the standard SAP to add a line item for a customer order, I don't think it worth to develop a new button for this.
    However if you wanted to add a line automatically, the you can do the following in the program MV45AFZZ, FORM USEREXIT_SAVE_DOCUMENT.
    You can use similar code, but with some modifications.
    DATA: lv_posnr.
    LOOP AT xvbap.
    MOVE xvbap-posnr TO lv_posnr.   "get the last posnr
    ENDLOOP.
    ADD 10 TO lv_posnr.
    MOVE 'XYZ' TO xvbap-matnr.   "enter your material number here
    MOVE lv_posnr TO xvbap-posnr.
    * fill additinal field data in XVBAP if necessary
    MOVE 'I' TO xvbap-updkz.                  "Insert line
    APPEND xvbap.
    Regards
    Tamá

  • How to change the status of material while creating sales order via BDC

    Hai.
    In BDC while creating sales order( va01 posting ) it is stucking up in middle saying material is new. I.e Sales order (va01) is not  getting created because  of material status is new . I want to create sales order  (va01) even  material status is new.
    pls give me out the solution. Points will be rewarded.
    thanks & regards,
    sami.

    Hi,
    If you drag the line item a little towards the right side, you will find a filed material entered. The one you see in the material filed on sales order over view screen is the one determined. You can as well double click and see the fields material entered and material determined.
    Is there anything else you are expecting to see as part of analysis ?
    Regards
    Sadhu Kishore

  • How to create a job card and how to add waranty card in sales order

    I have one scenario for CS.the scenario is realted to automotive industry. Basically its a trading industry of HCV,MCV,LCV apart from that they will do servicing also. First the customer comes for a service.he is having free services. he will have waranty for spare parts of the vehicle. once he comes for servicing first the executive will take complains from the customer after that a Job card will be issued to the customer. there his chasis no ,engine no and registration no will be there. once enter the chasis no entire customer details has to come. how many free services he is having for how many kilo meters.then job card will go to the spare parts dept.that dept will issue the spare parts.then they will invoice the customer. he will pay the payment.and finally the gate pass will be given to the customer to deliver the vehicle.
    painful area is how to create a job card and how to add waranty in sales order.
    Regards,
    Venkat

    Hi,
    Have u resolved it then Please let me know !!! It is a very interesting problem and owuld like to know the solution...
    Regards
    Krishna

  • How to work with characteristics in sales order?

    Dear all,
    Please tell me:
    1.How can I read characteristics values of configuration items in Sales Order?
    2. how can I pass characteristics values into BAPI_SALESORDER_CREATEFROMDAT2 so that I can create sales order with configuration items?
    Thanks
    Giang

    BAPI_SALESORDER_CREATEFROMDAT1
    "(obsolete from 4.6 version)
    BAPI_SALESORDER_CREATEFROMDAT2
    please see the version  and change the BAPI
    reward  points if it is usefull ....
    Girish

  • SD-how to process material packing before sales order entry?

    Hi,Guys,
    If materials are packed before sales order is created, like:
    materia A,  10 batches was put in one bag,
    how to model it in R/3? Handling Unit Management can still be used?
    Best regards,
    Cherie

    Maybe I should tell the scenario more clearly.
    Following is the physical process in a High-tech company:
    10 finished goods:  A , were produced.Batch is 001.
    In the plant, they are packed into one bag. And this bag has a packing lable number:100
    now comes the sales order for one bag of material A. Stock worker go to the warehouse to get the packing number:100 to deliver this sales order.
    This scenario is different from the standard one using HUM. Because the standard scenario packing the materials when doing order entry,but this one is before order entry.

  • How to link Material Document with Sales Order

    Hi,
    When we receive stock through MFHU transaction it becomes sales order stock. The movement type used to receive these into stock would be 131 for MTS & 131 E for MTO. My question is how link Material Document (MKPF/MSEG) with Sales Order because later using that sales order and line item I want to get the planned order number in SAP from PLAF table.
    Thanks & Regards,
    Balaji Viswanath.

    Hi,
    To refer to Sales order you have to go to Purchase order .
      Step1 -From MSEG table you can get  the EBELN ( PO)  EBELP 
      BWART (Movement  Type).
      Step2-Now go to EKPO and retrieve all the PO EBELN, LABNR corrresponding
      to the PO  found the MSEG table.
      Step3-Now go to the VBAK for Sales order Header record and compare the field 
      VBELN = EKPO-LABNR+0(10) and to rerive Sales order item go to VBAP and
      copmpare the fields  VBELN = EKPO-LABNR+0(10)  and
       POSNR = EKPO-LABNR+10(5).
    Thanks
    PK

  • How to add three fields in Sales order item level and supress/hide many

    Hi Gurus,
    My client requirement is :
    1. Three fields to be added at Sales order Item level and they should flow till billing.
    2. Supress/hide most of the fields in Sales order, so that end user will be happy( thru SHDO how to do)
    Please share your experiences and help me.
    BEST REGARDS
    Srikanth

    Hi Subba Rao
    in VA01 screen - Material /qty/ after entering this client wants to enter three more details say X/Y/Z
    and after that he dont want to see maximum fields displayed in VA01 Screen.
    I think it makes sense.
    Regards
    Srikanth

  • How to add a button in Sales Order screen?

    Hi,
    Basically I want to add a new button "Show My lookup" in sales order screen and when clicking the button I want to show a form.
    Please anyone tell me how to do this?.
    thanks in advance
    Mina

    Here is a sample ItemEvent that adds a custom button to Sales Order Entry, and loads a form from XML when it is clicked.  Make sure you give the forms unique identifiers when you create them - the sample just uses a hardcoded value.
    Hope it helps,
    John
    Private Sub sboApp_ItemEvent(ByVal FormUID As String, pVal As SAPbouiCOM.IItemEvent, BubbleEvent As Boolean)
        On Error GoTo ErrorHandler
        Dim sboForm                 As SAPbouiCOM.Form
        Dim sboItem                 As SAPbouiCOM.Item
        Dim sboBtn                  As SAPbouiCOM.Button
        Dim objXMLDoc               As MSXML2.DOMDocument
        Dim objXMLErr               As IXMLDOMParseError
        Dim objXMLElem              As MSXML2.IXMLDOMElement
        Dim strIdentifier           As String
        If pVal.EventType = et_FORM_LOAD And pVal.Before_Action = False And pVal.FormType = 139 Then
            'Add Custom Button
            Set sboForm = sboApp.Forms(FormUID)
            Set sboItem = sboForm.Items.Add("AZU_BTN", it_BUTTON)
            sboItem.Top = sboForm.Items("1").Top
            sboItem.Width = "80"
            sboItem.Left = sboForm.Width - 105
            Set sboBtn = sboItem.Specific
            sboBtn.Caption = "Custom Button"
        End If
        If pVal.EventType = et_ITEM_PRESSED And pVal.Before_Action = False And pVal.ItemUID = "AZU_BTN" And pVal.FormType = 139 Then
            strIdentifier = "AZU_XXX" 'You should set this to a unique value each time
            Set objXMLDoc = New MSXML2.DOMDocument
            objXMLDoc.async = False
            objXMLDoc.validateOnParse = True
            objXMLDoc.Load (App.Path & "\Config\AZU_CUSTOM.srf")
            Set objXMLErr = objXMLDoc.parseError
            If (objXMLErr <> 0) Then
                MsgBox "Failed to load XML screen definition."
                Exit Sub
            Else
                For Each objXMLElem In objXMLDoc.getElementsByTagName("form")
                    objXMLElem.setAttribute "uid", strIdentifier
                Next
                sboApp.LoadBatchActions objXMLDoc.xml
            End If
        End If
        Exit Sub
    ErrorHandler:
        MsgBox Err.Number & " " & Err.Description
    End Sub

  • How to actual material data in sales order

    Hi,
    i create an sales order (VA01) with 1 Material (say 300400). Now i can see, that some data (Gross Weight and Net Weight)
    are not correct (empty).
    Now i go in an new modus to MM02, change this fields and save this material.
    Now i go back to the modus of sales order and will actual the data of 300400.
    Is this possible? I have not find any way.
    Thanks.
    regards, Dieter

    Hi Dieter,
    You will have to maintain the gross and net weight in MM02. Then create a new sale order so that it will reflect.
    It will not reflect for the old sale order. Do revert if any doubts.

  • How to add a field in sales order header

    Hi all,
    I need to add a custom field say a check box in sales order header in additional data B tab.
    let me know step by step.
    Points will be rewarded.
    Thanks.
    Ramya

    additional data B in sales order
    sales order - Additional data B
    Add new fields to Additional Data B tab in sales order
    Reward Points..

  • How to add a field in sales order

    Dear All,
    First I created a ZTable in which there are 15 fields exist then I append structure in ZVBAP which contain only one field from this ZTable. Now I place this field in the Subscreen 8459 of Sales Order under "Additional Data B" by using access key. Also i have Access to edit the module MV45AFZZ.
    Then I wote the code in the
    FORM userexit_save_document_prepare.
    IF XVBAP-ZZSPENR = ''.
    MESSAGE 'SPECIFICATION NO. IS NOT SPECIFIED' TYPE 'E'.
    ELSE.
    VBAP-ZZSPENR = ZSPEC-ZSPENR.
    ENDIF.
    ENDFORM.    
    so that while saving it Checks that field in screen and then if it has value then save it to in the VBAP Table.
    I think I have to write the code into the module
    FORM userexit_move_field_to_vbap.
    VBAP-zzfield = xxxx-zzfield2.
    *{   INSERT         ID3K908846                                        1
      DATA: zlgort LIKE vbap-lgort.
      IF vbap-pstyv EQ 'ZWP'.
        CHECK vbap-lgort IS INITIAL.
        GET PARAMETER ID 'LAG' FIELD zlgort.
        vbap-lgort = zlgort.
      ENDIF.
    *}   INSERT
    WA_XVBAP-ZZSPENR = xvbap-zzspenr.  "but this line gives * me error cause I have to move the screen fields into  * the VBAP Table. So that after this it checks in internal table XVBAP that the field ZZSPENR has value or not ?
    ENDFORM.
    But when I checks XVBAP TAble it shows all entries that I fill in Sales Order except ZZSPENR (My  Field)
    Thanks in advance.
    Regards.
    Adams.
    Helpful answer will be appretiated.

    hi Amams
    check this link
    Adding Fields to Sales order
    i think it may give u some idea
    Regards,
    Naveen

  • How to add a partner in sales order item by enhancement?

    Hi expert,
    Sales order item's bill-to and payer will be same with header if you do not change it manually. now I want to modify some item's bill-to and payer which different from the header automatically. Is there any enhancement for this function?
    Thanks and best regards
    Lance

    Hi Lance,
    You can populate the XVBPA structure with function module "VIEW_XVBPA_FILL".
    You have to pass the following values to the FM:
    COMWA-KUNNR <- the changed partner code
    COMWA-PARVW <- parter role
    COMWA-VBELN, COMWA-POSNR <- Salesorder and item: just fill it with VBAK-VBELN,VBAP-POSNR
    You'll get the result in parameter XVBPA, which can be used for append the internal
    table XVBPA in the userexit.
    BR,
    Barna

Maybe you are looking for

  • Using Time Machine to backup FROM a network drive

    Can time machine be configured to backup files that are stored on a network drive? Drive is mounted via SMB. Thanks Simon

  • Credit memo not passing amount to invoice

    Folks I am trying to create a credit memo request with reference to a billing document. When i save and try to create an invoice for the credit memo request, it does not pull in the amount. i.e if i have created a Cr memo request for $50 save -> crea

  • My USB 3.0 ports stop working, why?

    Hello! I have a Line 6 UX2 audio interface since 5-6 years back, not sure. It has been working perfectly with several Macbooks, an iMac and a Windows PC. I bought the new Macbook Pro Retina (2.6 GHz, 16 GB RAM) and it worked for a while. The symptom

  • Connecting Samsung smart tv via homehub3

    How do I do this? I've entered every possible password and key etc, and it still won't connect. Can someone give me the step-by-step noddy guide, please?

  • Not matching PURCHASED tracks!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    After MobileMess, you'd think these people would make sure things work before they release them. I have tracks that I purchased from the iTunes Music Store that iTunes Match is telling me it has to upload. What?!!!!!!!!? It's bad enough that some alb