Update item characteristic values using BAPI_SALESORDER_CHANGE

Hi Experts,
Could anyone give me sample code on how to update the characteristic values of a sales order item? Points will be awarded... Thanks!
Regards,
LM

Just checked on OSS note 549563 regarding this. This is resolved. Thanks

Similar Messages

  • How to update Sales Order status using  BAPI_SALESORDER_CHANGE

    Hi,
    I want to update Sales Order status using BAPI_SALESORDER_CHANGE, this BAPI is called from middle ware, but there is no parameter to pass the status value to this function, please help me how to update sales order status using BAPI only.
    Thanks
    RK

    Hi,
    Can u give me details of what status u would like to update in sales order.
    If we are able to update the status from VA02, Then BAPI will assist for the same.
    Regards.

  • FM/BAPI to update sales order item characteristic values

    Hi experts,
    I have an urgent requirement on changing the characteristic values of a sales order item (VA01/VA02). Is there any FM or BAPI to update the characteristc values?
    Points will be awarded.
    Regards,
    Leo

    Hi,
    I need an FM/BAPI that can be run inside user exit USEREXIT_SAVE_DOCUMENT_PREPARE to update the item configuration. I tried the FM you have given me but it didn't work. If you have sample codes that can update the configuration values of the sales order item, it will help me a lot. Thanks!
    Regards,
    Leo

  • Characteristic values in BAPI_SALESORDER_CHANGE

    Hi,
    I want to add new configurable item in existing sales order with charactersitic values.
    Iam using bapi BAPI_SALESORDER_CHANGE.
    Iam now able to insert configurable item in existing sales order.
    But the characteristic values are not getting stored.
    Latest code is attached. What else is missing for storing characteristic values ?
    select maximum item number in sales order
    SELECT MAX( POSNR ) FROM VBAP CLIENT SPECIFIED
    INTO MAX_POSNR
    WHERE MANDT = SY-MANDT AND
    VBELN = I_SORDER.
    TMP_POSNR = MAX_POSNR + 10.
    WA_HDRX-UPDATEFLAG = 'U'.      "update
    SALES_DOC = I_SORDER.
    item data
    WA_ITEM-ITM_NUMBER = TMP_POSNR.
    WA_ITEM-MATERIAL   = 'LEFTEYE'.
    WA_ITEM-PLANT      = I_STORE.
    WA_ITEM-SHIP_POINT = I_STORE.
    APPEND WA_ITEM TO IT_ITEM.
    WA_ITEMX-ITM_NUMBER = TMP_POSNR.
    WA_ITEMX-UPDATEFLAG = 'I'.      "add
    WA_ITEMX-MATERIAL   = 'X'.
    WA_ITEMX-PLANT      = 'X'.
    WA_ITEMX-SHIP_POINT = 'X'.
    APPEND WA_ITEMX TO IT_ITEMX.
    Schedule lines
    WA_SCHD-ITM_NUMBER = TMP_POSNR.
    WA_SCHD-SCHED_LINE = TMP_POSNR.
    WA_SCHD-REQ_DATE   = SY-DATUM.
    WA_SCHD-REQ_QTY    = 1.
    WA_SCHD-SCHED_TYPE = 'CN'.
    APPEND WA_SCHD TO IT_SCHD.
    WA_SCHDX-ITM_NUMBER = TMP_POSNR.
    WA_SCHDX-SCHED_LINE = TMP_POSNR.
    WA_SCHDX-REQ_DATE   = 'X'.
    WA_SCHDX-REQ_QTY    = 'X'.
    WA_SCHDX-SCHED_TYPE = 'X'.
    APPEND WA_SCHDX TO IT_SCHDX.
    config & characteristic values
    WA_VALUE-CONFIG_ID = '000001'.
    WA_VALUE-INST_ID   = '00000001'.
    WA_VALUE-CHARC     = 'PRES_DIST_SPH'.
    WA_VALUE-VALUE     = '3.2'.
    APPEND WA_VALUE TO IT_VALUE.
    WA_INST-CONFIG_ID  = '000001'.
    WA_INST-INST_ID    = '00000001'.
    WA_INST-OBJ_TYPE   = 'MARA'.
    WA_INST-CLASS_TYPE = '300'.
    WA_INST-OBJ_KEY    = 'LEFTEYE'.
    WA_INST-QUANTITY   = 1.
    WA_INST-QUANTITY_UNIT = 'NO'.
    APPEND WA_INST TO IT_INST.
    WA_REF-POSEX     = TMP_POSNR.
    WA_REF-CONFIG_ID = '000001'.
    WA_REF-ROOT_ID   = '00000001'.
    APPEND WA_REF TO IT_REF.
    WA_PART-CONFIG_ID  = '000001'.
    WA_PART-PARENT_ID  = '00000001'.
    WA_PART-INST_ID    = '00000001'.
    WA_PART-OBJ_TYPE   = 'MARA'.
    WA_PART-CLASS_TYPE = '300'.
    WA_PART-OBJ_KEY    = 'LEFTEYE'.
    APPEND WA_PART TO IT_PART.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
      SALESDOCUMENT      = SALES_DOC
      ORDER_HEADER_INX   = WA_HDRX
    TABLES
      RETURN                         = IT_RET
    ORDER_ITEM_IN             = IT_ITEM
    ORDER_ITEM_INX            = IT_ITEMX
    ORDER_CFGS_REF         = IT_REF
    ORDER_CFGS_PART_OF = IT_PART
    ORDER_CFGS_INST        = IT_INST
    ORDER_CFGS_VALUE    = IT_VALUE
    SCHEDULE_LINES          = IT_SCHD
    SCHEDULE_LINESX        = IT_SCHDX.
    READ TABLE IT_RET INTO WA_RET WITH KEY TYPE = 'E'.
    IF SY-SUBRC = 0.
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
    ELSE.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    ENDIF.
    I get the following messages from BAPI :
    ORDER_HEADER_IN has been processed successfully.
    ITEM_IN has been processed successfully
    The sales document is not yet complete: Edit data
    TIL-Direct Sales TINDC01372 has been saved
    What else is missing ? Any help is appreciated.
    thanks,
    Nagarajan.J

    Hello Nagarajan,
    I have used this BAPI in my last task. You are passing the values correctly. I will tell you why it is giving like that message.
    Whenever we will create a sales order in VA01 transaction, you will get a message like "The sales order is not complete, would you like to EDIT" while saving the sales order.... This is because of not providing complete data required for careation of sales order.
    Try to implement the changes manually in VA02, if you get same errors, then you can find your code is correct.
    Even I got same type of messages when changing a sales order to change the Rejection Reason for the items.
    Best Regards,
    Sasidhar Reddy Matli.
    Edited by: Sasidhar Reddy Matli on Jul 31, 2008 2:20 PM

  • Auto Update of characteristic values in PO from SRM.

    Hi,
    For Configurable material we have characteristics values.
    Material is configurable material with material type as services.
    Same ECC material is replicate in SRM.
    Create Shopping cart in portal SRM EBP for Multiple line item for material. Each material item will have different characteristics value.
    Currently User attaching excel sheet with different characteristic value in Shopping cart.
    Once Shopping cart no is created and Shopping cart no goes for approval.
    Once approved, PR is created automatically.
    Attached document is available in PR.
    Buyer has to maintain manually characteristics value for material in Purchase order (PO) for each material item.
    Is any way to Update Characteristics values in PR automatically when saving?
    Regards,
    Swapnil

    check if the condition is marked as statstical one in the pricing procedure

  • Best practice for updating ATWRT (Characteristic Value) in AUSP

    I've notice that when we change the Characteristic Value of a Classification, that it does not update in the MM record. We have to go into MM02 for each material number that references Char Value and manually change it for row in AUSP to get updated.
    Should i just create a report to Loop through and update table AUSP directly? Or is there a better way to do this via a function or BAPI etc? Wanting to know what best practice is recommended.

    Hi Scott
    You can use a BAPI to do that.
    Check the following thread:
    BAPI to update characteristics in Material master?
    BR
    Caetano

  • Depend a whole group to an item's value using an el expression JHS 10.1.3.2

    hi, i am using jdev 10.1.3.3 and jhs 10.1.3.2 versions. I'm trying to depend the updateability of a whole group to an item's value, in the group level property update allowed expression i write the following: #{bindings.PrjtetkapraitPoso.inputValue==’100’)
    #{bindings.PrjtetkapraitPoso.inputValue!=’100’)
    #{bindings.PrjtetkapraitPoso.inputValue==100)
    #{bindings.PrjtetkapraitPoso.inputValue!=100)
    and
    #{row.Poso==100)
    but i take a reference syntax exception error at runtime, i want to write this expression both to insert allowed, and delete allowed operations so that i avoid to write in every item the : depends on item : poso and #{$DEPENDS_ON_ITEM_VALUE$==100}.
    Thank you very much,
    Makis.

    Makis,
    Can you be more explicit: what exactly is the value of the update allowed property of the group?
    Did you specify any update allowed expressions on the individual items?
    Can you post the full stack trace of the error.
    Steven Davelaar,
    JHeadstart team.

  • Update COPA characteristic values during order settlement -  KO88

    Hi,
    We need to update some COPA characteristic values during order settlement using T-code KO88.
    Looked for options in KEDR transaction, did not find any exits.
    Could some one help us to resolve this issue.
    Thanks
    Vikram

    Hello and thanks for your response.
    We have actually created the new characteristic (WWCRE) and we are populating it in the user exit.  I think the issue is that the characteristic may be 05012010 at the time of the sales order, but it is 04012010 at the time of billing.
    Unfortunately, the PAOBJNR in the billing doc is the same as the order and the user exit doesn't seem to accept the changed value or create a new entry in the CE tables.
    For example, if I change the sales order to cause a new WWCRE value, the system automatically generates a new PAOBJNR but at the time of billing, regardless of changes to the values, it simply keeps the old PAOBJNR from the sales order and doesn't reflect the changes.
    I hope that makes some sense.  Please let me know if you have any other suggestions.
    >Ray

  • I am Trying to update Item category by using Standar API .. But no Updating .. and it show some erros message.. INV INV_VALID_CAT error message

    Hi 
      I am using Standard API to Update Item category. But it was not updating.any value  what passing to paramenter in API But iwas through some.. error mesage INV INV_VALID_CAT
    Regards,
    Sam

    Please see if (PA_PROJECT_PUB.create_project Errors - The Class Category Is Invalid (Doc ID 1323904.1)) helps.
    Thanks,
    Hussein

  • How to select and duplicate the records and update some column values using cursor

    I have a table with 920 records, we need to update the end date to 6/30/2014 for 920 records and I need to create all 920 records with start date is 7/1/2014 and update the external value to
    CCC.
    Note: the table primary key is not auto increment, but I have sp to get the latest key for that.
    Existing table.  
    ID
    Source Name
    Internal value
    External value
    Start date
    End date
    1
    XXX
    AAA
    BBB
    1/1/2013
    6/30/2015
    Create new records
    ID
    Source Name
    Internal value
    External value
    Start date
    End date
    921
    XXX
    AAA
    CCC
    7/1/2013
    12/30/2015

    Hi ManuGT
    If I understand what you need then you ask for:
    1. updating all current rows (920 rows in the table now)
    2. insert new rows which are duplicates of the preiviews rows, but with value 'CCC' insteade of 'BBB'
    If so, there is not reason to use a cursor and it is highly NOT RECOMMENDED to use ant type of loop.
    You should work with SET and do it all in 2 simple queries:
    -- first we duplicate the existing rows,
    -- but we use the values 'CCC" and '20140107' for the new rows values
    INSERT test (SourceName, InternalValue, ExternalValue, StartDate, EndDate)
    select SourceName, 'CCC', ExternalValue, '20140107' , EndDate
    from test
    where
    -- You can use any filter that you need if you dont want to update all rows
    InternalValue = 'AAA' and ExternalValue = 'BBB' and StartDate = '20140101' and EndDate = '20140630'
    -- Now we update the old rows (check the filter! I get only the old rows since I filter the new rown out)
    UPDATE test
    SET EndDate = '20140107' -- I use date in format yyyymmdd, You can use other formats as well
    where
    -- You can use any filter that you need if you dont want to update all rows
    InternalValue = 'AAA' and ExternalValue = 'BBB' and StartDate = '20140101' and EndDate = '20140630'
    Unfortunately you did not post DDL+DML! Therefore we cant see your table structure and the data sample and we can only guess. I used Saeid's post as the basic DDL+DML.
    Please next time post DDL+DML
    here is the full code with the DDL+DML that i used:
    -- This is our DDL - A create table query:
    create table test
    ( id int identity(1,1) primary key,
    SourceName nvarchar(3),
    InternalValue nvarchar(3),
    ExternalValue nvarchar(3),
    StartDate date,
    EndDate date
    go
    -- This is our DML - A query that insert some sample data
    declare @i int = 1 ;
    while @i < 921
    begin
    insert test (SourceName, InternalValue, ExternalValue, StartDate, EndDate)
    values ('XXX', 'AAA', 'BBB', '1/1/2014', '6/30/2014' ) ;
    set @i += 1 ;
    end ;
    GO
    -- Here is the solution for the problem as I understood your needs:
    -- first we duplicate the existing rows,
    -- but we use the values 'CCC" and '20140107' for the new rows values
    INSERT test (SourceName, InternalValue, ExternalValue, StartDate, EndDate)
    select SourceName, 'CCC', ExternalValue, '20140107' , EndDate
    from test
    where
    -- You can use any filter that you need if you dont want to update all rows
    InternalValue = 'AAA' and ExternalValue = 'BBB' and StartDate = '20140101' and EndDate = '20140630'
    -- Now we update the old rows (check the filter! I get only the old rows since I filter the new rown out)
    UPDATE test
    SET EndDate = '20140107' -- I use date in format yyyymmdd, You can use other formats as well
    where
    -- You can use any filter that you need if you dont want to update all rows
    InternalValue = 'AAA' and ExternalValue = 'BBB' and StartDate = '20140101' and EndDate = '20140630'
    -- Here we just check how the result look like :-)
    select *
    from test ;
    -- And since we do not realy need this table in our server... Here we clean the DDL (you probaby DO NOT WANT TO EXECUTE THIS!)
    DROP table test
    GO
    I hope this was useful :-)
    [Personal Site] [Blog] [Facebook]

  • 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.

  • Updating a characteristic value (CT04)

    I have created a new class with corresponding characteristic. My characteristic has a single value, "01" representing document version number. I the MM, i add this new class to the Classification view for the appropriate material number. However, i have noticed that when we go to update the value in the characteristic, from lets say "01" to "02", we first get an error saying the value cannot be deleted (but the system lets us do this anyway) but more importantly when we do change the value, our hope was that the value in the MM class would automatically be updated as well. That doesnt seem to be the case as I have to physically go into the MM record and delete the class, then re-add it with the new updated value for the update to appear in the MM record as well as AUSP. This is my first time dealing with classifications/classes. Can someone give me guidance on how to achieve something more easily maintained?

    In the CLMM transaction, select "Set and Change Values". 
    In the next screen, enter in 001 for material class in the class type field.  Then add the characteristics you wish to change on the tab labelled "Chars".  You can just add a new value to change all instances or you can specify an old value to change and only those with matching values will be changed.
    Now click on the "Target Objs" tab.  Enter in the material numbers you want to change.  Click on the indicator "Overwrite Existing Values" to replace values, leave it blank if you are adding new values for a characteristic that allows multiple values.
    On the menu bar is a button labelled "Test".  Click on this to do a test run and see the log that is generated.  When you have all the right selections, and the log looks correct, click on the button to the left of the Test button to execute the changes.
    You can also use this to mass change assignments in certain classes. On the first screen,  the first choice "Copy Values assigned to object" allow you copy the values from one object to another.. say for instance all the material class values from material A to Material A, B and C.
    The third choice is "Assign value in matrix".  This is very cool as it gives you a spread sheet form with the all the objects, (materials), listed vertically, and all the characteristics listed across.  You can see the current values, and manually change any of the ones you want to.
    This can be a very powerful transaction.  It should be limited to only a handful of people
    Craig

  • Update item in list using rest api - failed when browsing in juniper session

    this issue is about browsing to an on premises sharepoint 2013 inside a LAN using Juniper session
    the user can see everything and can create new list items with rest api but
    cannot update existing items using the function below.
    we've got this function which we use to update list items in rest
    it works like a charm when browsing inside the LAN
    function updateListItem(itemIdentityField, itemIdentity, listName, siteUrl, item, success, failure) {
    getListItemWithId(itemIdentityField, itemIdentity, listName, siteUrl, function (data) {
    $.ajax({
    url: data.__metadata.uri,
    type: "POST",
    contentType: "application/json;odata=verbose",
    data: JSON.stringify(item),
    headers: {
    "Accept": "application/json;odata=verbose",
    "X-RequestDigest": $("#__REQUESTDIGEST").val(),
    "X-HTTP-Method": "MERGE",
    "If-Match": data.__metadata.etag
    success: function (data) { success(data, callBackIndex, null) },
    error: function (data) {
    getError(data);
    }, function (data) {
    failure(data);
    the error i get in ULS log is:
    Original error: Microsoft.SharePoint.Client.InvalidClientQueryException: The parameter __metadata does not exist in method GetItemByStringId.
    at Microsoft.SharePoint.Client.MethodInformation.GetParameter(String parameterName)
    at Microsoft.SharePoint.Client.ClientCallableEdmModelBuilder.CreateFunctionImportForMethodBodyParser(MethodInformation clientMethod, List`1 parameterNames, ProxyContext proxyContext)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.ParseParametersFromBody(MethodInformation methodInfo, Boolean allowPostBodyAccess, Boolean isLeafSegment, ClientValueCollection args)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.ParseParametersFromBodyOrQueryString(MethodInformation methodInfo, Boolean allowPostBodyAccess, Boolean isLeafSegment, ClientValueCollection args)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.CreateMethodArgumentsUsingNamedParameters(MethodInformation methodInfo, IList`1 parameterList, Boolean isLeafSegment, Boolean allowPostBodyAccess)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.InvokeMethod(Boolean mainRequestPath, Object value, ServerStub serverProxy, EdmParserNode node, Boolean resourceEndpoint, MethodInformation methodInfo, Boolean isExtensionMethod, Boolean isIndexerMethod)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.GetObjectFromPathMember(Boolean mainRequestPath, String path, Object value, EdmParserNode node, Boolean resourceEndpoint, MethodInformation& methodInfo)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.GetObjectFromPath(Boolean mainRequestPath, String path, String pathForErrorMessage)
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.Process()
    at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.ProcessRequest()
    at Microsoft.SharePoint.Client.Rest.RestService.ProcessQuery(Stream inputStream, IList`1 pendingDisposableContainer)
    Any help?
    Somebody?
    Thanks

    Hi patrik
    Really appreciate your replying.
    Could you try and refer to the issues below:
     this error occurs even with site collection administrator (i tested it with three different
    users)
    there isnt any difference between items in list - all have same permissions
    it occurs in several lists in site (all lists have same permissions)
    if browsing inside the LAN everything works just fine
    updating from the UI works fine in all means
    It really seems like a Rest related problem(is there anyone from the Microsoft REST team who can take look at this error?)
    Thanks
    Hushay

  • How to read application item's value using  javascript

    Is there any way to read value of application item using javascript?
    Thanks

    Javascript can access the objects rendered for the page you are calling. This is why the $v function will do the work if calling it for a page item. However an application item isn't rendered on the page - the session state of it is only stored in the table. This is why you need to do it the way I described. You could do a workarround and create a hidden item on your page and compute the value of it using the application item value. Then you would be able to get the value of your application item using $v function.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    ------------------------------------------------------------------------------

  • Page item default value using PL/SQL

    Hello,
    I'm trying to set a default value for a text field page item in a form.
    I'm using this PL/SQL Function Body in the Default section:
    begin
    select ("DEPT_CODE"|| ' ' || DEPT_NAME) from MyView where UserID = :G_USER_ID;
    end;
    I get the following error:
    PLS-00428: an INTO clause is expected in this SELECT statement
    Any help is appreciated!
    thanks,
    Matt

    Matt
    I'm using this PL/SQL Function Body in the Default section:
    begin
    select ("DEPT_CODE"|| ' ' || DEPT_NAME) from MyView where UserID = :G_USER_ID;
    end;Well, that's not a PL/SQL function body. This is:
    declare
      x varchar2(4000);
    begin
      select ("DEPT_CODE"|| ' ' || DEPT_NAME) into x from MyView where UserID = :G_USER_ID;
      return x;
    exception others then
      return null;
    end;Scott

Maybe you are looking for