How to pass pricing type using BAPI_SALESORDER_CHANGE

Hi all,
How will we use BAPI_SALESORDER_CHANGE  to re-price the orders.
There is parameter LOGIC_SWITCH  which can be used to export the pricing type.
But what all are the other parameters we should pass?
Has anybody worked in such a context.?

Hi , Here is what you should pass to update the pricing with a particular pricing type :
1)  SALESDOCUMENT = your sales order number
2) ORDER_HEADER_INX-UPDATEFLAG = 'U'
3)  LOGIC_SWITCH-PRICING =  "your value"
4 ) *order_item_in-itm_number = * the item number for which pricing should be triggered
5) *order_item-inx-ITM_NUMBER   = * the item number for which pricing should be triggered
6) *order_item-inx-UPDATEFLAG   = * 'U'
regards,
Advait

Similar Messages

  • How to change pricing formula using bapi_salesorder_change

    Hi,
    I have a customer  portal web application developed in .Net from which I will be getting different values which are changes related to a particular sales order item in SAP. One among these values is the pricing formula used with the sales order item. I am using bapi_salesorder_change to update all the values other than the pricing formula. My input to the bapi is the formula id. I am not sure about the field which I have to use in the bapi structures to update the same. Also I don't even know whether I can use the same bapi to do the required task.
    Requesting help ....
    Thanks,
    Siva

    Sir,
    Thank you for your immediate response.
    Actually we are integrating SAP with the customer portal web application. The requirement is in such a way that the customer portal provides the option to change the sale order details both at the header level as well as item level. The fields include Order qty,Delivery date,Partner details,Payment terms,Terms of sale, Pricing formula etc. The front end consists of a Pricing formula drop down which consists of  the formula descriptions (for eg: ZFA1015-LAST LME W/DAY OF CONT. MOTH) with its corresponding ID(ID is nothing but ZFA1015). At the SAP side my RFC should pick it up and update it for the given item. The process is like if we go to VA02 we have an option called MAINTAIN FORMULA from where we can change the formula used with an item. There the formula id is obtained from the formula repository. In here the we already have the Formula ID given by the front end.
    Hope you are clear wtith the requirement..
    Requesting help..
    Thanks,
    Siva

  • Regarding adding new pricing condition using BAPI_SALESORDER_CHANGE

    Hi All,
    I am trying to add a new pricing condition at item level using Bapi_salesorder_change, but it is not getting updated. I am also doing Bapi_transaction_commit as the next step.
    I am passing the sales order number and the Update flag in the header. Tried passing G as the logic switch-pricing and also tried with logic_switch-COND_HANDL = X.
    I am passing the data in structure CONDITIONS_IN with the value for item numebr, condition step number, condition count , condition value, currency and unit.
    Also I am passing data in CONDITIONS_INX with the required flags set and update flag as 'I'.
    The output says that order is changed and saved successfully, but the condition type is not there when i check the pricing coinditions inside the order at item level.Please help.
    Regards,
    Kaustubh B. Khasnis

    Hi,
    In the condition tab..
    Press the determination analysis button..
    There it will show the why the pricing condition type is not added..
    Thanks,
    Naren

  • Need to add new condition type using   BAPI_SALESORDER_CHANGE

    Hi all,
    I am using BAPI_SALESORDER_CHANGE to add new condition type for an order item.
    I am able to add it, but problem here is, that i want that condition type to be manually changable. Here, in BAPI, after execution, condition type field becomes disable.
    My code is as follows:
                    MOVE 'B' TO wa_logic-pricing.
                      MOVE 'X' TO wa_logic-cond_handl.
                      wa_cond-itm_number = wa_vbap-posnr.
    *                  wa_cond-cond_st_no = it_konv1-stunr.
    *                  wa_cond-cond_count = it_konv1-zaehk.
                      wa_cond-cond_type =  it_discount-kschl.
                      wa_cond-CONDORIGIN = 'C'.
                      APPEND wa_cond TO i_cond.
                      CLEAR: wa_cond.
                      wa_condx-itm_number = wa_vbap-posnr.
    *                  wa_condx-cond_st_no = it_konv1-stunr.
    *                  wa_condx-cond_count = it_konv1-zaehk.
                      wa_condx-cond_type =  it_discount-kschl.
                      wa_condx-updateflag = 'I'.
                      wa_condx-COND_VALUE = 'X'.
                      APPEND wa_condx TO i_condx.
                      CLEAR: wa_condx.
    FORM f_update_order .
      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          salesdocument    = salesdocument
          order_header_in  = wa_headerdata
          order_header_inx = wa_headerdatax
          logic_switch     = wa_logic
        TABLES
          return           = it_return
          order_item_in    = i_itemdata
          order_item_inx   = i_itemdatax
          conditions_in    = i_cond
          conditions_inx   = i_condx.
      IF NOT it_return[] IS INITIAL.
        PERFORM f_commit_or_rollback.
      ENDIF.
    ENDFORM.
    Please let me know, if it could be achievable.
    Best regards,
    Meena
    Moderator Message: Corrected the code tags. You need to use flower brackets.
    Edited by: kishan P on Aug 25, 2010 6:04 PM

    Hi,
    This is the demo code i am writing:
    Even Change manual entry field in BAPI did not helped me.
    [code]REPORT  ZTESTM1.
    data: l_knumv type knumv.
    DATA: it_return        TYPE STANDARD TABLE OF bapiret2,         "Internal table for t_txt_ret
           wa_return        type  bapiret2.
    data: begin of it_konv occurs 0.
           include structure konv.
           data: end of it_konv.
    data: logic_switch type standard table of    BAPISDLS,
          wa_logic type BAPISDLS.
    data:itemdata type STANDARD TABLE OF BAPISDITM,
          wa_item type   BAPISDITM.
    data : salesorder type BAPIVBELN-VBELN.
    data:itemdatax type STANDARD TABLE OF BAPISDITMx,
          wa_itemx type   BAPISDITMx.
    data: wa_header type BAPISDH1,
          wa_headerx type BAPISDH1X.
    data: i_cond type STANDARD TABLE OF BAPICOND,
          wa_cond type BAPICOND.
    data: i_condx type STANDARD TABLE OF BAPICONDX,
          wa_condx type BAPICONDX.
    move '0060008601' to salesorder.
    move '000010'  TO wa_item-itm_number.
    append wa_item to itemdata.
    move ' '  to wa_header-BILL_BLOCK.
    move   'U'  to wa_headerx-UPDATEFLAG.
    move  'X' to wa_headerx-BILL_BLOCK.
    MOVE: 'U'  to wa_itemx-UPDATEFLAG,
         '000010'  TO wa_itemx-itm_number.
         append wa_itemx to itemdatax.
    move 'B' to wa_logic-PRICING.
    move 'X' to wa_logic-COND_HANDL.
    select single knumv from vbak into l_knumv where vbeln = '0060008601'  .
    select * from konv into table it_konv where knumv = l_knumv  and kposn = '000010'.
          wa_cond-ITM_NUMBER = it_konv-kposn.
          wa_cond-cond_type = 'Z550'.
          wa_cond-CONDCHAMAN = 'X'.
           append wa_cond to i_cond.
           clear: wa_cond.
    wa_condx-ITM_NUMBER = it_konv-kposn.
    wa_condx-COND_TYPE = 'Z550'.
    wa_condx-UPDATEFLAG = 'L'.
    append wa_condx to i_condx.
    clear: wa_condx.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
      EXPORTING
        salesdocument               = salesorder
       ORDER_HEADER_IN             = wa_header
        order_header_inx            = wa_headerx
       LOGIC_SWITCH                = wa_logic
      tables
        return                      = it_return
       ORDER_ITEM_IN               = itemdata
       ORDER_ITEM_INX              = itemdatax
       CONDITIONS_IN               =   i_cond
       CONDITIONS_INX              =   i_condx
      EXTENSIONIN                 =
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.[code]
    Thank you.
    Meena

  • How to pass table type variable into function from SQL*PLUS ?

    How to pass a table type variable from sql*plus prompt into a function ?
    Thanx in advance.

    Krishna,
    Do you mean like this?SQL> DECLARE
      2      TYPE t_tbl IS TABLE OF VARCHAR2(20);
      3      l_sample_tbl           t_tbl;
      4
      5      FUNCTION print_contents ( p_tbl IN t_tbl )
      6      RETURN VARCHAR2
      7      IS
      8          l_string            VARCHAR2(1000);
      9      BEGIN
    10          FOR i IN 1..p_tbl.COUNT LOOP
    11              IF (i = 1) THEN
    12                  l_string := p_tbl(i);
    13              ELSE
    14                  l_string := l_string || ', ' || p_tbl(i);
    15              END IF;
    16          END LOOP;
    17          RETURN (l_string);
    18      END print_contents;
    19
    20  BEGIN
    21      l_sample_tbl := t_tbl();
    22      l_sample_tbl.EXTEND;
    23      l_sample_tbl(1) := 'one';
    24      l_sample_tbl.EXTEND;
    25      l_sample_tbl(2) := 'two';
    26      l_sample_tbl.EXTEND;
    27      l_sample_tbl(3) := 'three';
    28      l_sample_tbl.EXTEND;
    29      l_sample_tbl(4) := 'four';
    30      l_sample_tbl.EXTEND;
    31      l_sample_tbl(5) := 'five';
    32      DBMS_OUTPUT.PUT_LINE(print_contents(l_sample_tbl));
    33  END;
    34  /
    one, two, three, four, five
    PL/SQL procedure successfully completed.
    SQL> HTH,
    T.

  • How to pass the SIN using a plain http adapter in sender side.

    Hi all,
       How to pass the SIN(System Identification Number) using a plain http adapter in sender side.
    Regards,
    Venu.

    You can set it in a specific HTTP header (as explained here : http://help.sap.com/saphelp_nw04/helpdata/en/43/64db4daf9f30b4e10000000a11466f/content.htm) ...
    Rgds
    Chris

  • How to pass in variables using the command line when starting ActionScript native app

    How do I pass in variables or startup arguments using the command line when starting an ActionScript native app? For example, I have my app call MySweetWidget and it has been compiled with Adobe AIR captive runtime so now I have MySweetWidget.exe.
    In the command line, I am calling MySweetWidget.exe and would like to pass in variables or properties to the application. I would assume that those variables are then read from the loaderInfo.parameters object.
    Please let me know if the Adobe AIR runtime supports passing in parameters to the native runtime. If so, I would like help determining the correct format of how to pass in the variables. Then would you read those from the loaderinfo.parameters object?
    Thanks,
    Jeff

    I found the answer to my own question:
    Yes it is a supported feature. It is documented on the following page:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/NativeApp lication.html#event:invoke
    When you subscribe to the invoke event of the NativeApplication it will subsequently dispatch the event and you read the e.arguments Array object to get the startup arguments passed into the native application.

  • How to update Billing Plan using BAPI_SALESORDER_CHANGE

    Hi,
    In my case initailly sales order header data is created and saved, with reference to SO Project is created and then item level data is updated.
    So clients requirement is to create any upload programme which can use for mass upload.
    i.e to develop a program to upload,
    i) Items in Sales Order.
    ii) Billing Plan & Pricing Conditions in SO
    I am trying to use BAPI_SALESORDER_CHANGE for this requirement. Problem is in this scenerio user exit is already used which validate "Amount" at item level and "Bill. value" in Billing plan tab should be same.
    As observed Billing plan data can not be updated using this BAPI.
    Even I've tried to use BDC for this requirement, but as we need to double click on line item while updating billing plan data and conditions it does  not work while recording.
    Incase anyone have worked on similar scenerio and found out solution, please share all your inputs.
    Warm Regards,
    Nitish

    Hi,
    The following code will take you to Billing plan tab in BDC.
      PERFORM bdc_dynpro      USING 'SAPMV45A' '0102'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'VBAK-VBELN'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM bdc_field       USING 'VBAK-VBELN'
                                    wa_vbap-vbeln.             
      PERFORM bdc_dynpro      USING 'SAPMV45A' '4001'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=ITEM'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    itemno . "'RV45A-MABNR(wa_vbap-posnr)'.
      PERFORM bdc_dynpro      USING 'SAPMV45A' '4003'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=T\06'.
      PERFORM bdc_dynpro      USING 'SAPLV60F' '4001'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '/00'.
    Regards,
    P Gomatheeswaran

  • How to pass servlet parameter using encodeURL function in JSP page

    Hi!!!
    I have a very urgently problem.
    in my JSP I have this:
    <IMG border="0" src='<%=response.encodeURL("/MyImageServlet")%>'>
    In this way, my servlet works fine (and I have in my page my blob-image).
    But I have to pass to my servlet a list of dynamic parameter. I have tried all the possibilities like:
    <IMG border="0" src='<%= (response.encodeURL("/MyImageServlet") + "?Param_name=" + sessionBean.getParamValue() + "&anotherParam" + sessionBean.getAnotherParamValue())%>'
    but nothing....
    In my servlet I use the init function to retrieve the initial parameters(defined in my web.xml file) in this way:
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    myParam = getInitParameter( "name_of_param");
    but I retrieve only the default value (-1).
    How to pass to my servlet the parameters? Please help me!
    Excuse me for my english,
    thank you for your help!

    Hi!
    Thanks for your reply!
    I have tried this solution but it doesn't work!
    When I do getInitParameter in the init function, the servlet take the default values...
    Maybe I have wrote something wrong?
    Excuse me for my english,
    Thanks

  • How to pass any type of objects into Portal's rules engine?

    Is that possible to pass any type of objects into Portal's rules engine? Or BEA's Portal service rules engine can only allow to pass a limited number of objects?
    Are there any information about BEA's rules engine? and Can we use its rules engine without using its Portal service?
    Thank you.

    I worked on BEA rules engine 4 months back. I'm sure you can pass any JAVA object to it's working meomory. I am giving my sample rules here, hope it will be helpful for you.
    I just replace pcakage name, other than that everything is from wroking project. Open in xml spy, it should be clear from the desc. If you have any questions post back.
    <cr:rule-set is-complete="true" xmlns="http://www.bea.com/servers/p13n/xsd/expression/expressions/2.1.1" xmlns:cr="http://www.bea.com/servers/p13n/xsd/rules/core/2.1.1" xmlns:literal="http://www.bea.com/servers/p13n/xsd/expression/literal/1.0.1" xmlns:string="http://www.bea.com/servers/p13n/xsd/expression/string/1.0.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/servers/p13n/xsd/rules/core/2.1.1 rules-core-2_1_1.xsd">
         <cr:rule is-complete="true">
              <cr:name>TaxForm1040</cr:name>
              <cr:description>If salary is 70,000 then this rule makes 1040 as required form</cr:description>
              <cr:conditions>
                   <multi-and>
                        <multi-and>
                             <equal-to>
    <instance-method>
    <variable>
    <name>SalaryField</name>
    <type-alias>com.blah.field.REInputObject</type-alias>
    </variable>
    <name>getKey</name>
    </instance-method>
    <literal:string>Salary</literal:string>
    </equal-to>
    <equal-to>
    <instance-method>
    <variable>
    <name>SalaryField</name>
    <type-alias>com.blah.field.REInputObject</type-alias>
    </variable>
    <name>getValue</name>
    </instance-method>
    <literal:integer>70000</literal:integer>
    </equal-to>
                        </multi-and>
                   </multi-and>
              </cr:conditions>
              <cr:actions>
                   <new-instance>
                        <type-alias>com.blah.field.RequiredField</type-alias>
                        <arguments>
                             <literal:string>1040</literal:string>
                        </arguments>
                   </new-instance>
              </cr:actions>
         </cr:rule>
    </cr:rule-set>

  • Problem with updating pricing date using BAPI_SALESORDER_CHANGE

    Hi,
    I need to update pricing date on sales order (but only on item level).
    I have been trying to use  BAPI_SALESORDER_CHANGE but nothing changes.Bapi returns no errors, ends with success.
    I hoped that bapi would change not only pricing date but also recalculate things the date affected.
    Here is my code:
    ls_head_inx-updateflag = 'U'.
    ls_bapisdls-pricing = 'C'.
    ls_item-itm_number = sales_order_posnr
    ls_item-price_date = new_price_date
    APPEND ls_item TO lt_item.
    ls_item_inx-itm_number = sales_order_posnr
    ls_item_inx-updateflag = 'U'.
    ls_item_inx-price_date = 'X'.
    APPEND ls_item_inx TO lt_item_inx.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
              EXPORTING
                salesdocument     = sales_order
                order_header_inx = ls_head_inx
                logic_switch         = ls_bapisdls
              TABLES
                return                 = lt_return
                order_item_in     = lt_item
                order_item_inx   = lt_item_inx
    Thanks & Regards,
    Mario

    Mario,
    I run same code as yours and work for me fine, able to update ITEM pricing date.
    I suppose you are using BAPI_TRANSACTION_COMMIT after your BAPI call, then only it will work.
    Also note that VBKD table stores this date for header and item. In my system, there are generally only header rows in that table, but a new item row gets generated when I change the item date with the BAPI to some other date. Also, this BAPI sometimes issues a W message instead of ERROR for something like non-existing items, so carefully check your RETURN table too.
    'Item 000002 does not exist' as WARNING message, so might be considering it as a success.
    If nothing works, try to do the same thing for the same data using VA02 and check . If that works, BAPI will work surely.
    Regards,
    Diwakar

  • How to list wage types using certain indirect modules?

    Gurus,
    How to list all the modules using certain indiect module (and which variant)?
    For example, I want to list all the wage type using PRZNT module with or with out one of its variant.
    Thanks,

    Arun,
    Do I need to know ABAP for this?
    Can you point some URL or step-bystep (high level) instrruction on how to get this?
    Thanks,

  • How to change pricing type during invoicing

    Hello,
    How can I change the pricing type from 'B' (which is in the copy rule VTFL) to 'D' during the invoicing regarding specific criteria like sales organization ?
    Thank you by advance.
    Fabien

    If the unit price in sale order differs from pricing master data (VK11) and in copy control, if "B" is maintained for the field "Pricing Type", system will consider the price from master data in billing.  If you dont want this new price for that particular billing document, as suggested already, go to condition tab, click on "Update" button and again double click on "G". 
    But please note this will work ONLY  if accounting document has not been generated.  If accounting document has been generated, then this button (Update) in condition tab will become uneditable.
    On the other hand, if for any particular billing type itself, if you dont want "B" to consider, then in VTFL itself, change it to "G" or whatever you require.
    thanks
    G. Lakshmipathi

  • How to check browser type using java.

    Hi,
    can anybody help me to check browser type using java.
    Weather it is IE or Mozilla or Opera .
    any class in java for such operation?
    vjoy

    can anybody help me to check browser type using
    java.
    Weather it is IE or Mozilla or Opera .
    any class in java for such operation?From where do you want to perform the check? An applet, application or web application?
    Kaj

  • Passing Object types using JDBC

    I need to pass Oracle user-defined object types in and out of
    PL/SQL stored procedures. Is this possible???
    Thanks
    null

    Hi Tina,
    I just had another thought. JDBC for 8.0 doesn't support
    user-defined SQL types. This feature isn't implemented until 8i.
    Sorry about the false lead!
    So you'd have to wrapper your object in another PL/SQL method
    which 'explodes' the user-defined type, as:
    procedure can_call_from_jdbc (ename varchar2, empno number, ...)
    is...
    begin
    call my_procedure(employee_t(ename, empno, ...));
    end;
    Pierre
    Oracle Product Development Team wrote:
    : Hi Tina,
    : Yikes! I'm glad you asked; it made me realize that some info
    : that's supposed to be posted on our external site is missing.
    I
    : think it'll take about a week to push this to our external
    site.
    : I'll try to find you a version and email it to you directly.
    : Thanks!
    : Pierre
    : Tina Creighton (guest) wrote:
    : : I'm currently using version 8.04 with Objects option, I'm
    : trying
    : : to locate the oracle.jpub class. Is there a way to download
    : the
    : : new jdbc that works with objects. Thanks. Tina
    : : Oracle Product Development Team wrote:
    : : : Absolutely!
    : : : the easiest thing is first to use JPub to generate a Java
    : : object
    : : : which is an analogue to the SQL object you have. For
    : example,
    : : : if your SQL object is called 'EMPLOYEE_T', you can invoke
    : JPub
    : : : with:
    : : : $ jpub -sql=employee_t -url=jdbc:oracle:oci8:@
    : : -user=scott/tiger
    : : : or even
    : : : $ java oracle.jpub.Main -sql=employee_t
    : -url=jdbc:oracle:oci8:@
    : : : -user=scott/tiger
    : : : This'll give you a Java class used to represent Java
    : instances
    : : of
    : : : the SQL 'employee_t', featuring friendly setters and getter
    : for
    : : : the fields.
    : : : If you have PL/SQL programs which take arguments of type
    : : : employee_t, such as:
    : : : PROCEDURE P1 (N NUMBER, E EMPLOYEE_T) IS...
    : : : PROCEDURE P2 (N NUMBER, E OUT EMPLOYEE_T) IS...
    : : : PROCEDURE P3 (N NUMBER, E IN OUT EMPLOYEE_T) IS...
    : : : You can call them in a SQLJ program as:
    : : : main () {
    : : : employee_t e; // the class generated by JPub
    : : : #sql {call P1(1, :e);}
    : : : #sql {call P2(2, :out e);}
    : : : #sql {call P3(3, :in out e);}
    : : : to call your three PL/SQL procedures. After the call to P2
    : and
    : : : P3, your
    : : : variable 'e' will be populated with the contents of the new
    : : : employee_t value
    : : : that was output from the PL/SQL method.
    : : : (SQLJ is just a shorthand way of calling JDBC. SQLJ
    programs
    : : are
    : : : translated
    : : : into SQLJ programs by calling the "SQLJ Translator":
    : : : $ sqlj myfile.sqlj
    : : : Pierre
    : : : Tina creighton (guest) wrote:
    : : : : I need to pass Oracle user-defined object types in and
    out
    : of
    : : : : PL/SQL stored procedures. Is this possible???
    : : : : Thanks
    : : : Oracle Technology Network
    : : : http://technet.oracle.com
    : Oracle Technology Network
    : http://technet.oracle.com
    Oracle Technology Network
    http://technet.oracle.com
    null

Maybe you are looking for

  • Is it possible to plug in an external HDD to the USB connection on my Airport Express for backups?

    Is it possible to plug in an external HDD to the USB connection on my Airport Express for backups? As a kind of cheapo Time Capsule?

  • How do I get a vi out of an exe file

    I cretaed a lab for our undergrads last year and created an exe and installer to load this on to lab computers. I then altered the initial vi and created another exe file and installer. I am trying to see the difference in the two but I can't find my

  • PI - Why Value Mapping only for little number of value?

    Dear Experts, I really want to know the reason why Value Mapping in PI is suitable if the number of values to be mapped is little. Is it because it is stored in Memory Cache instead of Database table that make it less reliable? or is it because it wo

  • Is there a way to verify a database write?

    I am writing to a access database but get inconsitent writes.  Sometimes it is written, sometime not without any way of me knowing when this will happen. I am able to double check the write afterwards with Access but I woul like to programatically co

  • Some Apps won't connect to the internet

    Dear All: I am having some strange behavior. Some of my Apps will not connect to the internet, while others have no problem. Sometimes this happens for a few days and then things are all right, and then it starts again. Today, for example, the Google