How to update multiple Price conditions in FM CRM_ORDER_MAINTAIN

Hi All,
      need to update multiple price conditions in a contract Thru FM CRM_ORDER_MAINTAIN.
please see the piece of code that am using...
  am able to update single price condition...but not able to populate 2 or more .......i,e..ADD A Condition
i,e...DATA : ls_cond TYPE prct_cond_external_input,
       lt_cond TYPE prct_cond_external_input_t.
DATA : ls_con TYPE PRCT_COND_DU,
       lt_con TYPE PRCT_COND_DU_TAB.
Create Condition Type
*ls_con-KNUMV = lv_header_guid.
*ls_con-KPOSN = lv_item_guid.
ls_con-stunr  = '134'.
IF Y EQ 1.
  ls_con-ZAEHK = '001'.
ELSE.
   ls_con-ZAEHK = '002'.
*ENDIF.
*ls_con-kschl = 'ZFP1'.
**ls_cond-waers = 'CNY'.
*ls_con-kbetr = '0.00'.
*ls_con-kpein = '1'.
ls_cond-kschl = 'ZFP1'.
ls_cond-waers = 'CNY'.
ls_cond-kbetr = '0'.
ls_cond-kpein = '1'.
ls_cond-knumh = lv_item_guid .
CLEAR ls_Price_doc.
ls_Price_doc-ref_guid = lv_item_guid.
ls_Price_doc-ref_kind = 'A'.
IF Y EQ 1.
ls_Price_doc-ref_handle = '000000001'.
ELSE.
  ls_Price_doc-ref_handle = '000000002'.
ENDIF.
*ls_price_doc-PRIC_COND[] = lt_cond[].
*INSERT ls_con into table ls_price_doc-PRIC_COND.
INSERT ls_cond into table ls_price_doc-COND_ADD.
INSERT ls_price_doc INTO TABLE lt_price_doc.
ls_input_fields-ref_guid    = lv_item_guid.
ls_input_field_names-fieldname = 'KNUMH'.
INSERT ls_input_fields INTO TABLE lt_input_fields.
ls_input_field_names-fieldname = 'KPOSN'.
INSERT ls_input_fields INTO TABLE lt_input_fields.
ls_input_field_names-fieldname = 'KSCHL'.
INSERT ls_input_fields INTO TABLE lt_input_fields.
ls_input_field_names-fieldname = 'KPEIN'.
INSERT ls_input_fields INTO TABLE lt_input_fields.
ls_input_field_names-fieldname = 'STUNR'.
INSERT ls_input_fields INTO TABLE lt_input_fields.
ls_input_field_names-fieldname = 'ZAEHK'.
INSERT ls_input_fields INTO TABLE lt_input_fields.
ls_input_field_names-fieldname = 'WAERS'.
INSERT ls_input_fields INTO TABLE lt_input_fields.
ls_input_field_names-fieldname = 'KBETR'.
INSERT ls_input_fields INTO TABLE lt_input_fields.
CLEAR ls_input_fields.
Ls_input_fields-ref_guid    = lv_item_guid.
ls_input_fields-ref_kind    = 'B'.
ls_input_fields-objectname  = 'PRIDOC'.
*ls_input_fields-logical_key = '0001'.
ls_input_fields-field_names = lt_input_field_names.
INSERT ls_input_fields INTO TABLE lt_input_fields.
CLEAR ls_input_fields.
CLEAR ls_Price_agreement.
Clear ls_cond.
I kept this under code. loop, for item records.....
Though the internal table lt_price_doc. is holding all the records, it is updating only one record. can you any one pls guide me ,

This example works fine for me. Modify it according to your needs...
Price
              IF it_item-value IS NOT INITIAL.
                ls_cond-kschl = 'PR00'. " add price
                ls_cond-kbetr = it_item-value.
                ls_cond-waers = st_head-currency.
                INSERT ls_cond INTO TABLE ls_pridoc_com-cond_add.   
                index_2 = 1.
                CLEAR: ls_cond.
              ENDIF.
Discount
              IF it_item-discount IS NOT INITIAL.
                ls_cond-kschl = 'ZPPP'. " add discount
                wa_procent_calc = it_item-discount * 10.
                ls_cond-kbetr = wa_procent_calc."it_item-discount.
                ls_cond-waers = '%'."st_head-currency.
                INSERT ls_cond INTO TABLE ls_pridoc_com-cond_add.   
                index_2 = 1.
                CLEAR: ls_cond, wa_procent_calc.
              ENDIF.
              IF index_2 = 1.
                ls_pridoc_com-ref_handle = counter.
                ls_pridoc_com-ref_kind = 'B'.
                INSERT ls_pridoc_com INTO TABLE gt_pridoc_com.
                CLEAR: index_2,ls_pridoc_com.
              ENDIF.

Similar Messages

  • How to update multiple rows in one query using php

    i am new to this can any one help me how to update multiple rows at a time i am doing an school attendance page

    Often the situation is such that you have multiple courses across a range of dates.So students may take more than one course, and you need to track attendance for each course date. The following graphic demonstrates this:
    In such a situation, you need four database tables as follows:
    students (student_id, student_name, etc.)
    courses (course_id, course_name, etc.)
    students_courses (student_id, course_id)
    attendance (student_id, course_id, dater)
    A fifth table may also be needed to define the dates of courses, but you may also be able to build this array programmatically by using PHP's robust date functions, which can give you, for instance, all the Tuesdays and Thursdays between a start date and end date.
    The students_courses table simply keeps track of which students are taking which courses, so it has just two columns for the primary keys of both of the main tables. The attendance table is similar, but it also includes a date field. The following view of the attendance table demonstrates this:
    So if David's solution does cover your needs, consider yourself lucky, because this could quickly grow from a beginner-appropriate project to a moderately advanced one.

  • How to add multiple test conditions in 'test' attribute expression of xsl:if tag

    Hi all,
    How to add multiple test conditions in 'test' attribute expression of <xsl:if> tag ?
    I have 2 parameters and I want To skip the massage if this 2 conditions happened I tried to write it :
            <xsl:when test="($TransferToCompany = 0 and $ObjectInclide=1 )">
            <b1im_skip xmlns="" info=" Obect Will Not Transfer To company">
            </b1im_skip>
          </xsl:when>
    But I get an error while I am trying to transfer The object (Account) true B1if
    I am working with SBO 9 PL 13
    thank you
    shachar

    Hi saado
    Check this link:
    http://stackoverflow.com/questions/318875/can-you-put-two-conditions-in-an-xslt-test-attribute
    Kind regards,
    Radek

  • How to update multiple telephone numbers of a customer in ADR2 table?

    Can anyone please help on how to update multiple telephone numbers of a customer. Is there a function module available for the same?
    Does SD_CUSTOMER_MAINTAIN_ALL Func Mod. update only the default telephone number in adr2?

    Hi,
    check this link
    link:[Customer tel number change.;
    hope u'll get some idea.
    Regards,
    Sneha.

  • How to update multiple calling hours based on business partner

    Hi All,
    please help me in this issue : how to update multiple calling hours based on business partner in SAP CRM.
    Regards,
    Siva kumar.

    Check maintainance view V_TB49, add new scheduling type.

  • Workflow - how to update multiple list items

    Is it possible to update up to 3 list items with the same information using a workflow?  My scenario is where a company vehicle (registration number) has up to three drivers assigned to it - Driver Name 1, Driver Name 2 and Driver Name 3.   I
    have two separate lists - one for vehicles (fleet list) and one for drivers (driver database).  In my workflow when an item is created or changed in the fleet list, I would like the current vehicle registration to be updated in all three driver records
    in the driver database.  I am not sure if I can do this as I am unsure of what my unique look up would be as I need to be able to tie a vehicle registration to a driver name. Any advice would be much appreciated.
    Thanks

    Hi,
    Refer to the following threads about how to update multiple list items simultaneously.
    http://social.technet.microsoft.com/Forums/en-US/936d05ba-6e86-4f44-bbdb-b3c5c12b2c68/how-do-i-update-multiple-list-items-at-once-in-a-sharepoint-list
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/2d342b01-1978-40c9-a203-303d145b331e/how-to-update-mulitple-list-items-at-same-time
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/8d5b7424-58dc-470b-8142-90755dbdeaae/sharepoint-workflow-change-multiple-items-in-other-list
    Thanks.
    Tracy Cai
    TechNet Community Support

  • How to update multiple elements in xml?

    Hi!
    I've a input xml containing Sales Order information.
    The xml-file has a Header and multiple detail records
    e.g.
    <NS3:header>
    + <NS3:detail>
    + <NS3:detail>
    + <NS3:detail>
    + <NS3:detail>
    + <NS3:detail>
    + <NS3:detail>
    + <NS3:detail>
    </NS3:header>
    In each detail node, I want to control if requestedDate is a working day and change date if it's not correct
    e.g.
    <NS3:detail>
    -<NS3:product>
    -<NS3:item>
    <NS3:itemProduct>222288
    </NS3:itemProduct>
    </NS3:item>
    </NS3:product>
    <NS3:quantityOrdered>2
    </NS3:quantityOrdered>
    -<NS3:processing>
    <NS3:actionType>A
    </NS3:actionType>
    </NS3:processing>
    <NS3:dateRequested>2012-03-03T13:17:48.439+01:00
    </NS3:dateRequested>
    </NS3:detail>
    In this example is <NS3:dateRequested>2012-03-03T13:17:48.439+01:00</NS3:dateRequested> a Saturday and this element should be updated with the new date for Monday <NS3:dateRequested>2012-03-05T13:17:48.439+01:00</NS3:dateRequested>
    The new date is fetched from a Web Service I invoke for each detail record.
    I can read each node and get the element for each dateRequested in a while loop by using XPATH as following:
    <scope name="Scope_1">
    <sequence name="Sequence_2">
    <assign name="Assign_3">
    <copy>
    <from expression="ora:countNodes('inputVariable','payload','/ns1:processSalesOrderElement/ns1:header/ns1:detail')"/>
    <to variable="Count"/>
    </copy>
    <copy>
    <from expression="1"/>
    <to variable="varindex"/>
    </copy>
    </assign>
    <while name="While_1"
    condition="bpws:getVariableData('varindex')&lt;bpws:getVariableData('Count')">
    <sequence name="Sequence_1">
    <assign name="Assign_6">
    <copy>
    <from expression="ora:getElement('inputVariable','payload','/ns1:processSalesOrderElement/ns1:header/ns1:detail',bpws:getVariableData('varindex'))"/>
    <to variable="outputVariable" part="payload"
    query="/ns1:processSalesOrderElement/ns1:header/ns1:detail"/>
    </copy>
    </assign>
    <assign name="Assign_4">
    <copy>
    <from expression="ora:getElement('inputVariable','payload','/ns1:processSalesOrderElement/ns1:header/ns1:detail/ns1:dateRequested',bpws:getVariableData('varindex'))"/>
    <to variable="outputVariable" part="payload"
    query="/ns1:processSalesOrderElement/ns1:header/ns1:detail/ns1:dateRequested"/>
    </copy>
    </assign>
    <assign name="Assign_1">
    <copy>
    <from expression="bpws:getVariableData('varindex') + 1"/>
    <to variable="varindex"/>
    </copy>
    <copy>
    <from variable="inputVariable" part="payload"
    query="/ns1:processSalesOrderElement/ns1:header/ns1:businessUnit"/>
    <to variable="Invoke_1_startSecureCustomerRequestDate_InputVariable"
    part="parameters"
    query="/ns5:startSecureCustomerRequestDateElement/ns5:businessUnit"/>
    </copy>
    <copy>
    <from variable="outputVariable" part="payload"
    query="/ns1:processSalesOrderElement/ns1:header/ns1:detail/ns1:dateRequested"/>
    <to variable="Invoke_1_startSecureCustomerRequestDate_InputVariable"
    part="parameters"
    query="/ns5:startSecureCustomerRequestDateElement/ns5:jdDateRequestedJulian_DRQJ"/>
    </copy>
    </assign>
    <invoke name="Invoke_1"
    partnerLink="BT_SecureCustomerRequestDateManager"
    portType="ns4:Oracle_E1_SBF_SEI_PkgBldFile_BT_SecureCustomerRequestDateManager"
    operation="startSecureCustomerRequestDate"
    inputVariable="Invoke_1_startSecureCustomerRequestDate_InputVariable"
    outputVariable="Invoke_1_startSecureCustomerRequestDate_OutputVariable"/>
    <scope name="Scope_2">
    <sequence name="Sequence_3">
    <assign name="Assign_5">
    <copy>
    <from variable="Invoke_1_startSecureCustomerRequestDate_OutputVariable"
    part="result"
    query="/ns5:startSecureCustomerRequestDateResponseElement/ns5:jdDateRequestedJulian_DRQJ"/>
    <to variable="outputVariable" part="payload"
    query="/ns1:processSalesOrderElement/ns1:header/ns1:dateRequested"/>
    </copy>
    </assign>
    </sequence>
    </scope>
    </sequence>
    </while>
    My problem is how to update the date for each detail record back to my InputVariable.
    There is no XPATH function like updateElement or changeElement?!?
    I will use the information from InputVariable with the manipulated dateRequested later on to Invoke WS to create Sales Order in a target system.
    Thanks,
    Niklas

    Hi Niklas,
    have you considered also moving from assign activities to transformations?
    e.g. (in a loop)
    1. using an XSLT to prepare data for the 'BT_SecureCustomerRequestDateManager'
    -- input document ... from 'inputVariable'
    -- input parameter ... from 'varindex'
    -- output ................ to 'Invoke_1_startSecureCustomerRequestDate_InputVariable'
    2. invoking 'BT_SecureCustomerRequestDateManager'
    3. using an XSLT to modify 'inputVariable'
    -- input document ... from 'inputVariable'
    -- input parameter ... from 'varindex'
    -- input parameter ... output from 'BT_SecureCustomerRequestDateManager'
    -- output ................ to 'inputVariable'
    Then you will not need to create custom Java program (code). It is easy to do the logic/modification inside of an XSLT.
    Also BPEL process code will be easier to read.
    Regards,
    Martin.

  • Create/Update of Price conditions - PR00

    Hi folks
    I hope U know the right Function Module. Normally we use
    transaction MM02 to insert/update price conditions via view
    "Sales: Sales Org. Data 1". Here we push the button "Conditions
    and have the posability to enter/change the PR00 price condition.
    So far so good.
    But which Function Module do I have to use if want to do the same from within a background ABAP program??
    Maybe BAPI_MATERIAL_SAVEDATA?? And how to?
    Best regards
    and have a nice weekend
    Carsten :o)

    Hi there,
    check thist thread.
    BAPI_PRICES_CONDITIONS
    Kind regards,
    J.

  • How to update cost related condition type amount in sales order without disturbing other condition types.

    Hi ,
    How to updae only one item condition  ZYV0 value in sales order. If I can see we have several options from pricing type to update condition types but here My requirement is to update only one condition amount .If I can see other pticing types they will update all condition types .
    -Exclusive option is checked for all the tables maintained in access sequence,
    Below options were not worked for me.
    -In condition type ----> Condition category has been updated with "D"(Tax) pricing type-"G" to update in sales order
    - This option worked for me but  condition category  "F"(frieght) and pricing type -H but in conditions tab when I update two condition amounts are activated for one condition type like below.
    ZYV0--30 % (old condition record value updated in sales order)
    ZYV0- 50% (updated condition record)
    Regards

    Hi Rita,
    Tried with condition category "u" and updated with pricing type "U" . It works as same I used old logic.
    with condition categories "D" and "F" it will update old and new condition record values in sales order.
    ZYV0--30 % (old condition record value updated in sales order)
    ZYV0- 50% (updated condition record)
    I have updated  here existing condition record value from 30 % to 50 % validity periods are not changed.
    Regards

  • How to update multiple records in the table using POST parameters:

    i got this idea from this website:http://www.karlrixon.co.uk/articles/sql/update-multiple-rows-with-different-values-and-a-s ingle-sql-query/comment-page-1/#comment-5409. Basically i am trying to update all the status in the results page, and by adding $i in front of the id in the text fields, and checkboxes, i can name the different inputs with different names:
    The image of how it takes the inputs is shown here:http://forums.adobe.com/thread/709034?tstart=0
    I tried this but got this error:Parse error: syntax error, unexpected T_IF, expecting ')' in C:\xampp\htdocs\Database Query\results_change.php on line 51
    will not work in the update code section:
    for($i=0;$i<$maxRows_Recordset1;$i++)
    {$a=sprintf("%s",GetSQLValueString($_POST['changeid $i'],"int"));
    $b=sprintf("%s",GetSQLValueString($_POST['checkbox $i'],"text"));
    $display_order .= array(
        $a => $b
    if($i<$maxRows_Recordset1-1)
    $ids = implode(',', array_keys($display_order));
    $updateSQL = "UPDATE `change` SET Status = CASE Change_id ";
    foreach ($display_order as $a => $b) {
        $updateSQL .= sprintf("WHEN %d THEN %s ", $a,$b);
    $updateSQL .= sprintf("END WHERE `Change_id` IN ($ids)");

    Hi,
    Try
    BEGIN
      FOR i IN 1..APEX_APPLICATION.G_F03.COUNT LOOP
        UPDATE xx_test
        SET checkbox = 'Y'
        WHERE rec_no = APEX_APPLICATION.G_F03(i);
      END LOOP;
    END;Code loops all checked checkbox. You do not need commit on page process.
    Regards,
    Jari
    http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0

  • How to Update multiple items in other list using event handler?

    Hi All,
    If i update a item in a list, then i should update multiple items in another list need to be update. How to achive using event receivers?

    Hi Sam,
    According to your description, my understanding is that you want to update multiple items in another list when updated a list item.
    In the event receiver, you can update the multiple item using Client Object Model.
    Here is a code snippet for your reference:
    public override void ItemUpdated(SPItemEventProperties properties)
    string siteUrl = "http://sp2013sps/sites/test/";
    ClientContext clientContext = new ClientContext(siteUrl);
    List oList = clientContext.Web.Lists.GetByTitle("another list name");
    ListItem oListItem = oList.GetItemById(1);
    oListItem["Title"] = "Hello World Updated!";
    oListItem.Update();
    clientContext.ExecuteQuery();
    Best regards,<o:p></o:p>
    Zhengyu Guo
    Zhengyu Guo
    TechNet Community Support

  • ABAP: How to add a Price Condition Item to an order item

    Hi experts,
       Is it possible to add a Price Condition Item to an order item by BAPI or Function in sap crm? (like: 0k04 10 USD 1 EA)

    Hi,
    You need to use CRM_ORDER_MAINTAIN and have to use structure IT_PRIDOC to update or add new pricing data.
    But do remember, you have to call FM 'BAPI_TRANSACTION_COMMIT' once you are done with call to FM CRM_ORDER_MAINTAIN, else all your updation will remain in buffer and will have no effect in Database, which will let u feel as if things are not working they should be.
    Best Regards,
    Pratik Patel
    <b>Reward with Points!</b>

  • How to delete a Price Condition?

    Hi all,
    I need to delete a price condition. How should I proceed?
    Thanks in advance,
    Regards,

    Hi,
    Do you want to delete the condition in the PO or a condition record created for a combibnation to come into PO?
    However you can delete the condition in the PO like this.
    Open the PO in change mode.and go to the tab conditions.
    Select the condition to be deleted.and press the icon ( A square with a Minus sign in Red )at the bottom of the tab and the condition will be deleted and save the PO..Please see that the PO is in fresh open condition without any transaction posted.
    If you want to delete a condition record created , go to the T code MEK2 and out the condition type there and select the key combination for which the record exists and in the next screen , select the record and press the icon for deletion (which is one like above said).and save.
    Regards,

  • How to update multiple records checked by check box

    I have list of items in my jsp pages and that are being generated by the following code
    and I want to be able to update multiple records that have a checkbox checked:
    I have a method to update the status and employee name that uses hibernate that takes the taskID
    as a paratmeter to update associated status and comments, but my issue is how to do it with multiple records:
    private void updateTaskList(Long taskId, String status, String comments) {
    TaskList taskList = (TaskList) HibernateUtil.getSessionFactory()
                   .getCurrentSession().load(TaskList.class, personId);
    taskList.setStatus(status);
    taskList.setComment(comments);
    HibernateUtil.getSessionFactory().getCurrentSession().update(taskList);
    HibernateUtil.getSessionFactory().getCurrentSession().save(taskList);
    <table border="0" cellpadding="2" cellspacing="2" width="98%" class="border">     
         <tr align="left">
              <th></th>
              <th>Employee Name</th>
              <th>Status</th>
              <th>Comment</th>
         </tr>
         <%
              List result = (List) request.getAttribute("result");
         %>
         <%
         for (Iterator itr=searchresult.iterator(); itr.hasNext(); )
              com.dao.hibernate.TaskList taskList = (com.dao.hibernate.TaskList)itr.next();
         %>     
         <tr>
              <td> <input type="checkbox" name="taskID" value=""> </td>
              <td>
                   <%=taskList.empName()%> </td>           
              <td>          
                   <select value="Status">
                   <option value="<%=taskList.getStatus()%>"><%=taskList.getStatus()%></option>
                        <option value="New">New</option>
                        <option value="Fixed">Fixed</option>
                        <option value="Closed">Closed</option>
                   </select>          
    </td>
              <td>               
                   <input type="text" name="Comments" MAXLENGTH="20" size="20"
                   value="<%=taskList.getComments()%>"></td>
         </tr>
    <%}%>
    _________________________________________________________________

    I solved it by making changes in the occurrence  parameter of data type ...:-)

  • How to Update multiple line Items in Sales order Interactive form

    Hi,
            I have created one online interactive form for sales order. In that I incorporated dynamic table logic .i.e. we can add row and delete row using buttons. Interactive form is working fine with one line item. But if I give multiple lines in table (line item) its creating sales order with single line item. So please help me how to pass multiple lines.
    Thanks & Regards,
    Krishna.

    Hi,
    Check out this link, this deals with the problem you are facing.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/802f0ed1-a17a-2c10-7db4-d515a5b047ed
    Regards,
    Runal

Maybe you are looking for

  • Where to see PC hierarchy with cost center assignments

    I have created two profit centers and a number of cost centers.  Each cost center has one of the profit centers assgned to it.  I can see where to view the profit center hierarchy and where to see the cost center hierarchy.  BUt is there somwehere to

  • Bootcamp Stops on "setup is inspecting your computer hardware configuration"

    Just bought a new iMac for my business computer and can't get Windows XP SP2 to load. It stops on "setup is inspecting your computer hardware configuration". I am running BootCamp 3.0.4. It has the 2.5 Ghz i5 processor. I have read other support docu

  • How to reduce the capital of loan contract with FM

    Hello Expert, i may use the 'FNVW' to reduce the capital of loan contract, but now i wanna realize this using FM who konw if it is available in banking loan system. your answer will be appreciated Kevin

  • Three little dots

    Dear all Does anyone know a way of stopping Lightroom doing it's three little dots thing when browsing thumbnails? While using it to browse or manage my images the machine slows to a crawl until it has finished. In order to see my files and move them

  • Logic Boards ARRRRGGGGHHH

    Ok, the logic board has gone for the THIRD time in the iBook. Only this time, the extended warranty for this has expired and I'm going to have to pay for it. Any ideas how much this costs, I don't use the iBook all that much but I'd still like to hav