USE of BAPI_PRICES_CONDITIONS

Hi All,
Can i use BAPI_PRICES_CONDITIONS to create, change, delete, copy and display condition records. when i had gone through the parameters of this BAPI i found a field called operation and it has the following things:
003     Delete: Message contains objects to be deleted
004     Change: Message contains changes
005     Replace: This message replaces previous messages
009     Original: First message for process
023     Wait/Adjust: Data should not be imported
018     Resend
for create i can use 009
for delete i can use 003
for change i can use 004
but for copy and display can i use this BAPI or do i need to use some other FM's. if any has used any FM's for the above requirements, can you please share it with me.
Thanks in Advance
Srinivas

Hi All,
Can i use BAPI_PRICES_CONDITIONS to create, change, delete, copy and display condition records. when i had gone through the parameters of this BAPI i found a field called operation and it has the following things:
003     Delete: Message contains objects to be deleted
004     Change: Message contains changes
005     Replace: This message replaces previous messages
009     Original: First message for process
023     Wait/Adjust: Data should not be imported
018     Resend
for create i can use 009
for delete i can use 003
for change i can use 004
but for copy and display can i use this BAPI or do i need to use some other FM's. if any has used any FM's for the above requirements, can you please share it with me.
Thanks in Advance
Srinivas

Similar Messages

  • Problem with Multiple record creation using BAPI BAPI_PRICES_CONDITION

    Hi,
    I am working on IS Media Sales And Distribution wherein i am using BAPI BAPI_PRICES_CONDITION for condition record creation in TCODE JC9B. I am able to create one record using this BAPI for one sales promotion but having problem while creation of multiple records for the same sales promotion wherein my internal table have multiple records. It gives me error that data in BAPICONDIT is missing.
    I am aatching followig code for reference
    BAPI have field of varkey which i am filling as combination of sales org. + distn channel + sales promotion + delivery type
    In this varkey  delivery type is changing for sales promotion Can be said that one sales promotion can have multiple delivery type .
    Am i giving the correct varkey for each itration of internal table ?
    I am attaching code for reference.
    Here loop it_cond contain one promotion and multiple delivery type.
    sales org   distn ch  promotion     delivery
    0100             01        zsalesprom   03
    0100             01        zsalesprom   z3
      LOOP AT it_cond INTO wa_cond.
    Get next condition number
          CALL FUNCTION 'NUMBER_GET_NEXT'
            EXPORTING
              nr_range_nr                   = '01'
              object                        = 'KONH'
      QUANTITY                      = '1'
      SUBOBJECT                     = ' '
      TOYEAR                        = '0000'
      IGNORE_BUFFER                 = ' '
           IMPORTING
              number                        = number
      QUANTITY                      =
      RETURNCODE                    =
    EXCEPTIONS
      INTERVAL_NOT_FOUND            = 1
      NUMBER_RANGE_NOT_INTERN       = 2
      OBJECT_NOT_FOUND              = 3
      QUANTITY_IS_0                 = 4
      QUANTITY_IS_NOT_1             = 5
      INTERVAL_OVERFLOW             = 6
      BUFFER_OVERFLOW               = 7
      OTHERS                        = 8
          IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    Here i am concacating varkey for each new delivery
    CLEAR : l_min,l_length,l_var.
    CONCATENATE wa_cond-vkorg wa_cond-vtweg wa_cond-wrbakt INTO l_var.
    l_length = STRLEN( l_var ).
    IF l_var+14(2) IS INITIAL.
    WRITE wa_cond-lifart TO L_VAR+14.
    l_length = STRLEN( l_var ).
    ENDIF.
    W_LINE = W_LINE + 1.
    *First table in BAPI
            wa_bapicondct-operation = '009'.
            wa_bapicondct-cond_usage = 'A'.
            wa_bapicondct-table_no = '506'.
            wa_bapicondct-applicatio = 'J0'.
            wa_bapicondct-cond_type = 'RATE'.
            wa_bapicondct-varkey = l_var.
            wa_bapicondct-valid_to = wa_cond-datbi.
            wa_bapicondct-valid_from = wa_cond-datab.
            wa_bapicondct-cond_no = number. "
            APPEND wa_bapicondct TO it_bapicondct.
    *Second table in BAPI
            wa_bapicondhd-operation = '009'.
            wa_bapicondhd-cond_no = number.
            wa_bapicondhd-cond_usage = 'A'.
            wa_bapicondhd-table_no = '506'.
           wa_bapicondhd-created_by = sy-uname.
           wa_bapicondhd-creat_date = sy-datum.
            wa_bapicondhd-applicatio = 'J0'.
            wa_bapicondhd-cond_type = 'RATE'.
            wa_bapicondhd-varkey = l_var.
            wa_bapicondhd-valid_from = wa_cond-datab.
            wa_bapicondhd-valid_to = wa_cond-datbi.
            APPEND wa_bapicondhd TO it_bapicondhd.
    *Third table in BAPI
            wa_bapicondit-operation = '009'.
            wa_bapicondit-cond_no = number.
            wa_bapicondit-cond_count = wa_cond-cond_count.
            wa_bapicondit-applicatio = 'J0'.
            wa_bapicondit-cond_type = 'RATE'.
            wa_bapicondit-calctypcon = 'C'.
           wa_bapicondit-scaletype  = 'A'.
            wa_bapicondit-cond_value = wa_cond-kbetr.
            wa_bapicondit-condcurr = wa_cond-konwa.
            wa_bapicondit-promotion = wa_cond-wrbakt.
            APPEND wa_bapicondit TO it_bapicondit.
    *Fourth table in BAPI
            wa_bapicondqs-operation = '009'.
            wa_bapicondqs-cond_no = number.
            wa_bapicondqs-cond_count = wa_cond-cond_count.
            wa_bapicondqs-currency = wa_cond-kbetr.
            wa_bapicondqs-condcurr = wa_cond-konwa.
           wa_bapicondqs-cond_unit = 'EA'.
            wa_bapicondqs-LINE_NO = W_LINE."'0001'.
            APPEND wa_bapicondqs TO it_bapicondqs.
    *Fifth table in BAPI
            wa_bapicondvs-operation = '009'.
            wa_bapicondvs-cond_no = number.
            wa_bapicondvs-cond_count = wa_cond-cond_count.
            wa_bapicondvs-currenckey = wa_cond-konwa.
            wa_bapicondvs-currenciso = wa_cond-konwa.
           wa_bapicondvs-currency = wa_cond-kbetr.
           wa_bapicondvs-condcurr = wa_cond-konwa.
           wa_bapicondvs-curren_iso = wa_cond-konwa.
           wa_bapicondvs-LINE_NO = W_LINE."'0001'.
            APPEND wa_bapicondvs TO it_bapicondvs.
            CALL FUNCTION 'BAPI_PRICES_CONDITIONS'
    EXPORTING
      PI_INITIALMODE       = ' '
      PI_BLOCKNUMBER       =
              TABLES
                ti_bapicondct        = it_bapicondct
                ti_bapicondhd        = it_bapicondhd
                ti_bapicondit        = it_bapicondit
                ti_bapicondqs        = it_bapicondqs
                ti_bapicondvs        = it_bapicondvs
                to_bapiret2          = it_bapiret2
                to_bapiknumhs        = it_bapiknumhs
                to_mem_initial       = it_cnd_mem_initial
             EXCEPTIONS
               update_error         = 1
               OTHERS               = 2
            IF sy-subrc <> 0.
              MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            ENDIF.
            CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
             EXPORTING
               wait          = 'X'
    IMPORTING
      RETURN        =
            CLEAR : wa_bapicondct,wa_bapicondhd,wa_bapicondvs,wa_bapicondqs.
            CLEAR : wa_bapicondit.
          ENDLOOP.
        ENDIF.
      ENDIF.
    Kindly Suggest.
    Thanks
    Parag

    Solved By myself
    There is problem while passing data to internal table for item level

  • How to Use Bapi - " BAPI_PRICES_CONDITIONS "

    Hi Gurus,
          Can any one please let us know how we can use <b>BAPI_PRICES_CONDITIONS</b> for either creating or changing Price Conditions.
    Please see my code below for creating Price condition :-
    Please correct it and send me the code for both <b>changing</b> and <b>creating</b> price condition.
    *& Report  ZAVI_BAPI_TEST
    REPORT  zavi_bapi_test.
    DATA: table1 TYPE STANDARD TABLE OF bapicondct,
          table2 TYPE STANDARD TABLE OF bapicondhd,
          table3 TYPE STANDARD TABLE OF bapicondit,
          table4 TYPE STANDARD TABLE OF bapicondqs,
          table5 TYPE STANDARD TABLE OF bapicondvs,
          table6 TYPE STANDARD TABLE OF bapiret2,
          table7 TYPE STANDARD TABLE OF bapiknumhs,
          table8 TYPE STANDARD TABLE OF cnd_mem_initial,
          ret    TYPE STANDARD TABLE OF bapiret2  WITH HEADER LINE.
    DATA: wtable1 TYPE bapicondct,
              wtable2 TYPE bapicondhd,
              wtable3 TYPE bapicondit,
              wtable4 TYPE bapicondqs,
              wtable5 TYPE bapicondvs,
              wtable6 TYPE bapiret2,
              wtable7 TYPE bapiknumhs,
              wtable8 TYPE cnd_mem_initial.
    wtable1-table_no    = '305'.
    wtable1-applicatio   = 'V'.
    wtable1-cond_type  = 'ZFOR'.
    wtable1-operation   = '004'.
    wtable1-varkey       = '13001001EUR 000000000050068946'.
    *wtable1-varkey      = '0001010000000017000000000000000096'.
    wtable1-valid_to      = '99991231'.
    wtable1-valid_from  = '20071017'.
    wtable1-cond_no    = '0000007269'.
    APPEND wtable1 TO table1.
    wtable2-operation     = '004'.
    wtable2-cond_no      = '0000007269'.
    wtable2-created_by  = sy-uname.
    wtable2-creat_date   = '20071017'.
    wtable2-cond_usage = 'A'.
    wtable2-table_no      = '305'.
    wtable2-applicatio     = 'V'.
    wtable2-cond_type    = 'ZFOR'.
    wtable2-varkey         = '13001001EUR 000000000050068946'.
    *wtable1-varkey        = '0001010000000017000000000000000096'.
    wtable2-valid_from    = '20071017'.
    wtable2-valid_to        = '99981231'.
    APPEND wtable2 TO table2.
    wtable3-operation      = '004'.
    wtable3-cond_no       = '0000007269'.
    wtable3-cond_count   = '01'.
    wtable3-applicatio      = 'V'.
    wtable3-cond_type     = 'ZFOR'.
    wtable3-scaletype      = 'A'.
    wtable3-scalebasin     = 'C'.
    wtable3-scale_qty      = '1'.
    wtable3-cond_p_unt   = '1'.
    wtable3-cond_unit      = 'EA'.
    wtable3-calctypcon    = 'C'.
    wtable3-cond_value    = '444'.
    wtable3-condcurr        = 'EUR'.
    APPEND wtable3 TO table3.
    CALL FUNCTION 'BAPI_PRICES_CONDITIONS'
    EXPORTING
    PI_initialmode = 'X'
    PI_BLOCKNUMBER =
    TABLES
       ti_bapicondct  = table1
       ti_bapicondhd  = table2
       ti_bapicondit  = table3
       ti_bapicondqs  = table4
       ti_bapicondvs  = table5
       to_bapiret2    = table6
       to_bapiknumhs  = table7
       to_mem_initial = table8
    EXCEPTIONS
       update_error   = 1
       OTHERS         = 2
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    READ TABLE table6 WITH KEY type = 'E' TRANSPORTING NO FIELDS.
    IF sy-subrc = 0.
      LOOP AT table6 INTO ret.
        WRITE: / ret-type, ret-message, ret-id, ret-log_no, ret-log_msg_no,
                      ret-message_v1, ret-message_v2, ret-message_v3, ret-message_v4,
                      ret-parameter,ret-row,ret-field.
      ENDLOOP.
    ELSE.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    *EXPORTING
    WAIT =
      IMPORTING
      return = ret
    ENDIF.

    Please refer to this code.....
    wtable1-table_no = '306'.
    wtable1-applicatio = 'V'.
    wtable1-cond_type = 'ZPR0'.
    wtable1-operation = '009'.
    wtable1-varkey = '13001001USD 000000000050068946'.
    wtable1-valid_to = '99991231'.
    wtable1-valid_from = '20051101'.
    wtable1-cond_no = '$000000001'.
    APPEND wtable1 TO table1.
    wtable2-operation = '009'.
    wtable2-cond_no = '$000000001'.
    wtable2-created_by = sy-uname.
    wtable2-creat_date = '20051022'.
    wtable2-cond_usage = 'A'.
    wtable2-table_no = '110'.
    wtable2-applicatio = 'V'.
    wtable2-cond_type = 'ZPR0'.
    wtable2-varkey = '13001001USD 000000000050068946'.
    wtable2-valid_from = '20051101'.
    wtable2-valid_to = '99991231'.
    APPEND wtable2 TO table2.
    wtable3-operation = '009'.
    wtable3-cond_no = '$000000001'.
    wtable3-cond_count = '01'.
    wtable3-applicatio = 'V'.
    wtable3-cond_type = 'ZPR0'.
    wtable3-scaletype = 'A'.
    wtable3-scalebasin = 'C'.
    wtable3-scale_qty = '1'.
    wtable3-cond_p_unt = '1'.
    wtable3-cond_unit = 'EA'.
    wtable3-calctypcon = 'C'.
    wtable3-cond_value = '454'.
    wtable3-condcurr = 'USD'.
    APPEND wtable3 TO table3.
    CALL FUNCTION 'BAPI_PRICES_CONDITIONS'
    EXPORTING
    PI_initialmode = 'X'
    PI_BLOCKNUMBER =
    TABLES
    ti_bapicondct = table1
    ti_bapicondhd = table2
    ti_bapicondit = table3
    ti_bapicondqs = table4
    ti_bapicondvs = table5
    to_bapiret2 = table6
    to_bapiknumhs = table7
    to_mem_initial = table8
    EXCEPTIONS
    update_error = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    READ TABLE table6 WITH KEY type = 'E' TRANSPORTING NO FIELDS.
    IF sy-subrc = 0.
    loop at table6 into ret.
    write: / ret-type, ret-message, ret-id, RET-LOG_NO, RET-LOG_MSG_NO,
    RET-MESSAGE_V1, RET-MESSAGE_V2, RET-MESSAGE_V3, RET-MESSAGE_V4,
    RET-PARAMETER,RET-ROW,RET-FIELD.
    endloop.
    ELSE.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    *EXPORTING
    WAIT =
    IMPORTING
    return = ret
    ENDIF.
    Re: Problem with BAPI_PRICES_CONDITIONS
    Re: Sample code for  BAPI_PRICES_CONDITIONS
    Re: Problem with BAPI_PRICES_CONDITIONS
    Re: Sample code for  BAPI_PRICES_CONDITIONS

  • Updating NETPR field of table EINE using BAPI

    Hello All,
    I have a requirement to update info record data in tables EINE, EINA, KONP. The fields to be updated are KSCHL, KBETR and NETPR. I am able to successfully update KBETR and KSCHL fields using bapi BAPI_PRICES_CONDITIONS. But I am unable to find any field in the bapi structures that would update NETPR field.
    Request you to please suggest how can I update NETPR successfully in table EINE.
    Thanks in advance.
    Anand

    Hi Anand,
                         Use the Function Module 'ME_DIRECT_INPUT_INFORECORD' to update/change the info record values.
    Pass the netpr value in ls_eine structure.
    To get better understanding on using this function module, please have a look on this link
    Create new inforecord with standard-condition via FM
    Regards,
    Arun Prasath Kumar.
    Edited by: Arun Prasath Kumar on Jan 17, 2011 12:09 PM

  • LSMW or ABAP Program:- I need BAPI function module or Direct input program

    hi experts,
    I have to develop the program which uploads the transportation pricing data for freight cost management.
    the transcation code is XK15 for the application A.
    There is a program called RV14BTCI which will uploads for the application V or M not for A.
    So i can use lsmw or direct input program in both lsmw and abap program so plz help me if there is any BAPI function module or Direct input program for Application A.
    thank you,
    waiting for u r reply.
    Edited by: SANTOSH MARUPALLY on Jan 22, 2008 6:27 AM

    Hi Santosh
    Am not really sure if RV14BTCI can not be used for other applications apart from V and M.
    You can try using BAPI: BAPI_PRICES_CONDITIONS. Over the forum you can find few example coding.
    Regards
    Eswar

  • Updating amount in VK12

    Hi Guys,
    I am trying to update 'amount' against a specific material in VK12.
    I am using BAPI : BAPI_PRICES_CONDITIONS
    I am not able to update it successfully and getting stuck at the following points :-
    Amount field in VK12 is KBETR. In the above mentioned BAPI i am not able to find where i should pass value of 'amount' so as to update KBETR in VK12.
    For changing/updating do i need to pass value of BAPICONDHD-OPERATION = 004 (Change: Message contains changes) and BAPICONDIT-OPERATION = 004 or some thing else?
    ***Since there are a number of optionals parameters to be passed, is there any special one to be kept in mind without which the BAPI won't work properly? If not, what all parameters are required ?
    Kindly help me out ASAP
    Best Regards.

    hi ,
    This functionality already exists in VK12. After you pull up all the records please use the little calculator button at the bottom of the screen . When you click that you can change all the records using a set % or an absolute amount.
    -Thanks
    Saurabh Goel

  • BDC For VK11

    Hi All,
    I got a requirement to upload Condition records through trnx VK11 , but I have one doubt , how can we handle the radio buttons  ( Table ) dyamically for every Condition type???
    Ex : for condition type 'X' it has choose the table '111' and for condition type 'Y' it has to choose '222' and so on ...
    How to do the recording for this requirement ???
    I am really confused with this...Please suggest me
    Thanks in advance.

    Hi,
    Why don't you use BAPI BAPI_PRICES_CONDITIONS instead?
    Please check this sample code from other thread.
    wtable1-table_no = '306'.
    wtable1-applicatio = 'V'.
    wtable1-cond_type = 'ZPR0'.
    wtable1-operation = '009'.
    wtable1-varkey = '13001001USD 000000000050068946'.
    wtable1-valid_to = '99991231'.
    wtable1-valid_from = '20051101'.
    wtable1-cond_no = '$000000001'.
    APPEND wtable1 TO table1.
    wtable2-operation = '009'.
    wtable2-cond_no = '$000000001'.
    wtable2-created_by = sy-uname.
    wtable2-creat_date = '20051022'.
    wtable2-cond_usage = 'A'.
    wtable2-table_no = '110'.
    wtable2-applicatio = 'V'.
    wtable2-cond_type = 'ZPR0'.
    wtable2-varkey = '13001001USD 000000000050068946'.
    wtable2-valid_from = '20051101'.
    wtable2-valid_to = '99991231'.
    APPEND wtable2 TO table2.
    wtable3-operation = '009'.
    wtable3-cond_no = '$000000001'.
    wtable3-cond_count = '01'.
    wtable3-applicatio = 'V'.
    wtable3-cond_type = 'ZPR0'.
    wtable3-scaletype = 'A'.
    wtable3-scalebasin = 'C'.
    wtable3-scale_qty = '1'.
    wtable3-cond_p_unt = '1'.
    wtable3-cond_unit = 'EA'.
    wtable3-calctypcon = 'C'.
    wtable3-cond_value = '454'.
    wtable3-condcurr = 'USD'.
    APPEND wtable3 TO table3.
    CALL FUNCTION 'BAPI_PRICES_CONDITIONS'
    EXPORTING
    PI_initialmode = 'X'
    PI_BLOCKNUMBER =
    TABLES
    ti_bapicondct = table1
    ti_bapicondhd = table2
    ti_bapicondit = table3
    ti_bapicondqs = table4
    ti_bapicondvs = table5
    to_bapiret2 = table6
    to_bapiknumhs = table7
    to_mem_initial = table8
    EXCEPTIONS
    update_error = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    READ TABLE table6 WITH KEY type = 'E' TRANSPORTING NO FIELDS.
    IF sy-subrc = 0.
    loop at table6 into ret.
    write: / ret-type, ret-message, ret-id, RET-LOG_NO, RET-LOG_MSG_NO,
    RET-MESSAGE_V1, RET-MESSAGE_V2, RET-MESSAGE_V3, RET-MESSAGE_V4,
    RET-PARAMETER,RET-ROW,RET-FIELD.
    endloop.
    ELSE.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    *EXPORTING
    WAIT =
    IMPORTING
    return = ret
    ENDIF.
    Also there are other options:
    - from LSMW the report RV14BTCI
    - batch input to transaction XK15
    - using FM modules RV_CONDITION* (e.g. _copy and _save)
    Hope this will help.
    Regards,
    Ferry Lianto

  • Data Load For BOMS

    Hello
    What would be the best approach to load BOM data in SAP
    Right now i am using LSMW with Direct Input which is causing some problem
    like
    Where there are multiple line items in the kit
    the Load process instead of creating new line item is creating alternate BOM with the same KIT
    the Transaction code I am using is CS01
    Thanks

    Hi Kiran,
    You can also use BAPI BAPI_PRICES_CONDITIONS.
    Please check this link for sample codes.
    Re: Sample code for  BAPI_PRICES_CONDITIONS
    Hope this will help.
    Regards,
    Ferry Lianto

  • Data load for VK11

    Hi All,
    can anyone suggest me about data load for VK11, I mean which method will be easier?
    appreciate if you can send me the developed custom code
    thanks.

    Hi Kiran,
    You can also use BAPI BAPI_PRICES_CONDITIONS.
    Please check this link for sample codes.
    Re: Sample code for  BAPI_PRICES_CONDITIONS
    Hope this will help.
    Regards,
    Ferry Lianto

  • Creating condition record by uploading

    Hello all,
    I am using FM BAPI_PRICES_CONDITIONS to create condition record.
    But its creating the record even if i gave the invalid details ( like invalid material number,...).
    Can you please tell me how can i handle the errors using this FM.
    Thanks in advance.
    regards,
    Lokesh

    hi..
    This code snippet inserts a condition record for Pricing condition type Z123 with key sales order
    and line number.
    CONSTANTS: lc_kschl_z123 TYPE kscha VALUE 'Z123'.
    DATA: lv_datum TYPE sydatum,
    lv_count TYPE kopos,
    lv_unit TYPE kpein,
    is_bapicondct TYPE bapicondct,
    is_bapicondhd TYPE bapicondhd,
    is_bapicondit TYPE bapicondit,
    it_bapicondct TYPE STANDARD TABLE OF bapicondct,
    it_bapicondhd TYPE STANDARD TABLE OF bapicondhd,
    it_bapicondit TYPE STANDARD TABLE OF bapicondit,
    it_bapicondqs TYPE STANDARD TABLE OF bapicondqs,
    it_bapicondvs TYPE STANDARD TABLE OF bapicondvs,
    it_bapiret2 TYPE STANDARD TABLE OF bapiret2,
    is_bapiret2 TYPE bapiret2,
    it_bapiknumhs TYPE STANDARD TABLE OF bapiknumhs,
    it_mem_initial TYPE STANDARD TABLE OF cnd_mem_initial.
    lv_datum = sy-datum.
    lv_count = 1.
    LOOP AT gt_vbap INTO wa_vbap.
    * BAPI Structure for Condition Tables
    is_bapicondct-operation = '009'.
    is_bapicondct-table_no = '700'.
    is_bapicondct-applicatio = 'V'.
    is_bapicondct-cond_usage = 'A'.
    is_bapicondct-cond_type = lc_kschl_z123.
    "Set the varkey from A700 table key fields
    CONCATENATE wa_vbap-vbeln wa_vbap-posnr
    INTO is_bapicondct-varkey.
    is_bapicondct-valid_to = '12/31/2009'.
    is_bapicondct-valid_from = lv_datum.
    is_bapicondct-cond_no = '$000000001'.
    **** BAPI Structure of KONH with English Field Names
    is_bapicondhd-operation = '009'.
    is_bapicondhd-cond_no = '$000000001'.
    is_bapicondhd-created_by = sy-uname.
    is_bapicondhd-creat_date = sy-datum.
    is_bapicondhd-cond_usage = 'A'.
    is_bapicondhd-table_no = '700'.
    is_bapicondhd-applicatio = 'V'.
    is_bapicondhd-cond_type = lc_kschl_z123.
    is_bapicondhd-varkey = is_bapicondct-varkey.
    is_bapicondhd-valid_to = '12/31/2009'.
    is_bapicondhd-valid_from = lv_datum.
    *** BAPI Structure of KONP with English Field Names
    CLEAR is_bapicondit.
    is_bapicondit-operation = '009'.
    is_bapicondit-cond_no = '$000000001'.
    is_bapicondit-cond_count = lv_count.
    is_bapicondit-applicatio = 'V'.
    is_bapicondit-cond_type = lc_kschl_z123.
    is_bapicondit-scaletype = 'A'.
    is_bapicondit-scalebasin = 'B'.
    ADD 1 TO is_bapicondit-scale_qty.
    is_bapicondit-calctypcon = 'B'.
    lv_unit = wa_vbap-kwmeng.
    is_bapicondit-cond_p_unt = lv_unit.
    is_bapicondit-cond_value = wa_vbap-value.
    is_bapicondit-condcurr = wa_vbap-waerk.
    APPEND: is_bapicondct TO it_bapicondct,
    is_bapicondhd TO it_bapicondhd,
    is_bapicondit TO it_bapicondit.
    ENDLOOP.
    *** BAPI for pricing Condition Records
    CALL FUNCTION 'BAPI_PRICES_CONDITIONS'
    TABLES
    ti_bapicondct = it_bapicondct
    ti_bapicondhd = it_bapicondhd
    ti_bapicondit = it_bapicondit
    ti_bapicondqs = it_bapicondqs
    ti_bapicondvs = it_bapicondvs
    to_bapiret2 = it_bapiret2
    to_bapiknumhs = it_bapiknumhs
    to_mem_initial = it_mem_initial
    EXCEPTIONS
    update_error = 1
    OTHERS = 2.
    IF sy-subrc EQ 0.
    WRITE: /1 'Return Messages for Condition create'(t03).
    LOOP AT it_bapiret2 INTO is_bapiret2.
    WRITE: /1 is_bapiret2-message.
    ENDLOOP.
    ULINE.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    wait = 'X'
    IMPORTING
    return = is_bapiret2.
    ENDIF.

  • Updating price agreements

    Hi,
    My requirement is to update price agreemengts based on condition types for customer contracts. i tried with crm_order_maintain passing table price_agreements_crm with the modified data but its not updating. Is there any other function module for doing the same?
    kindly reply its urgent.
    Thank you,
    Vinay Sah

    hello,
    " I also need to create new condition records (KONP, KONH) " -
    Please use FM BAPI_PRICES_CONDITIONS to create condition records
    Thanks
    Krish

  • Uploading pricing conditions

    hi i got requirement that i need to upload pricing conditions for transaction VK15 and the BAPI to be used is BAPI_PRICES_CONDITIONS  can any one suggest what are the inputs for this BAPI  for creating pricing conditions and which tables it will  updated...

    Check This thread
    Sample code for  BAPI_PRICES_CONDITIONS
    Hope this helps..

  • Usage of CND_PRICES_CALL_BAPI

    Hello,
    I wonder if anybody has ever used CND_PRICES_CALL_BAPI. It is mentioned three times in the forums but it does not seem as if it was really used.
    Does anybody have experience with this function module?
    Thank you in advance!

    Hi Hemavathi
    Please try to use BAPI: BAPI_PRICES_CONDITIONS
    Following link can help you understand in using the BAPI.
    Re: Sample code for  BAPI_PRICES_CONDITIONS
    VARKEY is the combinatio of the key fields in the condition table for which we want to upload condition records. Note that while preparing VARKEY you  have to make sure of preconcatenation go ZEROES for numeric fields and TRAILING Spaces for Character fields to meet up the length.
    Also there is a Direct Input Program: RV14BTCI to meet the same purpose which creates a session and process accordingly.
    Kind Regards
    Eswar

  • How to use bapi_prices_conditions

    Hi all,
    My requirement is as follows
    The condition records should be  created using the transaction code VK11. The records are created for the condition type ZP00 at following levels :-
    If the Sales Org value in the quote or order is “1300” then the key combination 
    Sales Organization / Division / List Price Group / Material is to be used
    The input at header level is Sales Organization , Division  and List Price Group .
    At the item level  material number under the Material column and the  Price under the Amount column and then save the condition record
    If the Sales Org value in the quote or order is “1100” then the key combination
    Sales Organisation / List Price Group / Material is used,
    The input at header level is Sales Organisation , and List Price Group         
    At the item level  material number under the Material column and the Scale Price and  Save the condition record.
    So now my doubt is,iam able to do the above procedure and also add scale prices and quantity using BDC..
    But now i have to replace the recording with BAPI,i searched in sdn and found bapi_prices_conditions could serve my purpose...the thing is i  don't understand where to pass the key combinations,Sales  organisation,List price group and the last but not least prices and quantity as i enter those in vk11 by selecting the record and entering the prices and scle quantity in scales(F2)..SO pls guide me the way  approach to achieve my objective
    Thanks in advance
    balaji

    wtable1-table_no = '306'.
    wtable1-applicatio = 'V'.
    wtable1-cond_type = 'ZPR0'.
    wtable1-operation = '009'.
    wtable1-varkey = '13001001USD 000000000050068946'.
    wtable1-valid_to = '99991231'.
    wtable1-valid_from = '20051101'.
    wtable1-cond_no = '$000000001'.
    APPEND wtable1 TO table1.
    wtable2-operation = '009'.
    wtable2-cond_no = '$000000001'.
    wtable2-created_by = sy-uname.
    wtable2-creat_date = '20051022'.
    wtable2-cond_usage = 'A'.
    wtable2-table_no = '110'.
    wtable2-applicatio = 'V'.
    wtable2-cond_type = 'ZPR0'.
    wtable2-varkey = '13001001USD 000000000050068946'.
    wtable2-valid_from = '20051101'.
    wtable2-valid_to = '99991231'.
    APPEND wtable2 TO table2.
    wtable3-operation = '009'.
    wtable3-cond_no = '$000000001'.
    wtable3-cond_count = '01'.
    wtable3-applicatio = 'V'.
    wtable3-cond_type = 'ZPR0'.
    wtable3-scaletype = 'A'.
    wtable3-scalebasin = 'C'.
    wtable3-scale_qty = '1'.
    wtable3-cond_p_unt = '1'.
    wtable3-cond_unit = 'EA'.
    wtable3-calctypcon = 'C'.
    wtable3-cond_value = '454'.
    wtable3-condcurr = 'USD'.
    APPEND wtable3 TO table3.
    CALL FUNCTION 'BAPI_PRICES_CONDITIONS'
    EXPORTING
    PI_initialmode = 'X'
    PI_BLOCKNUMBER =
    TABLES
    ti_bapicondct = table1
    ti_bapicondhd = table2
    ti_bapicondit = table3
    ti_bapicondqs = table4
    ti_bapicondvs = table5
    to_bapiret2 = table6
    to_bapiknumhs = table7
    to_mem_initial = table8
    EXCEPTIONS
    update_error = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    READ TABLE table6 WITH KEY type = 'E' TRANSPORTING NO FIELDS.
    IF sy-subrc = 0.
    loop at table6 into ret.
    write: / ret-type, ret-message, ret-id, RET-LOG_NO, RET-LOG_MSG_NO,
    RET-MESSAGE_V1, RET-MESSAGE_V2, RET-MESSAGE_V3, RET-MESSAGE_V4,
    RET-PARAMETER,RET-ROW,RET-FIELD.
    endloop.
    ELSE.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    *EXPORTING
    WAIT =
    IMPORTING
    return = ret
    ENDIF.
    Also there are other options:
    - from LSMW the report RV14BTCI
    - batch input to transaction XK15
    - using FM modules RV_CONDITION* (e.g. _copy and _save)

  • How to pass scale basis in bapi 'BAPI_PRICES_CONDITIONS'

    Hello,
    how can i pass the scale basis quantity and amount in multiple level (ex - scale basis quantity1, amount1 ... quantity2,amount2.....)through bapi 'BAPI_PRICES_CONDITIONS'
    Thanks
    satya

    Hello,
    I got the solutions. Below are the codes for enetring scale quantity and amounts in multiple level. Here i have used for three level, giving IS_BAPICONDQS-line_no = '0001' , IS_BAPICONDQS-line_no = '0004' , IS_BAPICONDQS-line_no = '0007'.  you can use as per yours requirements.
    is_BAPICONDIT-scaletype = 'A'.  "A-from and B-to
    is_BAPICONDIT-scalebasin = 'C'. "C-Quantity and B- Value scale
    (use these two line in is_BAPICONDIT )
    IS_BAPICONDQS-operation = '009'.
    is_BAPICONDQS-cond_no = '$000000001'.
    IS_BAPICONDQS-cond_count = '01'.
    IS_BAPICONDQS-line_no = '0001'.
    IS_BAPICONDQS-scale_qty = '15'.
    *IS_BAPICONDQS-t_unit_iso = 'VIA'.
    IS_BAPICONDQS-currency   = '71'.
    IS_BAPICONDQS-CONDCURR = 'USD'.
    APPEND IS_BAPICONDQS to IT_BAPICONDQS.
    CLEAR IS_BAPICONDQS.
    IS_BAPICONDQS-operation = '009'.
    is_BAPICONDQS-cond_no = '$000000001'.
    IS_BAPICONDQS-cond_count = '01'.
    IS_BAPICONDQS-line_no = '0004'.
    IS_BAPICONDQS-scale_qty = '25'.
    *IS_BAPICONDQS-t_unit_iso = 'VIA'.
    IS_BAPICONDQS-currency   = '96'.
    IS_BAPICONDQS-CONDCURR = 'USD'.
    APPEND IS_BAPICONDQS to IT_BAPICONDQS.
    CLEAR IS_BAPICONDQS.
    IS_BAPICONDQS-operation = '009'.
    is_BAPICONDQS-cond_no = '$000000001'.
    IS_BAPICONDQS-cond_count = '01'.
    IS_BAPICONDQS-line_no = '0007'.
    IS_BAPICONDQS-scale_qty = '30'.
    *IS_BAPICONDQS-t_unit_iso = 'VIA'.
    IS_BAPICONDQS-currency   = '106'.
    IS_BAPICONDQS-CONDCURR = 'USD'.
    APPEND IS_BAPICONDQS to IT_BAPICONDQS.
    CLEAR IS_BAPICONDQS.
    Then pass the internal table IT_BAPICONDQS to the BAPI 'BAPI_PRICES_CONDITIONS'.

Maybe you are looking for