Cannot set item's price in new sales order using E-Commerce for ByDesign.

Hello,
I'm working on a program to create zero value sales orders in my companies SAP system to help track warranties.  Every portion of this program is straight forward except for setting an item's list price to zero.  I'm using C# .NET.  Below is my code to create the SalesOrderMaintainRequestItem. Any advice would be greatly appreciated.
private SalesOrderMaintainRequestItem[] GetItems(Warranty warranty) // Custom Warranty Object
    int count = warranty.LineItems.Count; // Warranty object has an array of line items
    SalesOrderMaintainRequestItem[] item = new SalesOrderMaintainRequestItem[count];
    for (int i = 0; i < count; i++) // for each line item in the warranty object
        item[i] = new SalesOrderMaintainRequestItem();
        item[i].BuyerID = _ID;
        item[i].ItemProduct = new SalesOrderMaintainRequestItemProduct();
        item[i].ItemProduct.ProductID = new NOCONVERSION_ProductID();
        item[i].ItemProduct.ProductID.Value = warranty.LineItems[i].ReplaceWith;               
        item[i].PriceAndTaxCalculationItem = new SalesOrderMaintainRequestPriceAndTaxCalculationItem();
        item[i].PriceAndTaxCalculationItem.ItemMainDiscount = new SalesOrderMaintainRequestPriceAndTaxCalculationItemItemMainDiscount();
        item[i].PriceAndTaxCalculationItem.ItemMainDiscount.Rate = new Rate();
        item[i].PriceAndTaxCalculationItem.ItemMainPrice = new SalesOrderMaintainRequestPriceAndTaxCalculationItemItemMainPrice();
        item[i].PriceAndTaxCalculationItem.ItemMainPrice.Rate = new Rate();
        item[i].PriceAndTaxCalculationItem.ItemMainPrice.actionCode = ActionCode.Item01; // tried all the options for this one
        item[i].PriceAndTaxCalculationItem.ItemMainPrice.Rate.DecimalValue = 1.0M; // trying to set it as $1  just for testing, will be 0 when live
           // past tests that didn't work
        //item[i].PriceAndTaxCalculationItem.ItemPriceComponent = new SalesOrderMaintainRequestPriceAndTaxCalculationItemItemPriceComponent[1];
        //item[i].PriceAndTaxCalculationItem.ItemPriceComponent[0] = new SalesOrderMaintainRequestPriceAndTaxCalculationItemItemPriceComponent();
        //item[i].PriceAndTaxCalculationItem.ItemPriceComponent[0].Rate = new Rate();
        //item[i].PriceAndTaxCalculationItem.ItemPriceComponent[0].Rate.BaseDecimalValue = 1.0M;
        //item[i].PriceAndTaxCalculationItem.ItemPriceComponent[0].Rate.DecimalValue = 1.0M;
        //item[i].PriceAndTaxCalculationItem.ItemPriceComponent[0].Rate.CurrencyCode = "USD";
        //item[i].PriceAndTaxCalculationItem.itemPriceComponentListCompleteTransmissionIndicator = true;
        item[i].ItemScheduleLine = new SalesOrderMaintainRequestItemScheduleLine[1];
        item[i].ItemScheduleLine[0] = new SalesOrderMaintainRequestItemScheduleLine();
        item[i].ItemScheduleLine[0].Quantity = new Quantity();
        item[i].ItemScheduleLine[0].Quantity.Value = warranty.LineItems[i].ReplaceQty;
    return item;

Hi Joshua,
it's a long time ago and I hope you were able to solve your issue. For others who want to change prices in sales orders the following might be helpful:
It is not possible to set the price of a sales order in the create webservice call. You need to create the sales order first and then call the webservice a second time with actionCode="02" (Update).
The following is an extract from the sales order webservice documentation:
Node – PriceAndTaxCalculation
A price and tax calculation is the summary of the determined price and tax components for a business case. A specification of the general procedure for price and tax determination and valuation using attributes those are characteristic or relevant for the whole object.
Note: PriceAndTaxCalculation cannot be created but can only be modified. So this means that if the customer wishes to change the Discount or Freight charge, then the customer has to create the order first and then make a second web-service request to the update this sales order with the pricing information that is to be changed.
For the update you only need to send the ID of the sales order, the IDs of the items and the PriceAndTaxCalculation node.
The following would be an easy XML example for the update call:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:glob="http://sap.com/xi/SAPGlobal20/Global">
   <soapenv:Header/>
   <soapenv:Body>
      <glob:SalesOrderBundleMaintainRequest_sync>
         <SalesOrder>
          <ID>1234</ID>
            <Item actionCode="02">
               <ID>10</ID>
               <PriceAndTaxCalculationItem actionCode="02">
                  <ItemMainPrice>
                     <Rate>
                        <DecimalValue>5.00</DecimalValue>
                        <CurrencyCode>USD</CurrencyCode>
                     </Rate>
                  </ItemMainPrice>
               </PriceAndTaxCalculationItem>
            </Item>
         </SalesOrder>
      </glob:SalesOrderBundleMaintainRequest_sync>
   </soapenv:Body>
</soapenv:Envelope>
If you need further help with webservices or C#, let me know.
Best regards,
Felix

Similar Messages

  • Base price calculation in sales order using Routines.

    Dear all,
    I have a requirement related to usage of routine in pricing procedure. The requirement is as given below.
    A base price for a material is entered in the contract manually using a customized condition record.Later a sales order will be raised with reference to contract. now we need to bring the price entered in the contract to sales order after some calculations done using a customized "Z TABLE"
    We are trying to use routines to trigger to calculate the base price in the sales order.
    Please suggest what type of routine to be used in such cases(ex formula,pricing etc)
    Also please go through the below mentioned example for better understanding.
    Contract price : Quantity 3: base price 10,000 per day Total : 30,000 perday
    ZTABLE : number of days per month will be maintained in the table based on the working days.
    Sale Order : Quantity 1 : Month working days 23 total 2,30,000 (We need to calculate this total and display as base price in sales order)
    Please suggest how to address this using routines.

    Dear Mudigonda,
    As per your scenario you are creating sales order with reference to the contract and here in contract you are maintaining the manual price . that means the same manual price has to copy to sales order level then as per the calculation rule it will multiply with your Z table value .
    For this requirement you can make some changes in copy control from contract to sales order, here at item category level you have to change pricing type to 'B' so that what ever your manual price value will populate to sales order level after that due to calculation rule value will change .
    Regards,,
    C.B Reddy.

  • Creating Sales Order using Web Dynpro for java

    Hi SDN,
    I am new to Web Dynpro for java. I have developed an application for creating a sales order using adaptive RFC Model using BAPI. It's working fine when i create a single order. I wanna create SO with more than one line item. I have used the Table UI Element to do so. But i could not able to enter the 2nd item details. Please suggest me how to pass more than one line item from the Table UI element.
    Thanks in advance.
    Regards,
    Basha

    Hi Basha,
    Do you need to display the header items and detailed items?
    If the BAPI Contains Output values in R/3 side.
    I mean to say if BAPI  contains 4 line items.u can get thru wdjava the followinf way.
    1. Create webdynpro application.
    2.Import the model.
    3.Create Customcontroller and model binding .
    4. Write the execute method in controller.
      BAPI b = new BAPI();
      WdContext.node<BAPI>.bind(b);
       give inputs for BAPI
    b.setname(" ");
    b.setno("");
    wdContext.currentBAPI().modelObejet().execute();
    wdContext.node<output>.invalidate(); in try catch
    5. create view or when u give the dynpro application its
    in the add custom to view and drag BAPI custom to view .
    6.Crete UI for ur table thru insertTemplate table directly mapp the  output values.
    7. deploy and run
    U can get the out line items .
    Or any thing else post ur requirement.
    Thanks
    Lohi

  • Item credit price changed in Sales order - credit management.

    Dear Friends,
    In Sale order item change log shows ' item credit price changed' . Item credit price  comes from 'Total ' value line in pricing which is the sum or prices and taxes. But where as none of prices and taxes that contribute to this total have been changed,  the change long shows item credit price as changed from a value to other .
    This sale order has many items and for most items same is the case. For some items it looks like quanity got confirmed eventually through back order or availability check from VA02. The  change log for the document also shows 'credit released value' also as changed.
    User wants to know how item credit price which is nothing but total value line is shown as changed when none of the prices and taxes have been changed
    Could someone throw light on this?
    Regards
    Mahesh.

    Hi Murali ,
          First, Thanks for the reply .
        In this issue what happened is,  after couple of items  added, the sales order was released for credit check. Later changes have been made to this credit released document either by way of adding new items or by confirming the availability check for some items . Because of this change log is showing ' realeased credit vlaue' as changed from certain vlaue to the other . How this could have affected change in item credit price    which is coming form toal value line which is nothing but netvalue ( price -disccount+ taxes assingend with subtoal 'A' ) ?
    What exactly is the concept of released credit value and its relation to item credit price ?
    As per releasing the document that is not a problem but user's request is he  wants to know why this is happening .
    Please help me in understanding this better.
    regards
    Mahesh

  • Last sales price in new sales order document

    Hi every one,
          One of my client requirement is important to be able to show the last purchase price (from customer point of view is PO our side is last sales Order) of each item for same customer in sales order, for ex: customer brought 2 Items in SO#1 item1 Price $100, Item 2 Price is $200 and SO#5 item1 $110, item2 $220 when we create the Sales Order for same customer in his next order if his buying same items I want to show the last Sales order price That is SO#5, I hope for this need to be create a UDF and formatted search I did this two but problem is need a query to bring the last Sales order Price.......
    if any one have any idea about this issue please...........
    thank you
    Shankar

    When you use the query as a formatted search with auto refresh the query will Populate the Value of the first column from the first row of the query result.  Therefore the user will not see the last 2 prices for which the SELECT statement was created.
    To see the last 2 prices the user has to manually press ShiftF2 which is the same effort as CTRLTab.
    Writing a simple SQL is easy but it is important to educate the client with the benefits of using out of the box functionality when one already exists
    -Suda

  • Price is not being updated when creating a sales order using DTW oOrders

    Hello experts,
    When I create a sales Order using DTW (oOrders), the information in the input files document.csv and document_lines.csv is updated with no problem, except the price. The price is being ignored from the input files.
    Is there something that I must considered when trying to update the price of a sales order using the DTW?
    The field "price" was mapped in the source and target fields in DTW.
    Here is the document_lines.csv
    RecordKey,LineNum,AccountCode,Address,ItemCode,LineTotal,Price,Quantity,ShipDate,WarehouseCode,TaxCode
    RecordKey,LineNum,AccountCode,Address,ItemCode,LineTotal,Price,Quantity,ShipDate,WarehouseCode,TaxCode
    1,1,_SYS00000000059, ,30PA08-0360-25,1,11.2,3,20110702,V08,A5
    1,2,_SYS00000000059, ,30PA08-0707-25,1,15.2,3,20110702,V08,A5
    1,3,_SYS00000000059, ,30PA08-0707-22,1,18.3,3,20110702,V08,A5
    And the document.csv:
    RecordKey,DocEntry,CardCode,DocDate,DocDueDate,DocTotal
    RecordKey,DocEntry,CardCode,DocDate,DocDueDate,DocTotal
    1, ,c-6167,20110702,20110702,2
    Thank you for your help
    Jorge Manzo

    Hi,
    Try to re-create your dtw using my template,and use text tab when saving your template.
    SO-Header
    RecordKey     CardCode     CardName     Comments     DocDate     DocDueDate     DocNum
    RecordKey     CardCode     CardName     Comments     DocDate     DocDueDate     DocNum
    1     24-25 MANUFACTU     24-25 MANUFACTURING          4/5/2010     4/15/2010     11142
    SO-LINE
    RecordKey     linenum     itemcode     qty     uom      PriceAfterVAT      Price     SalesPersonCode
    RecordKey     linenum     itemcode     qty     uom      PriceAfterVAT      Price     SalesPersonCode
    1     0     SHAFT HEX 7/8"     1     pc     4536     4050     CRIS
    Note : Line -(LINE NUM and QTY is important upon computation of Price if SO is ITEM TYPE Document.
    hope this will help you!
    Regards,
    Darius

  • New Sales Order Type

    Hello,
    I would like to ask either it is neccessary to have a new division for new sales order type.
    Thanks for your time.
    Your fruitful answer will help me to move one step forward
    Sherry.

    Hi,
    If you created new division then you have to maintain sales area
    IMG >> enterprise structure >> assignment >> SD >> assign division to sales organization and set up sales area
    How is it possible for the Y109 to be assigned to the new division. How to make it default
    Y109 is not assigned to division rather it can be assigned to sales area
    IMG >> sd >> sales >> sales documents >> sales document header >> assign sales area to sales document type >> Assign sales order types permitted for sales areas
    Kapil

  • Update automatically prices in CRM sales order

    Hi everybody,
    i would like to simulate the recalculation of price conditions in a sales order (button "update" in condition ta of a sales order) using module functions for example (or simply a batch input but i try and unlucky it doesn't work for the action on the button "Update").
    The goal is to be able to update in mass the price in CRM sales order when a price has been changed in product master data in R/3 system.
    I look for but i don't find a solution so if someone has an idea he is welcome.
    Thank you,
    regards
    Fabrice.

    Hi Fabrice,
    Not able to understand your question. Did you mean that the Prices are going to be updated in R/3 system and simultaneously the order value should also change in all crm orders with respect to any date ????
    If it so, i dont understand what kind of business scenerio is this ?
    Please elaborate so that, we have more clarity on your question.
    Regards
    Arun Kumar

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

  • Confirmation Quantity issue while creating Sales order using BAPI

    Hi SDN,
    Can anyone of you help mein the below issue:
    I have a program to create a sales order using upload file. for this i use "BAPI_SALESORDER_CREATEFROMDAT2" & for changing existing "BAPI_SALESORDER_CHANGE".
    Now If the upload file contains the Same Material, Based on other conditions, it needs to create Multiple sales order.
    When the first Salesorder is created, the Quantity is getting confirmed (Confirmed quantity VBEP-BMENG). But during actual run, since the confirmation is getting done for the same material in the above Sales order, the confirmation is not being done in the subsequent Sales order".
    This poses a problem for business, user need to manual refresh the u201Cconfirmed quantity for each line item in the particular SO where it failed during program upload.
    Also while uploading using the BAPI, if we wait forsometime after creating the first sales order in Debug, then the above material is unlocked & the confirmation quantity is done for the subsequent sales order also.
    But in the actual run, this is creating a problem. Some Refresh or Unlocking problem.
    Can you please suggest a suitable solution for this issue.
    Thanks & regrads,
    Chaitanya LBK

    Have you tried backorder processing?
    V_V1
    V_V2
    V_RA
    V_R1
    V_R2

  • New Line Item to be created in sale order

    Hi,
    Client requires a new line item to be created in sale order for particular regions only..
    Scenario 1 :
    For a particular region Additional Tax shud be calculated on Basic Price .
    Scenario 2 :
    For a particular region Cess on Vat need to incorporated.
    Client wants to maintain condition records in Cond Type :UTXJ and also the client shall maintain a 2 different Tax Codes for above each scenarios,  In future in case Additional Tax or Cess on Vat is applicable to other regions it shud get posted in their respective G/L's
    Plz suggest...
    Thanx...

    It would be wonderful had you shared your suggestion in this forum itself rather sending to personal mail ids which is against the rules and regulations of this forum.
    I request you to dont do that please.

  • How To Add a new column for ZPR0 price in open sales order report ??

    HI,
    my requirement is To Add a new column for ZPR0 price in open sales order report if the order/scheduling agreement is a cross-company code transaction l(company code of order/scheduling agreement <> company code of delivering plant), price = ZPR0 price as at estimated GI date

    k

  • Set  item categaries of sales order  is  not  relevant for picking

    dear friends:
       when i created the outbound delivery and must maintain the picking quantity of materails.i change the configration of system so that not nessesary maintain the picking quantity. set  item categaries of sales order  is  not  relevant for picking via t_code:vlop,what it effect .help me analyze it .
    best regards.

    Hello,
    In TA :OVLP   set/reset the indicator according to your requirement.
    In the case of outbound deliveries, only the delivery items that are relevant for picking are transferred to the Warehouse Management (WM) component. Certain items such as text items or service items (consulting activities) are not relevant for picking.(in those cases uncheck the box)
    In the case of inbound deliveries, this indicator controls whether the item is relevant for putaway.
    This indicator must be set in order for the item to be included in a Warehouse Management transfer order and then put away.
    Regards,
    Nisha
    @award pts if helpful.

  • 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

  • New sales order and Change sales order in item level or delete at item leve

    I got one requirement. Daily i have to display one report on new sales orders created on that day and any sales order item is modified or any item is deleted or any item is added.
                      How to get the sales order numbers and position numbers which will follow above creteria. I found one function module but it is not giving position numbers and new sales order details.
             Is there any BAPI for this requirement.

    I am using "CHANGEDOCUMENT_READ" function module to get the new sales orders created and changed sales order items on a particular time. This function module is getting data from CDHDR and CDPOS tables. But only change sales orders is coming. New sales orders which is created on that time is not getting.
              One of my friend is telling like we have to activate one change pointer to retrive new sales orders also. Which is like there will be one check box.
    Is any body having idea on this. Please reply me on briefly with the code to retrive new sales orders and changed sales orders

Maybe you are looking for