Header Condition changing to Item condition

Hi Gurus
I have a header condition ZXXX, Client want to change to item condition manual condition and for only ZOR order type only, for this abaper written rounite and working fine.
But if i made ZXXX header condition to item condition. Does system have any errors with existing open sales orders, deliveries. i have not made any changes in pricing procedure. Will anything changes in conditions of items and header level like subtotals, totals etcs...
Thanks
Ramki

Thanks for your inputs Lakshmipathi, for header condition it is there as manual check in pricing procedure, iam doing this ZXXX as item condition and as manual condition in pricing procedure. if i check this, i do not need to put access sequence in condition type.
I have a test case - before i change ZXXX as item condition i have created sales order without deliery, with delivery & PGI, and with invoice.
so after changeing item condition, if i goto open sales order header--> conditions and come back its ZXXX is converting to item condition. if i goto item conditions and come back, its not changing anything.
Please suggest how to go about this.
Regards
Ramki

Similar Messages

  • Vendor Change in item conditions for ME21N

    hi frnds,
    in me21n, i have placed 1 more vendor in header section. now i need to pass this vendor in item condtions for some condition types. for this, i have gone thru LMEKO002 enhancement. in this enhancement i am not able to get any data of item conditions.
    helpful answers will be rewarded by points.
    thanks in advance.
    regards,
    balu

    Hi Thomas,
    i have tried it. but in that item conditions are not coming. in that enhancement we can get the details of item only. but my requirement is, i need to change the vendor for some specific conditions in each item only.
    ex: assume that item no. 10 have 5 conditions. in that for 2 conditions should pickup the main vendor and another 3 conditions should pickup another customised vendor which i was given in header.
    Hi Prabhu,
    i am trying on Badi.
    Regards,
    Balu

  • Header condition types and item condition type

    Hello Gurus,
            this is a simple question. does the header condition types are totally same as item condition types ?
    thanks very much!

    hi,
    header:
    If this condition is marked as a header condition, it is possible to enter the condition type in the header condition screen. Checks for changing the condition manually are unaffected by this.
    the header conditions calculate the header value
    item :  conditions of this type are allowed to be entered in the document items. The condition is then only valid for the particular item in which it is entered.
    item condition calculate at item level
    (freight condition)for eg = HD00 is a header condition .here if you have 10 materials and this cond type calculates the freight charges for all the 10 items.
                KF00 is aitem condition.here system caliculates the freight charges only for that particular items.
    Edited by: MANI ROOPA SD/MM on Apr 24, 2008 2:32 PM

  • How to hide the Condition types in item condition screen in Sales Order ?

    Hi Experts,
    We got new requirement from the Client. Pricing Condition types  are ZZBG, ZPBG, ZPBA, ZFSG, ZBDG and ZBHG part in Pricing Procedure. These condition types have Condition records. These need to be hidden in Item conditions screen in Sales Order but other status of the conditions remain unchanged. Pleas provide me the solution earliest  How this we can achieve in a best way.
    Best Regards,
    Srikith

    Hi Srikanth,
    You can achieve this using CONDITION EXCLUSION.
    Maintain Condition exclusion for first condition type its Exclude the condition types which are below to that.
    You must set a condition exclusion indicator for the price. You can do this in two ways:
    If you want to set the condition exclusion indicator a follows then you specify it:
    1..for all condition records of a condition type (e.g. with condition type PR00) when defining a condition type in SD Customizing
    2.for an individual condition record (e.g. only for material 4711) in the detail screen of a condition record (in the Condition exclusion field)
    Hope this will helps you
    Dasaradha

  • Header condition positive but item condition negative

    Hi,
    We use a customised Statistical Condition type in the Sales Order.
    It is observed that often, whilst the Header Condition value is correct and positive, when the value is getting distributed to the line items, one of the Line item is getting a negative value allocated to it !
    Eg:
    header condition value is 50.
    this is allocated to the various items as follows:
    item 1  =     30
    item 2  = 20
    item 3  =     40
    Total    =     50
    Item 2 is  getting a value of minus 20 !!!!.
    can you let me know how the system allocates the Header Condition value to the Line items ?
    Thanks in advance for your help.

    hi
    i have checked that too and there are no issues there
    actually, this has been recurring....but happens in only 1 or 2 documents in a month as compared to the 1000's which are processed.....

  • When material price changed (sd item conditions)

    Hi all,
    when material price changed in the time that is used in an sd order and when this order's delivery has been created..
    the order's item's material's price has been changed before invoice printed(assume item as 10 and material assume as 600300)
    i need to update that order with the new price of the material.
    Even this can be done backward. I mean you may have an order that amount is 100,000(with different item no's) and send this at 20 times and may print 20 different delivery for this order. And order can be on January and you still send the janu's order at May. Whenever you send the delivery you have to update the respective item's price not others.
    All in all i want to update the order's price item by item...
    please write any way to solve this.
    Thanks..

    Hi,
    it does not matter if the BADI is already implemented. You can add your additional logic there. If you put break points in all methods of BADI implementation and run ME2xN then you will see when is each method called. You are right that here is no BADI method SET_DATA. What I meant is that you get a reference to PO item (type IF_PURCHASE_ORDER_ITEM_MM) in BADI method PROCESS_ITEM. This interface has to methods GET_DATA and SET_DATA. Using these methods you can get current item fields and change them according to your needs.
    Cheers

  • Condition type in PO header can be divided in each PO item condition

    Dear all,
    I would like to do as below:
    In PO:
    Item detail:
                       Material A, Qty = 200
                       Material B, Qty = 300
    Header:
        Condition tab: Condition type = Z001 (Freight charge) = 15,000 $
    After that the system auto calculate and update the condition type in Item Condition:
    - Material A, Condition type = Z001 (Freight charge) = 15,000 / (200+300) * 200 = 6,000 $
    - Material B, Condition type = Z001 (Freight charge) = 15,000 / (200+300) * 300 = 9,000 $
    Can I do that?
    How I can configure the system?
    Thanks a lot for your support!
    Rgds,
    CH

    yes, this can be done.
    http://help.sap.com/erp2005_ehp_05/helpdata/en/dd/56177a545a11d1a7020000e829fd11/frameset.htm

  • Diff. between header & item condition

    Pls let me know the diff. between header & item condtion in SD.
    How to define header & item seprately

    Hi Prem,
    You can make a Condition Type a Header Condition by checking the "Header Condition" check box in
    SPRO -> Sales & Distribution -> Basic Functions -> Pricing -> Pricing Control -> Define Condition Types.
    In turn, it can be made an Item Condition by checking the
    "Item Condition" check box.
    In an Sales Order doc you can assign a header condition by choosing the "Display document header details" button at the top right of the screen, then move to "Conditions" tab and Add the Header Condition type to the list of Conditions.
    Similarly, item conditions can be set by selecting the line item and choosing the "Item Conditions" button and adding the Item Condition type.
    Hope it answers your query completely.
    regards,
    Raj

  • Duplicate condtion types accepting in item condition (interesting)

    Hi Sap Guru's,
    When i am entering manual condition type in item condition type column Ex: PR00 basic price 2000/Rs, and again i am entering same condition type PR00 basic price 1000/Rs the system accepting same condition type ?? is there any standard setting to eliminate duplicate condition types in item condition (sales order)
    Point will be rewarded to Everyone for helpful solutions.
    Thanks & Regards,
    San Rao

    Hi ,
    System will considered if the validity periods are diffrent,
    one ,in condition Type  controls you have one option ,manual entries ha priority ,changes which u can made Through this u can control.
    Making manual entries
    Indicator which controls the priority within a condition type between a condition entered manually and a condition automatically determined by the system.
    &WHAT_TO_DO?
    Make the following entries according to your requirements:
    _: No limitations
    A: Freely definable
    B: The automatic entry has priority. If a condition record exists, the condition cannot be entered manually.
    C: The manual entry has priority. When you enter the condition
    manually, the system does not check whether a condition record exists.
    D: Cannot be processed manually
    With best regards,
    venkataswamy.y

  • Changing Header/Item condition after billing has been done

    Hi,
    I have an issue in which the sales order is incomplete but invoicing has been done. On seeing the change log I found that new condition type has been added after generation of invoice.
    Now the user wants that entire header/item condition screen should be greyed out after creation of billing document. can it be done through config or user exit is the way,
    My apologies if I posted at a wrong thread.
    Thanks
    Subhadeep

    Hi,
    There is no mechanism to find out if the billing document has been created and sales order will allow changes to pricing even after creation of invoice.
    The point is that, it doesnt matter if the sales order is changed after the invoice has been created, since the values from SO has gone into billing.
    However, if you still wish to lock changes to order once it is billed, kindly refer to some userexit like MV45AFZZ which works during sales order processing and you may get the billing status from VBUK and VBUP tables.
    Regards,
    Amit

  • Change Pricing Condition for an item with CRM_ORDER_MAINTAIN

    Hi community,
    I try to change an existing condition with the function module crm_order_maintain.
    Everything looks fine, no error no dump, but no success
    The condition stays the same!
    Can anybody find a solution for this?
    Heres my report so far:
    *& Report  ZTEST_PRICING2
    REPORT  ztest_pricing2.
    DATA: lt_guid      TYPE crmt_object_guid_tab,
          lt_item      TYPE crmt_object_guid_tab,
          lt_saved     TYPE crmt_return_objects,
          lt_pridoc    TYPE crmt_pric_cond_t,
          ls_pridoc    TYPE crmt_pric_cond,
          lt_pricom    TYPE crmt_pridoc_comt,
          ls_pricom    TYPE crmt_pridoc_com,
          lt_header    TYPE crmt_orderadm_h_comt,
          lt_input     TYPE crmt_input_field_tab,
          ls_input     TYPE crmt_input_field,
          ls_input_fn  TYPE CRMT_INPUT_FIELD_NAMES,
          ls_cond_chg  TYPE prct_cond_external_change,
          ls_cond      TYPE PRCT_COND_DU,
          lt_pricing_i TYPE CRMT_PRICING_I_WRKT.
    PARAMETERS: lv_head TYPE crmt_object_guid DEFAULT 'C4C61C4E35DDF306E10000000A024089'.
    PARAMETERS: lv_item TYPE crmt_object_guid DEFAULT '09C71C4E35DDF306E10000000A024089'.
    PARAMETERS: lv_kbetr TYPE prct_cond_rate DEFAULT '100'.
    INSERT lv_head INTO TABLE lt_guid.
    INSERT lv_item INTO TABLE lt_item.
    CALL FUNCTION 'CRM_ORDER_READ'
      EXPORTING
        it_header_guid                    = lt_guid
        it_item_guid                      = lt_item
    *   IV_MODE                           =
    *   IV_ONLY_SPEC_ITEMS                =
    *   IT_REQUESTED_OBJECTS              =
    *   IV_NO_AUTH_CHECK                  =
    *   IT_ITEM_USAGE_RANGE               =
    *   IV_SUBITEM_DEPTH                  = -1
    *   IT_OBJECT_FILTER                  =
    *   IV_ONLY_CHANGED_OBJ               = FALSE
    *   IV_STATUS_H_CHECK_RELEVANCE       = FALSE
      IMPORTING
        et_pridoc                         = lt_pridoc
        et_pricing_i                      = lt_pricing_i
    * CHANGING
    *   CV_LOG_HANDLE                     =
    EXCEPTIONS
       document_not_found                = 1
       error_occurred                    = 2
       document_locked                   = 3
       no_change_authority               = 4
       no_display_authority              = 5
       no_change_allowed                 = 6
       OTHERS                            = 7.
    IF sy-subrc <> 0 AND lt_pridoc IS NOT INITIAL.
      WRITE: / 'ERROR'.
      EXIT.
    ENDIF.
    READ TABLE lt_pridoc INDEX 1 INTO ls_pridoc.
    IF sy-subrc <> 0.
      WRITE: / 'ERROR'.
      EXIT.
    ENDIF.
    READ TABLE ls_pridoc-pric_cond INTO ls_cond WITH KEY kschl = 'PB00'.
    IF sy-subrc <> 0.
      WRITE: / 'ERROR'.
      EXIT.
    ENDIF.
    ls_input-ref_guid   = lv_head.
    ls_input-ref_kind   = 'A'.
    ls_input-objectname = 'PRIDOC'.
    ls_input_fn-fieldname = 'WAERS'.
    INSERT ls_input_fn INTO TABLE ls_input-field_names.
    ls_input_fn-fieldname = 'KBETR'.
    INSERT ls_input_fn INTO TABLE ls_input-field_names.
    INSERT ls_input INTO TABLE lt_input.
    ls_pricom-ref_guid   = lv_head.
    ls_pricom-ref_kind   = 'A'.
    *ls_pricom-PRICING_TYPE  = 'B'.
    *ls_pricom-pricing_procedure = 'ZZMTA'.
    ls_pricom-pric_cond[] = ls_pridoc-pric_cond[].
    MOVE-CORRESPONDING ls_cond TO ls_cond_chg.
    ls_cond_chg-waers = 'EUR'.
    ls_cond_chg-kbetr = lv_kbetr.
    INSERT ls_cond_chg INTO TABLE ls_pricom-cond_change.
    APPEND ls_pricom TO lt_pricom.
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
      EXPORTING
        it_pridoc         = lt_pricom
      CHANGING
    *    ct_orderadm_h     = lt_header
        ct_input_fields   = lt_input
      EXCEPTIONS
        error_occurred    = 1
        document_locked   = 2
        no_change_allowed = 3
        no_authority      = 4
        OTHERS            = 5.
    IF sy-subrc <> 0.
      EXIT.
    ENDIF.
    CALL FUNCTION 'CRM_ORDER_SAVE'
      EXPORTING
        it_objects_to_save         = lt_guid
      IMPORTING
        et_saved_objects           = lt_saved
    *   ET_EXCEPTION               =
    *   ET_OBJECTS_NOT_SAVED       =
    EXCEPTIONS
       document_not_saved         = 1
       OTHERS                     = 2.
    IF sy-subrc EQ 0.
      COMMIT WORK AND WAIT.
    ELSE.
      ROLLBACK WORK.
    ENDIF.
    regards
    Markus

    Hello Jordi,
    The example below is whereby i was trying to copy all the pricing condition on one document to another and deleting what's not present on the source document.
    You can used this piece of code to adapt your requirement.
    CALL FUNCTION 'ZCRC_FM_COPY_PRICE_COND_ALL'
              EXPORTING
    id_object_guid_src    = <fs_el_con_guid>
    id_object_guid_dest = <fs_el_so_guid>
    id_commit                  = abap_false
              EXCEPTIONS
    not_allowed         = 1
    error_occured     = 2
    OTHERS                 = 3.
      PERFORM f_recup_donnees USING     id_object_guid_src
                                                              id_object_guid_dest.
    PERFORM f_modif_condition_prix USING id_object_guid_src
                                                                                      id_object_guid_dest.
    PERFORM f_header_copy_pricing using id_object_guid_src
                                                                            id_object_guid_dest.
    FORM f_recup_donnees   USING      pd_object_guid_src TYPE crmt_object_guid
                                                                           pd_object_guid_dest TYPE crmt_object_guid.
      DATA:
         lt_header_guid        TYPE crmt_object_guid_tab.
      INSERT pd_object_guid_src  INTO TABLE lt_header_guid.
      INSERT pd_object_guid_dest INTO TABLE  lt_header_guid.
      CLEAR: gt_orderadm_i, gt_doc_flow.
      CALL FUNCTION 'CRM_ORDER_READ'
        EXPORTING
          it_header_guid       = lt_header_guid
        IMPORTING
          et_doc_flow          = gt_doc_flow            
          et_orderadm_i        = gt_orderadm_i
        EXCEPTIONS
          document_not_found   = 1
          error_occurred       = 2
          document_locked      = 3
          no_change_authority  = 4
          no_display_authority = 5
          no_change_allowed    = 6
          OTHERS               = 7.
      IF sy-subrc NE 0.
        RAISE error_occured.
      ENDIF.
    " F_RECUP_DONNEES
    FORM f_modif_condition_prix USING pd_guid_src TYPE crmt_object_guid
                                      pd_guid_dest TYPE crmt_object_guid.
      DATA : ld_pd_handle_src     TYPE prct_handle,
              ld_pd_handle_dest    TYPE prct_handle,
              lt_komv_print_src    TYPE prct_cond_print_t,
    lt_komv_print_dest   TYPE prct_cond_print_t,
              ls_komv_print_dest   LIKE LINE OF lt_komv_print_dest,
              ls_komv_print_src    LIKE LINE OF lt_komv_print_src,
              lt_cond_chg          TYPE prct_cond_print_t,
              lt_cond_chg_insert   TYPE prct_cond_print_t,
              ls_cond_chg          TYPE prct_cond_print,
              ls_cond_chg_tmp      TYPE prct_cond_print,
              ls_input_fields      TYPE crmt_input_field,
              lt_input_fields      TYPE crmt_input_field_tab.
      DATA : bal_log         TYPE balloghndl,
             lt_item_ret     TYPE prct_item_ret_t,
             lt_cond_ret     TYPE prct_cond_print_t,
             ld_data_changed TYPE xfeld,
             gv_decimal      TYPE usdefaults-dcpfm,
             ld_lines        TYPE i,
             ld_ajout_cond   TYPE abap_bool.
      FIELD-SYMBOLS : <fs_orderadm_i_dest>  TYPE crmt_orderadm_i_wrk,
    <fs_orderadm_i_src>   TYPE crmt_orderadm_i_wrk,
                      <fs_cond_chg>         TYPE prct_cond_print,
    <fs_cond_chg_insert>  TYPE prct_cond_print.
    * Début Ajout CD1K904313-001.
      DATA: ld_guid_src  TYPE crmt_object_guid.
      FIELD-SYMBOLS: <fs_doc_flow>  TYPE crmt_doc_flow_wrk.
    * Début Ajout CD1K904313-001.
    * Verrouillage des documents source et destinataire
      PERFORM f_lock_document USING pd_guid_src.
      PERFORM f_lock_document USING pd_guid_dest.
    *Récupérer le pricing handle des documents
    * Document source
      CALL FUNCTION 'CRM_PRIDOC_GET_HANDLE_OW'
        EXPORTING
    iv_header_guid             = pd_guid_src
        IMPORTING
    ev_pd_handle               = ld_pd_handle_src
        EXCEPTIONS
    error_occurred             = 1
    handle_determination_error = 2
          orgdata_error              = 3
          OTHERS                     = 4.
      IF sy-subrc <> 0.
        RETURN.
      ENDIF.
    * Document destinataire
      CALL FUNCTION 'CRM_PRIDOC_GET_HANDLE_OW'
        EXPORTING
          iv_header_guid             = pd_guid_dest
        IMPORTING
          ev_pd_handle               = ld_pd_handle_dest
        EXCEPTIONS
          error_occurred             = 1
          handle_determination_error = 2
          orgdata_error              = 3
          OTHERS                     = 4.
      IF sy-subrc <> 0.
        RETURN.
      ENDIF.
    * A ne pas traiter les postes de type ZPDF
      DELETE  gt_orderadm_i WHERE itm_type = 'ZPDF'.
      LOOP AT gt_orderadm_i ASSIGNING <fs_orderadm_i_dest> WHERE header = pd_guid_dest.
        REFRESH : lt_komv_print_src,
                  lt_komv_print_dest,
    lt_cond_chg,
    lt_cond_chg_insert.
    * Début Modif CD1K904313-001.
    * Récupérer le guid de l'item liée au item destinataire.
        READ TABLE gt_doc_flow ASSIGNING <fs_doc_flow> WITH KEY objkey_b = <fs_orderadm_i_dest>-guid.
        CHECK sy-subrc EQ 0.
        ld_guid_src = <fs_doc_flow>-objkey_a.
    *    READ TABLE gt_orderadm_i ASSIGNING <fs_orderadm_i_src> WITH KEY header = pd_guid_src
    * number_int = <fs_orderadm_i_dest>-number_int.
    * Fin Modif CD1K904313-001.
    * Récupérer les pricing document
        IF sy-subrc EQ 0.
    *     Document source
          CALL FUNCTION 'PRC_PD_ITEM_SHOW'
            EXPORTING
              iv_pd_handle        = ld_pd_handle_src
    *         iv_item_no          = <fs_orderadm_i_src>-guid    "Supression CD1K904313-001
              iv_item_no          = ld_guid_src                 "Addition CD1K904313-001
            IMPORTING
              et_komv_print       = lt_komv_print_src
            EXCEPTIONS
              non_existing_handle = 1
              non_existing_item   = 2
              ipc_error           = 3
              OTHERS              = 4.
        ENDIF.
    *   Document destinataire
        CALL FUNCTION 'PRC_PD_ITEM_SHOW'
          EXPORTING
            iv_pd_handle        = ld_pd_handle_dest
            iv_item_no          = <fs_orderadm_i_dest>-guid
          IMPORTING
    et_komv_print       = lt_komv_print_dest
          EXCEPTIONS
            non_existing_handle = 1
            non_existing_item   = 2
            ipc_error           = 3
            OTHERS              = 4.
    * Modification et Suppression des conditions de prix
        LOOP AT lt_komv_print_dest INTO ls_komv_print_dest .
          CLEAR: ls_cond_chg,
                 ls_komv_print_src.
          MOVE-CORRESPONDING ls_komv_print_dest TO ls_cond_chg.
    * Rechercher la condition sur le document source
          READ TABLE lt_komv_print_src INTO ls_komv_print_src WITH KEY kschl = ls_komv_print_dest-kschl
    zaehk = ls_komv_print_dest-zaehk. "CD1K904313
          IF sy-subrc EQ 0.
            ls_cond_chg-kbetr_prt = ls_komv_print_src-kbetr_prt.
            ls_cond_chg-kwert     = ls_komv_print_src-kwert.
            ls_cond_chg-kinak     = ls_komv_print_src-kinak.
          ELSEIF ls_cond_chg-kschl IS NOT INITIAL.
            CLEAR ls_cond_chg.
            CONTINUE.
          ENDIF.
    *     Format décimal
          CASE gv_decimal.
            WHEN space.       "format N.NNN,NN
              REPLACE ALL OCCURRENCES OF '.' IN ls_cond_chg-kbetr_prt WITH ','.
            WHEN 'Y'.         "format N NNN NNN,NN
              REPLACE ALL OCCURRENCES OF '.' IN ls_cond_chg-kbetr_prt WITH ','.
          ENDCASE.
          INSERT ls_cond_chg INTO TABLE lt_cond_chg.
          CLEAR ls_cond_chg.
        ENDLOOP.
    * Ajout des conditions de prix
        LOOP AT lt_komv_print_src INTO ls_komv_print_src WHERE kschl IS NOT INITIAL.
          CLEAR: ls_cond_chg, ld_lines, ls_komv_print_dest, ls_cond_chg_tmp, ld_ajout_cond.
    * Vérifier la présence de la condition sur le document destinataire
          READ TABLE lt_komv_print_dest INTO ls_komv_print_dest WITH KEY kschl = ls_komv_print_src-kschl
    zaehk = ls_komv_print_src-zaehk. "CD1K904313.
          IF sy-subrc EQ 0.
            CLEAR: ls_cond_chg, ls_komv_print_dest.
            CONTINUE.
          ELSE.
            DESCRIBE TABLE lt_cond_chg LINES ld_lines.
            READ TABLE lt_cond_chg INTO ls_cond_chg_tmp INDEX ld_lines.
            IF sy-subrc EQ 0.
              ld_ajout_cond = abap_true.
              MOVE-CORRESPONDING ls_komv_print_src TO ls_cond_chg.
              ls_cond_chg-knumv     = ls_cond_chg_tmp-knumv.
              ls_cond_chg-kposn     = ls_cond_chg_tmp-kposn.
              ls_cond_chg-stunr     = ls_cond_chg_tmp-stunr + 10.
            ELSE.
              CLEAR: ls_cond_chg, ld_lines, ls_komv_print_dest, ls_cond_chg_tmp.
              CONTINUE.
            ENDIF.
          ENDIF.
    *     Format décimal
          CASE gv_decimal.
            WHEN space.             "format N.NNN,NN
              REPLACE ALL OCCURRENCES OF '.' IN ls_cond_chg-kbetr_prt WITH ','.
            WHEN 'Y'.               "format N NNN NNN,NN
              REPLACE ALL OCCURRENCES OF '.' IN ls_cond_chg-kbetr_prt WITH ','.
          ENDCASE.
    * Récupérer les nouvelles conditions qui seront ajouté au document destinataire
          IF ld_ajout_cond EQ abap_true.
            INSERT ls_cond_chg INTO TABLE lt_cond_chg_insert.
          ENDIF.
          INSERT ls_cond_chg INTO TABLE lt_cond_chg.
          CLEAR ls_cond_chg.
        ENDLOOP.
        CALL FUNCTION 'PRC_INT_ITEM_INPUT'
          EXPORTING
            iv_pd_handle        = ld_pd_handle_dest
            iv_item_no          = <fs_orderadm_i_dest>-guid
            it_cond_prt         = lt_cond_chg
            iv_bal_log          = bal_log
            iv_req_ret          = abap_true
            iv_req_cond_prt     = abap_true
          IMPORTING
            et_item_ret         = lt_item_ret
            et_cond_prt         = lt_cond_ret
            ev_data_changed     = ld_data_changed
          EXCEPTIONS
            non_existing_handle = 1
            non_existing_item   = 2
            ipc_error           = 3.
        IF sy-subrc = 0.
    *     En cas d'ajout de nouvelles conditions de prix, appeler le MF PRC_INT_ITEM_INPUT
    *     avec les montants
          IF lt_cond_chg_insert IS NOT INITIAL.
            REFRESH lt_cond_chg[].
            lt_cond_chg[] = lt_cond_ret[].
            LOOP AT lt_cond_chg_insert ASSIGNING <fs_cond_chg_insert>.
              READ TABLE lt_cond_chg ASSIGNING <fs_cond_chg> WITH KEY kschl = <fs_cond_chg_insert>-kschl.
              IF sy-subrc EQ 0.
                <fs_cond_chg>-kwert     = <fs_cond_chg_insert>-kwert.
                <fs_cond_chg>-kbetr_prt = <fs_cond_chg_insert>-kbetr_prt.
              ENDIF.
            ENDLOOP.
            REFRESH lt_cond_ret[].
            CALL FUNCTION 'PRC_INT_ITEM_INPUT'
              EXPORTING
                iv_pd_handle        = ld_pd_handle_dest
                iv_item_no          = <fs_orderadm_i_dest>-guid
                it_cond_prt         = lt_cond_chg
                iv_bal_log          = bal_log
                iv_req_ret          = abap_true
                iv_req_cond_prt     = abap_true
              IMPORTING
                et_item_ret         = lt_item_ret
                et_cond_prt         = lt_cond_ret
                ev_data_changed     = ld_data_changed
              EXCEPTIONS
                non_existing_handle = 1
                non_existing_item   = 2
                ipc_error           = 3.
          ENDIF.
    *   Publish event afin de sauvegarder les conditions de prix
          CALL FUNCTION 'CRM_EVENT_PUBLISH_OW'
            EXPORTING
              iv_obj_name = 'PRIDOC'
              iv_guid_hi  = pd_guid_dest
              iv_kind_hi  = 'A'
              iv_event    = 'SAVE'
            EXCEPTIONS
              OTHERS      = 1.
    *   As no order_maintain will follow implicitly and therefore no
    *   exec times for the events will be set, call CRM_ORDER_MAINTAIN
    *   without any parameters
    *   Then the exec time 'end of document' will be set and with the
    *   group logic also all exec times before
    *   But at least one object is needed in input_fields
    *   --> use PRIDOC
          ls_input_fields-ref_guid   = <fs_orderadm_i_dest>-guid.
          ls_input_fields-ref_kind   = 'B'.
          ls_input_fields-objectname = 'PRIDOC'.
          INSERT ls_input_fields INTO TABLE lt_input_fields.
          CLEAR ls_input_fields.
          CALL FUNCTION 'CRM_ORDER_MAINTAIN'
            CHANGING
              ct_input_fields   = lt_input_fields
            EXCEPTIONS
              error_occurred    = 1
              document_locked   = 2
              no_change_allowed = 3
              no_authority      = 4
              OTHERS            = 5.
        ENDIF.
      ENDLOOP.
    " F_MODIF_CONDITION_PRIX
    *& Form  F_LOCK_DOCUMENT
    * Verrouillage d'un document
    FORM f_lock_document  USING pd_guid TYPE crmt_object_guid.
      CONSTANTS : lc_orderadm_h TYPE  crmt_object_name  VALUE 'ORDERADM_H',
                  lc_orderadm_i TYPE  crmt_object_name  VALUE 'ORDERADM_I'.
      DATA: lv_process_mode      TYPE crmt_mode,
            lv_order_initialized TYPE crmt_boolean,
            lv_process_type      TYPE crmt_process_type,
            lv_already_locked    TYPE abap_bool.
      DATA: ls_admin_ui_status  TYPE crmt_admin_ui_status,
            ls_item_usage_range TYPE crmt_item_usage_range.
      DATA: lt_objects_to_read   TYPE crmt_object_guid_tab,
            lt_requested_objects TYPE crmt_object_name_tab,
            lt_item_usage_range  TYPE crmt_item_usage_range_tab,
            lt_locked_contract   TYPE crmt_object_guid_tab.
      INSERT pd_guid INTO TABLE lt_objects_to_read.
      INSERT lc_orderadm_h INTO TABLE lt_requested_objects.
      INSERT lc_orderadm_i INTO TABLE lt_requested_objects.
      ls_item_usage_range-sign  = 'E'.
      ls_item_usage_range-value = '02'.
      INSERT ls_item_usage_range INTO TABLE lt_item_usage_range.
    * LAM: Financing Options should be viewed in a separate screen:
      ls_item_usage_range-sign  = 'E'.
      ls_item_usage_range-value = '05'.   "Financing options
      INSERT ls_item_usage_range INTO TABLE lt_item_usage_range.
    *-> read document in change mode
      CALL FUNCTION 'CRM_ORDER_READ'
        EXPORTING
          it_header_guid       = lt_objects_to_read
          iv_mode              = 'B'
          it_requested_objects = lt_requested_objects
          it_item_usage_range  = lt_item_usage_range
        EXCEPTIONS
          document_not_found   = 1
          error_occurred       = 2
          document_locked      = 3
          no_change_authority  = 4
          no_display_authority = 5
          OTHERS               = 6.
      PERFORM enqueue_order IN PROGRAM saplcrm_order_ow IF FOUND
        USING pd_guid
              abap_false
              abap_false
              abap_false
    CHANGING sy-subrc
              lv_already_locked
              lt_locked_contract.
    " F_LOCK_DOCUMENT
    * Fin Ajout CD1K904074-001
    FORM f_header_copy_pricing  USING   pd_guid_src
    pd_guid_dest.
      DATA : ld_pd_handle_src     TYPE prct_handle,
              ld_pd_handle_dest    TYPE prct_handle,
              lt_komv_print_src    TYPE prct_cond_print_t,
    lt_komv_print_dest   TYPE prct_cond_print_t,
              ls_komv_print_dest   LIKE LINE OF lt_komv_print_dest,
              ls_komv_print_src    LIKE LINE OF lt_komv_print_src,
              lt_cond_chg          TYPE prct_cond_print_t,
              ls_cond_chg          TYPE prct_cond_print,
              ls_input_fields      TYPE crmt_input_field,
              lt_input_fields      TYPE crmt_input_field_tab.
      DATA : bal_log         TYPE balloghndl,
             lt_cond_ret     TYPE prct_cond_print_t,
             ld_data_changed TYPE xfeld,
             gv_decimal      TYPE usdefaults-dcpfm.
    * Verrouillage des documents source et destinataire
      PERFORM f_lock_document USING pd_guid_src.
      PERFORM f_lock_document USING pd_guid_dest.
    *  Récupérer le pricing handle des documents
    * Document source
      CALL FUNCTION 'CRM_PRIDOC_GET_HANDLE_OW'
        EXPORTING
          iv_header_guid             = pd_guid_src
        IMPORTING
          ev_pd_handle               = ld_pd_handle_src
        EXCEPTIONS
          error_occurred             = 1
          handle_determination_error = 2
          orgdata_error              = 3
          OTHERS                     = 4.
      IF sy-subrc <> 0.
        RETURN.
      ENDIF.
    * Document destinataire
      CALL FUNCTION 'CRM_PRIDOC_GET_HANDLE_OW'
        EXPORTING
          iv_header_guid             = pd_guid_dest
        IMPORTING
          ev_pd_handle               = ld_pd_handle_dest
        EXCEPTIONS
          error_occurred             = 1
          handle_determination_error = 2
          orgdata_error              = 3
          OTHERS                     = 4.
      IF sy-subrc <> 0.
        RETURN.
      ENDIF.
    *  * Récupérer les pricing document
    *  Document Source
      CALL FUNCTION 'PRC_PD_HEAD_SHOW'
        EXPORTING
          iv_pd_handle        = ld_pd_handle_src
        IMPORTING
          et_komv_print       = lt_komv_print_src
        EXCEPTIONS
          non_existing_handle = 1
          ipc_error           = 2
          OTHERS              = 3.
      CHECK sy-subrc EQ 0.
    *  Document Destinataire
      CALL FUNCTION 'PRC_PD_HEAD_SHOW'
        EXPORTING
          iv_pd_handle        = ld_pd_handle_dest
        IMPORTING
    et_komv_print       = lt_komv_print_dest
        EXCEPTIONS
          non_existing_handle = 1
          ipc_error           = 2
          OTHERS              = 3.
      CHECK sy-subrc EQ 0.
    *  * Modification et Suppression des conditions de prix
      LOOP AT lt_komv_print_src INTO ls_komv_print_src .
        CLEAR: ls_cond_chg,
               ls_komv_print_dest.
        MOVE-CORRESPONDING ls_komv_print_src TO ls_cond_chg.
    * Rechercher la condition sur le document source
        READ TABLE lt_komv_print_dest INTO ls_komv_print_dest WITH KEY kschl = ls_komv_print_src-kschl
    zaehk = ls_komv_print_src-zaehk.
        IF sy-subrc EQ 0.
          IF ls_komv_print_src-kbetr NE ls_komv_print_dest-kbetr.
            ls_cond_chg-kbetr_prt = ls_komv_print_src-kbetr_prt.
            ls_cond_chg-kwert     = ls_komv_print_src-kwert.
            ls_cond_chg-kinak     = ls_komv_print_src-kinak.
            CASE gv_decimal.
              WHEN space.       "format N.NNN,NN
                REPLACE ALL OCCURRENCES OF '.' IN ls_cond_chg-kbetr_prt WITH ','.
              WHEN 'Y'.         "format N NNN NNN,NN
                REPLACE ALL OCCURRENCES OF '.' IN ls_cond_chg-kbetr_prt WITH ','.
            ENDCASE.
          ENDIF.
        ENDIF.
        CLEAR ls_cond_chg-krech.
        INSERT ls_cond_chg INTO TABLE lt_cond_chg.
        CLEAR ls_cond_chg.
      ENDLOOP.
      CALL FUNCTION 'PRC_INT_HEAD_INPUT'
        EXPORTING
          iv_pd_handle        = ld_pd_handle_dest
          iv_bal_log          = bal_log
          it_cond_prt         = lt_cond_chg
          iv_req_ret          = abap_true
          iv_req_cond_prt     = abap_true
        IMPORTING
          et_cond_prt         = lt_cond_ret
          ev_data_changed     = ld_data_changed
        EXCEPTIONS
          non_existing_handle = 1
          ipc_error           = 2
          not_allowed         = 3
          OTHERS              = 4.
      CHECK sy-subrc EQ 0.
    *    *   Publish event afin de sauvegarder les conditions de prix
      CALL FUNCTION 'CRM_EVENT_PUBLISH_OW'
        EXPORTING
          iv_obj_name = 'PRIDOC'
          iv_guid_hi  = pd_guid_dest
          iv_kind_hi  = 'A'
          iv_event    = 'SAVE'
        EXCEPTIONS
          OTHERS      = 1.
    *   As no order_maintain will follow implicitly and therefore no
    *   exec times for the events will be set, call CRM_ORDER_MAINTAIN
    *   without any parameters
    *   Then the exec time 'end of document' will be set and with the
    *   group logic also all exec times before
    *   But at least one object is needed in input_fields
    *   --> use PRIDOC
      ls_input_fields-ref_guid   = pd_guid_dest.
      ls_input_fields-ref_kind   = 'A'.
      ls_input_fields-objectname = 'PRIDOC'.
      INSERT ls_input_fields INTO TABLE lt_input_fields.
      CLEAR ls_input_fields.
      CALL FUNCTION 'CRM_ORDER_MAINTAIN'
        CHANGING
          ct_input_fields   = lt_input_fields
        EXCEPTIONS
          error_occurred    = 1
          document_locked   = 2
          no_change_allowed = 3
          no_authority      = 4
          OTHERS            = 5.
    ENDFORM.
    FORM f_header_copy_pricing  USING   pd_guid_src
    pd_guid_dest.
      DATA : ld_pd_handle_src     TYPE prct_handle,
              ld_pd_handle_dest    TYPE prct_handle,
              lt_komv_print_src    TYPE prct_cond_print_t,
    lt_komv_print_dest   TYPE prct_cond_print_t,
              ls_komv_print_dest   LIKE LINE OF lt_komv_print_dest,
              ls_komv_print_src    LIKE LINE OF lt_komv_print_src,
              lt_cond_chg          TYPE prct_cond_print_t,
              ls_cond_chg          TYPE prct_cond_print,
              ls_input_fields      TYPE crmt_input_field,
              lt_input_fields      TYPE crmt_input_field_tab.
      DATA : bal_log         TYPE balloghndl,
             lt_cond_ret     TYPE prct_cond_print_t,
             ld_data_changed TYPE xfeld,
             gv_decimal      TYPE usdefaults-dcpfm.
      PERFORM f_lock_document USING pd_guid_src.
      PERFORM f_lock_document USING pd_guid_dest.
    *  Récupérer le pricing handle des documents
    * Document source
      CALL FUNCTION 'CRM_PRIDOC_GET_HANDLE_OW'
        EXPORTING
          iv_header_guid             = pd_guid_src
        IMPORTING
          ev_pd_handle               = ld_pd_handle_src
        EXCEPTIONS
          error_occurred             = 1
          handle_determination_error = 2
          orgdata_error              = 3
          OTHERS                     = 4.
      IF sy-subrc <> 0.
        RETURN.
      ENDIF.
    * Document destinataire
      CALL FUNCTION 'CRM_PRIDOC_GET_HANDLE_OW'
        EXPORTING
          iv_header_guid             = pd_guid_dest
        IMPORTING
          ev_pd_handle               = ld_pd_handle_dest
        EXCEPTIONS
          error_occurred             = 1
          handle_determination_error = 2
          orgdata_error              = 3
          OTHERS                     = 4.
      IF sy-subrc <> 0.
        RETURN.
      ENDIF.
    *  * Récupérer les pricing document
    *  Document Source
      CALL FUNCTION 'PRC_PD_HEAD_SHOW'
        EXPORTING
          iv_pd_handle        = ld_pd_handle_src
        IMPORTING
          et_komv_print       = lt_komv_print_src
        EXCEPTIONS
          non_existing_handle = 1
          ipc_error           = 2
          OTHERS              = 3.
      CHECK sy-subrc EQ 0.
    *  Document Destinataire
      CALL FUNCTION 'PRC_PD_HEAD_SHOW'
        EXPORTING
          iv_pd_handle        = ld_pd_handle_dest
        IMPORTING
    et_komv_print       = lt_komv_print_dest
        EXCEPTIONS
          non_existing_handle = 1
          ipc_error           = 2
          OTHERS              = 3.
      CHECK sy-subrc EQ 0.
    *  * Modification et Suppression des conditions de prix
      LOOP AT lt_komv_print_src INTO ls_komv_print_src .
        CLEAR: ls_cond_chg,
               ls_komv_print_dest.
        MOVE-CORRESPONDING ls_komv_print_src TO ls_cond_chg.
    * Rechercher la condition sur le document source
        READ TABLE lt_komv_print_dest INTO ls_komv_print_dest WITH KEY kschl = ls_komv_print_src-kschl
    zaehk = ls_komv_print_src-zaehk.
        IF sy-subrc EQ 0.
          IF ls_komv_print_src-kbetr NE ls_komv_print_dest-kbetr.
            ls_cond_chg-kbetr_prt = ls_komv_print_src-kbetr_prt.
            ls_cond_chg-kwert     = ls_komv_print_src-kwert.
            ls_cond_chg-kinak     = ls_komv_print_src-kinak.
            CASE gv_decimal.
              WHEN space.       "format N.NNN,NN
                REPLACE ALL OCCURRENCES OF '.' IN ls_cond_chg-kbetr_prt WITH ','.
              WHEN 'Y'.         "format N NNN NNN,NN
                REPLACE ALL OCCURRENCES OF '.' IN ls_cond_chg-kbetr_prt WITH ','.
            ENDCASE.
          ENDIF.
        ENDIF.
        CLEAR ls_cond_chg-krech.
        INSERT ls_cond_chg INTO TABLE lt_cond_chg.
        CLEAR ls_cond_chg.
      ENDLOOP.
      CALL FUNCTION 'PRC_INT_HEAD_INPUT'
        EXPORTING
          iv_pd_handle        = ld_pd_handle_dest
          iv_bal_log          = bal_log
          it_cond_prt         = lt_cond_chg
          iv_req_ret          = abap_true
          iv_req_cond_prt     = abap_true
        IMPORTING
          et_cond_prt         = lt_cond_ret
          ev_data_changed     = ld_data_changed
        EXCEPTIONS
          non_existing_handle = 1
          ipc_error           = 2
          not_allowed         = 3
          OTHERS              = 4.
      CHECK sy-subrc EQ 0.
      CALL FUNCTION 'CRM_EVENT_PUBLISH_OW'
        EXPORTING
          iv_obj_name = 'PRIDOC'
          iv_guid_hi  = pd_guid_dest
          iv_kind_hi  = 'A'
          iv_event    = 'SAVE'
        EXCEPTIONS
          OTHERS      = 1.
      ls_input_fields-ref_guid   = pd_guid_dest.
      ls_input_fields-ref_kind   = 'A'.
      ls_input_fields-objectname = 'PRIDOC'.
      INSERT ls_input_fields INTO TABLE lt_input_fields.
      CLEAR ls_input_fields.
      CALL FUNCTION 'CRM_ORDER_MAINTAIN'
        CHANGING
          ct_input_fields   = lt_input_fields
        EXCEPTIONS
          error_occurred    = 1
          document_locked   = 2
          no_change_allowed = 3
          no_authority      = 4
          OTHERS            = 5.

  • Condition Type appear twice in PO Header in Change mode

    Hi Gurus,
    I have done the following steps:
    1. I have created an import PO and added few Freight Conditions in the header, and Customs Condition in Line item
    2. I have booked a customs invoice against the PO. (MIRO posted for Planned Delivery Costs)
    3. Now when I go to the change mode of the PO, then in the header I can see same condition type twice, one with the value maintained earlier and another with value 0.
    Issue:
    I should not be seeing the condition type twice in header.
    Please help me resolve the issue as early as possible.
    Thanks in Advance.
    Regards,
    Ankush

    Hi Ankush,
    Make sure that header conditions are marked as header only and same for item condirions in m/06
    try creating a new PO after making these changes
    Reg
    Dheeraj

  • How can I have the pricing conditions at the item and header level of the d

    How can I have the pricing conditions at the item and header level of the delivery? There exist "condition" tabs both the header and the item level of the delivery but the contents of the tabs are empty. I'll be happy if you can help me. Thanks in advance....

    Hi
    If you want to have the pricing procedure at delivery level then you need to assign a pricing procedure at delivery level also
    Just go through the path to maintain the pricing procedure at delivery level.
    IMG -> Logistics execution -> Shipping -> Basic Shipping Functions -> Pricing -> Pricing Procedure. for Delivery.
    But can you be more clear if the above one is not your query ?
    Regards
    Srinath

  • Change the Purchase Order : Item - Conditions value

    Hi,
    How to change the Purchase Order : Item - Conditions value.
    In my PO, Item conditions shows the SKTO - Cash Discount value is 0. I want to change the Discount value 10.
    How can i change it??

    Hi,
    Goto the Transaction code MN05 and give the CONDITION TYPE SKTO and change the value
    MN05 is the Transaction code for Purchase order  condition types.
    Please check and revert back if you need more details.
    regards,
    santosh

  • Crm_order_maintain ,changing pricing condition value at item level

    Hi,
    I am trying to change the pricing condition value at item level while creating sales order through CRM_ORDER_MAINTAIN.
    I am not able to change the condition value.
    Code is below.
          wa_inputfields-ref_guid   = wa_orderi-guid.
          wa_inputfields-ref_kind   = 'B'.
          wa_inputfields-objectname = 'PRIDOC'.
          wa_fieldname-fieldname    = 'KBETR'.
          append wa_fieldname to wa_inputfields-FIELD_NAMES.
          wa_fieldname-fieldname    = 'KMEIN'.
          append wa_fieldname to wa_inputfields-FIELD_NAMES.
          wa_fieldname-fieldname    = 'KPEIN'.
          append wa_fieldname to wa_inputfields-FIELD_NAMES.
          wa_fieldname-fieldname    = 'KSCHL'.
          append wa_fieldname to wa_inputfields-FIELD_NAMES.
          wa_fieldname-fieldname    = 'WAERS'.
          append wa_fieldname to wa_inputfields-FIELD_NAMES.
          INSERT wa_inputfields INTO TABLE it_inputfields.
    wa_pricing_add-KSCHL  = 'ZP06'.
    wa_pricing_add-WAERS  = 'USD'.
    wa_pricing_add-KBETR = '10'.
    wa_pricing_add-KPEIN = '1'.
    wa_pricing_add-KMEIN = 'ST'.
    INSERT wa_pricing_add INTO table it_pricing_add .
    wa_pricing-REF_GUID     = wa_orderi-guid.
    wa_pricing-REF_KIND      = 'B'.
    wa_pricing-PRICING_TYPE  = 'A'.
    wa_pricing-COND_ADD = it_pricing_add.
    wa_pricing-PRICING_PROCEDURE = 'ZVDSP'.
    append wa_pricing to it_pricing.
    Can you tell me how to overwrite the condition value while creating sales order using crm_order_maintain.?
    Regards,
    Indhra.E

    Hello Indhra,
    Check the CT_INPUT_FIELDS table, in the OBJECTNAME field you will find all the tables that are filled during the function call. Check those tables mentioned in the OBJECTNAME to look for any pricing related data.
    When your order is in change mode and you activate debug <b>just before you make the change</b>, the CRM_ORDER_MAINTAIN FM call contains <b>data only relevant for the change you just made</b>. In other words, you need to fill exactly the same tables as CRMD_ORDER does.
    E.g. You just change the pricing procedure and you see in debug that 5 tables are filled, you must do exactly the same in your code! It's quite anoying but you're using a low-level API FM that can handle ANY transaction type in CRM!
    Check it, it works!!
    <b>Reward points if useful!</b>
    Regards,
    Joost

Maybe you are looking for

  • CJ74 report

    Hello SAP Gurus, I am trying to run CJ74 report to pull the Vendor and Cost Information.I am able to run this report but i am not getting the Vendor's Information. I would like to be able to do is run a CJ74 report enter the level 1 WBS and see the l

  • Capturing The Screen using apple+shift+4

    hey if anyone knows how to change the setting so when i capture the screen, it doesnt save the image as a pdf, i want it to be a jpg, i couldnt figure it out, please if anyone knows help!

  • My 3G sim is not working even after resetting and updating apn

    I am disappointed with ios6 it has caused problems for my ipad connectivity .even after resetting apn ,network setting it is not connecting and showing 3G icon rather it shows E and speed is dead slow pls provide help at my email

  • HT5622 Apple ID Login Problem

    Why does my apple id keep saying " this apple id has not yet been used in the itunes store"

  • Godaddy and Mobileme

    I have successfully hooked up my domain name with my iWeb page, but the problem is that when I go to www.domain.com, it's fine - but when I go to simply domain.com (without the www.) it goes to the Godaddy domain page.