Creating new sales-order item with text using BAPI_SALESORDER_CHANGE

Hi all.
I want to create new sales-order item in an existing sales-order by using BAPI_SALESORDER_CHANGE. This works fine.
I also want to enter item-texts for the new item in the same call, but this doesn't work.
When I call the BAPI I do not assign an item-number for the new item, thus I have no item-number to assign to ITM_NUMBER in table ORDER_TEXT.  IF ITM_NUMBER is empty, it's treated as a header text....
Any clues?
Regards
/Elisabet

increment the last itemnumber and pass it to that.
if they are following a sequence 10,20,30.
find the next sequence and send it to the ITEMNUMBER field.
or else you add the text after the Function call.

Similar Messages

  • Sale Order Item Level Text Field which table and field

    Hi,
    Thanks for your prompt reply and best solution.
    Can you please tell me one more thing, in sale order at item level the TEXT Field maintaining by user at transaction level now they want that field in one of the report, so can you please tell what is the table and field where i will get this sale order item level text details.

    Hello,
    is this going to work for item level text as well.
    can you tell how to proceed with this functional module
    or is there any other thing required.Please elaborate to
    understand better way.
    You can check out two table in respect to Sales TEXT i.e. STXH (STXD SAPscript text file header) and STXL(SAPscript text file lines).
    The best approach of tracing out the Text in respect to Sales Order would be to use the Function module READ_TEXT and put this FM in SE37 and execute with the following parameter.
    Client
    Text ID of text to be read
    Language of text to be read
    Name of text to be read
    Object of text to be read
    Archive handle
    Text catalog local
    When you are essentially looking to read item level Text with respect to Sales Order then your Text OBject would be VBBP.
    Regards,
    Sarthak

  • I have created a quotation in CRM system. I want that to be downloaded into ECC, so that, I can create a sales order there with reference to that quotation. So, what are the parameters that I need to set in CRM system so that my quotation gets replicated?

    Dear Experts,
    I have created a quotation in CRM system. I want that to be downloaded into ECC, so that, I can create a sales order there with reference to that quotation. What are the parameters that I need to set in CRM system so that my quotation gets replicated without any error?
    Please help me in this regard. An early and in detail step by step guidance is highly appreciated.
    Thanks,
    SMTP

    It may be best to recreate the folder and the smart playlists from scratch.
    tt2

  • After creating new sales order through BAPI, it is not showing in VA03

    Hi Experts
    I am developing one program to create sales order using FM BAPI_SALESORDER_CREATEFROMDAT2. In output screen it is showing that the new sales order number created with new sales order number. But whenever I want to display the newly created sales order via VA03 it shows an error message SD document 10007547 is not in the database or has been archived but in program output it shows that 10007547 is created. This is in DEV server. Document numbers are generated by the system sequencially, but it is not reflected in database.
    I am also attaching my code below.
    REPORT  z_bapi_salesorder.
    DATA : gt_header LIKE bapisdhd1,
           gt_item TYPE TABLE OF bapisditm,
           gt_itemx TYPE TABLE OF bapisditmx,
           gt_partner TYPE TABLE OF bapiparnr,
           gt_return TYPE TABLE OF bapiret2.
    DATA : gs_item LIKE LINE OF gt_item,
           gs_itemx LIKE LINE OF gt_itemx,
           gs_partner LIKE LINE OF gt_partner,
           gs_return LIKE LINE OF gt_return.
    DATA : v_vbeln TYPE vbeln_va.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(30) ord_type FOR FIELD p_auart.
    PARAMETERS : p_auart TYPE auart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS       : p_vkorg TYPE vkorg OBLIGATORY,
                       p_vtweg TYPE vtweg OBLIGATORY,
                       p_spart TYPE vbak-spart OBLIGATORY,
                       p_sold TYPE kunnr OBLIGATORY,
                       p_ship TYPE kunnr OBLIGATORY,
                       p_matnr TYPE matnr OBLIGATORY,
                       p_menge TYPE kwmeng OBLIGATORY,
                       p_plant TYPE werks_d OBLIGATORY.
    SELECTION-SCREEN : END OF BLOCK b1.
    INITIALIZATION.
      ord_type = 'Order Type'.
    START-OF-SELECTION.
    *Header information data.
      gt_header-doc_type = p_auart.
      gt_header-sales_org = p_vkorg.
      gt_header-distr_chan = p_vtweg.
      gt_header-division = p_spart.
    *Partner information data.
      gs_partner-partn_role = 'AG'.
      gs_partner-partn_numb = p_sold.
      APPEND gs_partner TO gt_partner.
      CLEAR gs_partner.
      gs_partner-partn_role = 'WE'.
      gs_partner-partn_numb = p_ship.
      APPEND gs_partner TO gt_partner.
      CLEAR gs_partner.
    *Item data
      gs_item-itm_number = '000010'.
      gs_itemx-itm_number = 'X'.
      gs_item-material = p_matnr.
      gs_itemx-material = 'X'.
      gs_item-plant = p_plant.
      gs_itemx-plant = 'X'.
      gs_item-target_qty = p_menge.
      gs_itemx-target_qty = 0.
      APPEND gs_item TO gt_item.
      APPEND gs_itemx TO gt_itemx.
      CLEAR : gs_item, gs_itemx.
      CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
        EXPORTING
      SALESDOCUMENTIN               =
          order_header_in               = gt_header
      ORDER_HEADER_INX              =
      SENDER                        =
      BINARY_RELATIONSHIPTYPE       =
      INT_NUMBER_ASSIGNMENT         =
      BEHAVE_WHEN_ERROR             =
      LOGIC_SWITCH                  =
      TESTRUN                       =
      CONVERT                       = ' '
       IMPORTING
         salesdocument                = v_vbeln
        TABLES
         return                       = gt_return
         order_items_in               = gt_item
         order_items_inx              = gt_itemx
         order_partners               = gt_partner
      ORDER_SCHEDULES_IN            =
      ORDER_SCHEDULES_INX           =
      ORDER_CONDITIONS_IN           =
      ORDER_CONDITIONS_INX          =
      ORDER_CFGS_REF                =
      ORDER_CFGS_INST               =
      ORDER_CFGS_PART_OF            =
      ORDER_CFGS_VALUE              =
      ORDER_CFGS_BLOB               =
      ORDER_CFGS_VK                 =
      ORDER_CFGS_REFINST            =
      ORDER_CCARD                   =
      ORDER_TEXT                    =
      ORDER_KEYS                    =
      EXTENSIONIN                   =
      PARTNERADDRESSES              =
      IF v_vbeln <> space.
        COMMIT WORK.
        WRITE :/ 'Document', v_vbeln ,'created'.
        CLEAR : v_vbeln, gt_header.
        REFRESH : gt_partner, gt_item, gt_itemx.
      ELSE.
        WRITE :/ 'Error in creating document'.
      ENDIF.
    Please give the possible solutions for this. What is reason for that update termination.

    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT1'
        EXPORTING
          ORDER_HEADER_IN           = ORDER_HEADER_IN
      WITHOUT_COMMIT            = ' '
      CONVERT_PARVW_AUART       = ' '
       IMPORTING
         SALESDOCUMENT             = SALESDOCUMENT
      SOLD_TO_PARTY             =
      SHIP_TO_PARTY             =
      BILLING_PARTY             =
         RETURN                    = RETURN
        TABLES
          ORDER_ITEMS_IN            = ORDER_ITEMS_IN
          ORDER_PARTNERS            = ORDER_PARTNERS
      ORDER_ITEMS_OUT           =
      ORDER_CFGS_REF            =
      ORDER_CFGS_INST           =
      ORDER_CFGS_PART_OF        =
      ORDER_CFGS_VALUE          =
      ORDER_CCARD               =
      ORDER_CFGS_BLOB           =
         ORDER_SCHEDULE_EX         = ORDER_SCHEDULE_EX
    use bapi_transaction_commit.
    Regards,
    Venkat

  • Changing Rejected Sales Order Items with BAPI?

    Hi Forum,
    I have the following challenge, would be great if someone of you could help me out. Will help me solve some of my performance problems.
    I have sales orders which are temporary and have 'rejected order items'. Now the requirement is that I have to change the 'rejected order items' (quantity and Delivery dates) based on some XYZ criteria. Now using the BAPI_SALESORDER_CHANGE bapi I have to
    1. first get rid of the 'REJECTION REASON'
    2. Change the order item and then reset the above.
    I tried doing it by populating the order_items internal table with two entries but to my surprise it works once and fails twice!!! I get some errors that are totally irrelated and wierd.
    As for now, I've just adjusted the program(dirtily??) and will be calling the BAPI twice for a change !!!(Huh!)
    Now if anybody knows how to deal with the above problem just drop a few lines, will be of good help to me.
    Thanks and regards,
    ZAM

    Hi Srinivas,
    Thanks for the reply. The rejection reason is set manually, when creating the sales order. I do set the update flag to 'U' and also activating all the X structures. But still it did not work.
    Let me put it very simple. Is it possible to change the rejected order items, through BAPI's? If yes, how?
    Regarding the error messages I will have to change the code again to recreate the messages will let you know as soon as I am finished with some things. But however here are some errors
    Field 'WMENG' cannot be changed, VBEPKOM 000100 0001 ready for input
    Field 'WMENG' cannot be changed, VBEPKOM 000100 0001 ready for input
    Sales document 0030000031 was not changed                           
    there are few others which appear now and then indicating a system error !!
    thanks,
    ZAM

  • Sales order item level text missing

    Hello,
    An issue, our client is not getting text in the sales order item level for one item catgory only. however for the other item category he is getting sales text in item level.this is applicable for all the items in a sales order-meaning, all items are either having text or no text.all the configuration settings are fine.where can be the problem? solutions plz.
    Regards,
    Raj

    Hi,
    Goto VOTXN transaction and select item text for sales document and then see item categeory is assigned to text procedure.
    Make sure right text procedure should be assigned to item categeory(for ex: sales order item text procedure to be assogned to sales order item category) ,also check access sequence for text.
    Please get back with your observations.
    Regards,
    Chandra

  • How to avoid duplicated customer ref. no when create new sales order?

    Hi,
    In my company, we need input customer ref. no when create a new sales order, but I found there was no any validation to avoid input a existed number.
    Can somebody show me how to add some check function on this filed?
    thanks.

    Hi,
    This can be handled in standard system.
    Go to Administration> System Initialization> Document Settings>Per Document (Tab)> Select Sales Order-->Tick Block release (When duplicated  customer reference no. occurs).
    Thanks,
    Joseph

  • Can we create new sales order for RMA?

    Hi
    We have processed one sales order eg.ABC in INR instead of USD and we have closed it. Later we found that the order entry was wrong (that is the currency was wrongly entered in INR instead of USD) and created a new sales order eg. XYZ for RMA of that material and entered the sales order number ABC and invoice number as reference under returns tab. Now if I go to take the receipt of the new sales order created for RMA that for XYZ , I was not able to see that order number XYZ from the list of values in Receiving Transactions under Customer tab.
    Can anyone please give me an idea on how to open an closed order and to cancel the existing order so that i can take back the material in the same closed order i.e, ABC after reopening it and cancel the new sales order i.e, XYZ created for RMA.
    Thanks in advance
    Prem.

    You have mentioned that the sales order is closed. Does it mean that the lines are interfaced to AR ? Is the invoice generated? Is the shipment done?

  • Creating new sale order with reference of old sale order.

    Dear gurus
    i have requirement
    i want to make a sale order with reference of old sale order.
    how to achieve it?
    Regards
    Saad Nisar

    Hi,
    In vtaa
    give source and document number and assign all the relevant routines.
    Now on the left hand side, click the Item button and then give the source I.C as TAC and target also as TAC adn then fill the routines.
    Do the same for Schedule line (which is related to TAC)
    If this is done, then ur scenario will work

  • Creating New Sales Order with Total=$0.00

    B1 is not allowing me to save a Sales Order with a DocTotal of zero.  Is there a setting to allow this?  Something I missed in admin, maybe?

    In Sales Order, I enter a Customer.  I then select a Delivery Date.  I click 'Add' and receive a message box: "Document total is zero. Continue?"
    I click 'Yes'.
    I receive a status bar error:
    "Invalid total [[Sales Order - Document Total]] [[Message 131-44]]"
    The Sales Order does not add.

  • Should we create new sales order type for Brazil

    Hi,
    We are having SAP Global templete environment & going for Brazil rollout. My question is whether we can have exitsing sales order type or should we create a new one so as to capture complicated Nota fiscal requirements.
    What SAP recemmends
    Thanks
    Amb

    Most of the sales document types for Brazil are identified by BR in the description, for instance, sales document type ORB for Standard Order BR. This means a separate order type.
    [Country version Brazil exclusively deals with Nota Fiscais.|http://help.sap.com/erp2005_ehp_04/helpdata/EN/10/e0f0371bc15d73e10000009b38f8cf/content.htm]

  • Create a Sales order (type) with reference to another Sales order only

    Hi
    I have 2 Order Types (ZRA and ZRC). The ZRA should always be created only with reference to a ZRC. It should not be allowed to create ZRA directly.
    I believe I can remove the Item categories somewhere, but can't figure it out. Any help is appreciated
    Regards,
    Vikas

    Hi
    In sd doc tyoes in t code vov8 in the general control tab you can define mandatory referance and in that you can choose option C which means the referance doc should be only a sales doc not enquiry or quotation
    Pls reply whether my suggestion has helped you
    Raja

  • Sale order item text through BAPI_SALESORDER_CREATEFROMDAT2

    Hi,
    We are creating a sale order through a 'Zprogram'. Uploading the required details from a excel sheet and  passing to a BAPI_SALESORDER_CREATEFROMDAT2.
    We are using the 'order_text' parameter to create the item text. If there are multiple lines in the same item text likes this
    (we are passing it in a single line)
    Order type ORDER_ID   PO number u2026u2026 Item Note - Zi01
    STD                   2                   10                Currency - RS
                                                                       Test order -1
                                                                       Test item - 2                                                                               
    It is creating the sale order with the item text  and the item text when viewed normally its appears one below one. But if we click the 'detail' button and view it through the editor mode it is appearing in the same line with # characters in between.
    TAX_CURRENCY = Rupees #TAX_UNIT_PRICE =0.0000# Test order = 1
    It is replacing the enter statement with '#.' We can split the text where # appears and pass it as a separate line .but this will create a problem when the data itself contains a  # character.
    Please advise how we can avoid this and can create the sale order item text correctly.
    Regards,
    Charumathi Balachandran

    As you said, How are creating single line text from the multi line text.
    I hope you are using a CONTACTENATE statemetn to do so. Please the SEPARATOR being used for this.
    I hope you have copied texts from excel sheet to SE38 editor. Please copy text from Excel to Notepad, then Notepad to SE38.
    Edited by: Priyanka Chowdry on Dec 20, 2010 11:21 AM

  • How to create a Sales Order using BAPI_SALESORDER_CREATEFROMDAT1 in VC

    I am new to Visual Composer.
    I read the tutorial and created a Model which fetches the Sales Orders from the R/3 using <b>BAPI_SALESORDER_GETLIST</b>, every thing worked fine.
    I am trying to create a sales order in R/3 using <b>BAPI_SALESORDER_CREATEFROMDAT1</b>, following are the steps I did:
    1)Create a model
    2)Drag a model element(iView) on to the designer
    3)Double click the iView and Drag the function <b>BAPI_SALESORDER_CREATEFROMDAT1</b> on to the iView Designer
    Now my question is, for <b>BAPI_SALESORDER_CREATEFROMDAT1</b> there are some mandatory fields as mentioned in the document.
    1. Mandatory entries:
    ORDER_HEADER_IN :
    DOC_TYPE     Sales document type
    SALES_ORG    Sales organization
    DISTR_CHAN   Distribution channel
    DIVISION     Division
    ORDER_PARTNERS..:
    PARTN_ROLE   Partner functions, SP sold-to party
    PARTN_NUMB   Customer number
    ORDER_ITEMS_IN..:
    MATERIAL     Material number
    REQ_QTY      Order quantity in sales unit
    I can pass the values of structure <b>ORDER_HEADER_IN</b> from a input form but how should I pass mandatory values for tables <b>ORDER_PARTNERS</b> and <b>ORDER_ITEMS_IN</b>.
    Ideally I should have one form where I can send all the mandatory items in the form.
    Thank you,
    Vamsi

    Hi,
    how did you return the materials in the Table View. I tried to do it, but it only returns one material?
    Regards,
    Matthias

  • Unable to copy line item from Sales Order [ZPLV] to new Sales Order [ZPCV]

    I have here a requirement to create a new Sales Order[ZPCV] with reference to the previously created SO[ZPLV].
    I looked in transaction code VTAA, and the configuration for the aboves condition is:
    target sales doc type - ZCPV   from sales doc type - ZPLV
    dataT: 302, 907 and 001 respectively
    copying requirement: 001
    copy item number is checked
    complete reference is checked
    is there something wrong with the configuration?
    please advice!
    thanks,

    Hi
    For those line items you can assign a REASON FOR REJECTION. Automatically the status of those line items will be closed.
    Thanks,
    Ravi
    PS : sorry....please ignore my post.
    Edited by: sankar ravi on May 20, 2008 3:45 PM

Maybe you are looking for

  • When I disable my left windows key for gameing using Microsoft keyboard and mouse software, I can no longer type in firefox. How can i fix this?

    Microsoft Keyboard and Mouse Software that you install with Microsoft keyboard and mice, (latest version) allows you to disable your windows key so that you don't accidentally hit it when gaming. When I take advantage of this feature, I can no longer

  • JaVA 1_4_2 SLES 11 - download ?

    Hi, I`d like to install new system SAP ERP ECC 6.06 on the Linux SUSE 11 (x64_86) and Oracle 11. Temporarily i have trail version SUSE Enterprise Server 11. I installed SUSE, but according to note (1172419) I neeed java: SUSE Linux Enterprise Server

  • Importance of TREX server and services for Services registry

    Hello All     Is a TREX Server and TREX services mandatory to be able to connect to the services registry?? Because I have no trex server and when i browse the services registry , no results are yielded.. Need information on the TREX and relation wit

  • HT1822 Remove old Users in 10.8

    Using Server Admin 10.7.4 with Server 10.8 i can see a whole load of old users (Showing as HEX) who have access to services. Theses also show in Profile Manager as "Loading...." I want to delete these but Server Admin 10.7.4 is read only, and there s

  • Updating User-defined

    Hello, Please can someone confirm if it is possible to populate a user-defined table that has been created as a "Master Data" object type via the DI. The table has been regsitered as a use-defined object. I basically want to write to this table. Rega