Bapi to create a condition record

hi,
is there any standard bapi for creating ,changing and deleting a pricing record using VK11,VK12.
any other function module will solve the problem.

Hi Ajith,
   You can use <b>IDOC approach</b> also for doing teh same solution. Yo get Create/Change/ Delete Option as per indicator passed:
Refer Code below.
*&      Form  map_idoc_structure
      Map E1KOMG, E1KONH, E1KONP segment fields
FORM map_idoc_structure
              USING fp_condition_table TYPE kotabnr
                    fp_rate            TYPE z_cs_cpp_rate
                    fp_condition_type  TYPE kschl
                    fp_rate_type       TYPE z_cs_file_type.
*-- Local Data Declaration
  DATA: lw_e1komg TYPE e1komg, "Filter seg. with separated condition key
        lw_e1konh TYPE e1konh, "Data from condition header
        lw_e1konp TYPE e1konp, "Conditions Items
        lv_delete TYPE konp-loevm_ko. " Delete Indicator
*-- IDoc data internal table
  DATA: i_idoc_data TYPE TABLE OF edidd
                    INITIAL SIZE 0
                    WITH HEADER LINE.
  CLEAR: lw_e1komg,
         lw_e1konh,
         lw_e1konp,
         lv_delete,
         v_segnum,
         w_e1komg,
         v_rate_type.
  REFRESH i_idoc_data.
  v_rate_type = fp_rate_type.
  PERFORM conversion_alpha_input
      USING w_crp_data-kunnr CHANGING w_crp_data-kunnr.
  PERFORM conversion_matn1_input
     USING w_crp_data-matnr CHANGING w_crp_data-matnr.
E1KOMG: Filter segment with separated condition key
  i_idoc_data-segnam  = 'E1KOMG'.
  lw_e1komg-kvewe     =  c_usage_cond_tab.
  lw_e1komg-kotabnr   =  fp_condition_table.
  lw_e1komg-kappl     =  c_cond_type.
  lw_e1komg-kschl     =  fp_condition_type.
CONCATENATE p_vkorg p_vtweg p_spart p_hienr p_matnr
  CONCATENATE w_crp_data-vkorg w_crp_data-vtweg
              w_crp_data-kunnr w_crp_data-matnr
              INTO lw_e1komg-vakey.
  lw_e1komg-vakey_long = lw_e1komg-vakey.
  lw_e1komg-vkorg      = w_crp_data-vkorg.
  lw_e1komg-vtweg      = w_crp_data-vtweg.
  lw_e1komg-spart      = w_crp_data-spart.
  lw_e1komg-kunnr      = w_crp_data-kunnr.
  lw_e1komg-matnr      = w_crp_data-matnr.
  i_idoc_data-sdata = lw_e1komg.
  APPEND i_idoc_data TO i_idoc_data.
Segment E1KONH - condition header
  i_idoc_data-segnam  = 'E1KONH'.
  lw_e1konh-datab     = w_crp_data-datab.
  lw_e1konh-datbi     = w_crp_data-datbi.
  lw_e1konh-knuma_pi  = v_promotion.
  lw_e1konh-knuma_ag  = v_sales_deal.
  i_idoc_data-sdata = lw_e1konh.
  APPEND i_idoc_data TO i_idoc_data.
  IF fm_process_type EQ c_pt_dep.
    lv_delete = c_x.              " Deletion Indicator
  ENDIF.
Segment E1KONP - condition items
  i_idoc_data-segnam = 'E1KONP'.
  lw_e1konp-kschl     = fp_condition_type.
  lw_e1konp-kbetr     = fp_rate.
  lw_e1konp-konwa     = w_crp_data-waers.
  lw_e1konp-kpein     = v_cond_pric.
  lw_e1konp-kmein     = v_cond_unit.
  lw_e1konp-knuma_pi  = v_promotion.
  lw_e1konp-knuma_ag  = v_sales_deal.
  lw_e1konp-loevm_ko  = lv_delete.
  i_idoc_data-sdata = lw_e1konp.
  APPEND i_idoc_data TO i_idoc_data.
*-- Post Idoc for Creating Pricing Condition
  PERFORM post_idoc
         TABLES i_idoc_data.
ENDFORM.                    " map_idoc_structure
*&      Form  post_idoc TABLES i_idoc_data.
      Post Idoc for Creating Pricing Condition
FORM post_idoc
          TABLES i_idoc_data STRUCTURE edidd.
*-- Local data declaration
  DATA: lv_komg         LIKE komg,         " Condition Structures
        lv_subrc        LIKE sy-subrc,     " Sy-subrc
        lw_messages     TYPE rsuvm_msg,    " Message Description
        lw_idoc_status  TYPE bdidocstat.   " ALE IDoc status
  DATA: idoc_contrl                        " IDoc Control data
            LIKE edidc OCCURS 1 WITH HEADER LINE.
*-- Initialize Internal Tables
  CLEAR:  t_konh,
          t_konp,
          t_konm,
          t_konw,
          i_idoc_status,
          t_kona.
  REFRESH: t_konh,
           t_konp,
           t_konm,
           t_konw,
           i_idoc_status,
           t_kona,
           i_messages.
This code is taken from IDOC_INPUT_COND_A
  PERFORM fill_appl_structures(saplvkoi)
                  TABLES i_idoc_data
                         t_konh
                         t_konp
                         t_konm
                         t_konw
                         i_idoc_status
                         t_kona
                   USING lv_komg
                         lv_subrc
                         idoc_contrl-docnum
                         idoc_contrl-mestyp.
  IF lv_subrc = 0.
This code is taken from IDOC_INPUT_COND_A
    PERFORM idoc_in_datenbank(saplvkoi)
              TABLES idoc_contrl
                     t_konh
                     t_konp
                     t_konm
                     t_konw
                     i_idoc_status
                     t_kona
              USING  lv_komg
                     lv_subrc
                     idoc_contrl-docnum.
    IF lv_subrc = 0.
      COMMIT WORK AND WAIT.
    Endif.
Reward points if this Helps.
Manish
Message was edited by: Manish Kumar

Similar Messages

  • FM or BAPI for creating/deleting condition records for an output type

    Hi all,
               what is the FM or BAPI for creating and deleting the condition records for a Z(custom) output type.

    You can use trasaction SXDA_TOOLS.....
    object type BUS3003
    program type BINP
    program/method RM06IBI0
    but the fields must be sequentially written in the txt, with every space inclusive....

  • ERROR Message while creating Rebate condition record T code VBO1

    Dear Experts,
    I am getting error message while creating rebate condition record T code-VBO1-Error Msg-862 system cannot read the structure for table,because of this i could not create condition record.
    Please give the solution to create condition record.
    Regards
    siva

    Hi,
    You said you are trying to do this stuff in IDES right.
    If you are using IDES provided by a company and where many people play on IDES, then you can get many such issues...
    This is by our experience.  Today you do something in IDES and tommorow that thing or config is screwed up by others.
    If you have your own IDES, then check the suggestion given by the forum Guru's.
    Regards,
    SB

  • FM'S or BAPI to update the condition records in VB22 transaction

    Hi,
    I need your help in getting the FM'S or BAPI to update the condition records in sales deal.
    The transaction is VB22.
    If you can send me a smaple code it will be really helpful.
    Regards,
    Sasi

    Check this:
    http://www.sapnet.ru/viewtopic.php?p=1644
    Bapi for VK11 & VK12
    Reddy

  • Update SO after creating missing condition record

    Hi Gurus,
    I was getting error message that missing MWST condition in Order, then I investigated and created missing condition record in VK11. Now I would like to update the Sales order and tried update tab on condition but invain.
    Initially the document was created on 17.11.2008 and today condition record was created 18.11.2008.
    Kindly help me in resolving this.
    Thanks
    Bawa

    Dear Bawa,
    While creating Condition Record "MWST" in VK11/ 12;
    What were the Dates maintained in Fields:
    1. Valid From (try with back-date maintenance)
    2. Valid To (Maintain as 31.12.9999)
    Once done, try to Update with "G - Copy pricing elements unchanged and redetermine taxes", in Sales Order.
    Best Regards,
    Amit

  • FM FOR CREATING NEW CONDITION RECORDS FROM INPUT FILE

    Hello vikas,
    I need to develop a interface program FOR CREATING NEW CONDITION RECORDS FROM INPUT FILE.
    Is there ay function module to update or create the condtion records,
    if u have any example interface program to update conditions records please send me.
    regards
    ram.

    This must be your compiler output.
    Basically, it is telling you two things that are wrong - in syntax.
    1. On line number 11 of the file RationalCollection1.java, the compiler expects a type identifier - that would be the object or return type such as int, String, boolean, etc.
    The reason it is doing this is probably due to your not ending a previous statement - like the "expected ';'" error statement. Check your code, make sure that methods (brackets) are closed correctly and there are no open statements (i.e. missing the semi-colen at the end).
    2. On line number 33 of the file RationalCollection1.java, the compiler expected the closing bracket. Thus, you didn't put the bracket where the compiler wants it.
    It appears that you have skipped some lines of code. Those lines are the problem, post them - post lines 30-36 and 9-15 so we can see what is happening around those error lines.

  • How to find who has created the condition records

    hi all,
    in POF1 condition records were created.for material and plant.how to find who has created condition records for the material and plant.
    is there any way to find who has created please help me out.
    thanks
    sunny

    Hi,
    There are two ways of finding the who has created the ondition record.
    01. This is through the sales order-> Item details level-> condtion Tab----> Select the condition type and click on dispaly condition record below in the same creen. Then  Goto tab on the menu and select the overview of the condition record. After do so you will have the details of diffrenr tabs. In this you need to select the Administrative data for the person who had created the condition record.
    02. Goto T. Code VK13 and give your condition type for which you need to find the person created the record. Select the header details tab for the person who had created the record.
    Hope this is fine with you.
    Bye & Enjoy SAP.
    Koganti

  • Is there any FM/BAPI to create Device Information Record

    HI all,
    Is there any FM/BAPI to create Device Information Record.
    with regards,
    Sumanth.

    Hi,
    I want to install device info record. For this I have found FM "ISU_S_WORKLIST_INSTALL". But I am not able to use it properly. Could you please tell me how to use this FM.
    Regards,
    Vijay

  • FM or BAPI for creating purchase info records and purchase conditions

    Hi all,
    i need create purchase info records and purchase conditions from txt-file,
    What FM or BAPI i can used for this?
    Thanks and Regards,
    Andrei

    You can use trasaction SXDA_TOOLS.....
    object type BUS3003
    program type BINP
    program/method RM06IBI0
    but the fields must be sequentially written in the txt, with every space inclusive....

  • FM or BAPI to create new condition type / record for material - VK11

    Hi All,
        I need to copy condition records from one material to another material, to do that using the below FM. For the below values even its not raising any exception or creating pricing record. Could any one tell me am i missing any other parameters ?
    Please let me know.
    *& Report  Z_TEST292011
    REPORT  Z_TEST292011.
    data: ls_komg type KOMG,
          ls_komv type komv,
          lt_komv TYPE TABLE OF komv,
          lv_new_record.
    *ls_komg-kunnr = '0001000008'. " Cust number
    ls_komg-matnr = 'A0168L1600100006'. " Mat number
    ls_komg-VKORG = '3101'.
    ls_komg-vtweg = '10'.
    clear: Lt_komv,LS_KOMV.
    ls_komv-kappl = 'V '. " Application V = Sales
    ls_komv-kschl = 'ZR00'. " Condition type
    ls_komv-krech = 'B'. " calculation type; B -Fixed amount
    ls_komv-waers = 'USD'. " Currency
    ls_komv-kpein = '100'.
    ls_komv-kmein = 'EA'. " Unit of measurement
    ls_komv-kbetr = '121.50'. " new condition value
    append ls_komv to lt_komv.
    CALL FUNCTION 'RV_CONDITION_COPY'
      EXPORTING
        application                       = 'V'
        condition_table                   = '005'
        condition_type                    = 'ZR00'
    *    DATE_FROM                         = '20110629'
    *    DATE_TO                           = '99991231'
        ENQUEUE                           = 'X'
    *   I_KOMK                            = ' '
    *   I_KOMP                            = ' '
        key_fields                        = ls_komg
        MAINTAIN_MODE                     = 'A'
        NO_AUTHORITY_CHECK                = 'X'
        NO_FIELD_CHECK                    = 'X'
    *   SELECTION_DATE                    = '00000000'
        KEEP_OLD_RECORDS                  = 'X'
    *   MATERIAL_M                        =
    *   USED_BY_IDOC                      = ' '
    *   I_KONA                            =
        OVERLAP_CONFIRMED                 = 'X'
        NO_DB_UPDATE                      = ' '
    *   USED_BY_RETAIL                    = ' '
    IMPORTING
    *   E_KOMK                            =
    *   E_KOMP                            =
        NEW_RECORD                        = lv_new_record
    *   E_DATAB                           =
    *   E_DATBI                           =
    *   E_PRDAT                           =
      tables
        copy_records                      = lt_komv
    *   COPY_STAFFEL                      =
    *   COPY_RECS_IDOC                    =
    EXCEPTIONS
       ENQUEUE_ON_RECORD                 = 1
       INVALID_APPLICATION               = 2
       INVALID_CONDITION_NUMBER          = 3
       INVALID_CONDITION_TYPE            = 4
       NO_AUTHORITY_EKORG                = 5
       NO_AUTHORITY_KSCHL                = 6
       NO_AUTHORITY_VKORG                = 7
       NO_SELECTION                      = 8
       TABLE_NOT_VALID                   = 9
       NO_MATERIAL_FOR_SETTLEMENT        = 10
       NO_UNIT_FOR_PERIOD_COND           = 11
       NO_UNIT_REFERENCE_MAGNITUDE       = 12
       INVALID_CONDITION_TABLE           = 13
       OTHERS                            = 14
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    break jdonepud.
    call function 'RV_CONDITION_SAVE'.
    call function 'RV_CONDITION_RESET'.

    Hello ,
    why dont you try LSMW -RV14BTCI ?
    regards
    Prabhu

  • How to create the condition record by ABAP program

    Hi Friends,
    I want to create/change the condition record of PR00 by ABAP program. It seems that there have no such BAPI/standard function can help on this. Can any one of you point out a way to me?? Thanks in addvance.
    Joe GR.

    Joe,
      Check with below FM..
    BAPI_PRICES_CONDITIONS.
    Check this link:
    Re: Sample code for  BAPI_PRICES_CONDITIONS
    examples....
    http://www.4ap.de/abap/bapi_prices_conditions.php
    Two useful threads on Same topic
    Re: Sample code for  BAPI_PRICES_CONDITIONS
    Re: Problem with BAPI_PRICES_CONDITIONS
    BAPI_PRICES_CONDITIONS
    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.
    Don't forget to reward if useful....

  • BAPI to create customer master record

    Hi ,
    I was looking for the BAPI to create the customer master record in R/3. we are using the ERP 2005 system .
    I did find the BAPI but it will only creat the personal information of the customer .
    I was looking for a BAPI that will create the whole record of customer including the company code . sales area record .
    Hope someone knows abt this.
    I have to use this in a sync interface with siebel system
    Thanks
    Nikhil

    Hi Michal ,
    I had a loojk at this BAPi but this will only populate the customer personal data. we will have to make a refe to a existing cust to extract the company code data and the sales area data
    Thanks
    Nikhil

  • Looking for BAPI which can post condition records.

    Hi ,
    I am looking for a bapi which can post the condition records. I need to post Maximum Condition Base Value KONP-MXKBAS along with other fields. I found already one bapi BAPI_PRICES_CONDITIONS which has this field but if I execute
    the bapi with BAPI_TRANSACTION_COMMIT it is not posting any data at all. So could any one please help me out of this or if any other alternate BAPI* or any other solution is possible here. But one thing to mention here that LSMW,BDC is not possible to use.
    Thanks in advance.
    Best Regs
    Somnath

    Hi!
    In most common, standard BAPIs are working correctly.
    Here are a the following cases if they aren't:
    - standard fault, mostly has a correction note at OSS (very rare case)
    - the BAPI is not finishing succesfully. In this case, you always have to check the return table of the BAPI (BAPIRET2, or RETURN, etc...). In this table there is the error. Mostly it occurs due to incorrect customizing settings.
    Please check the return table of your BAPI, and you'll find out the problem.
    Regards
    Tamá

  • How to create STO Condition record for a condition Type ?

    I am doing config for STO.
    in MEK1 , it is asking for Vendor, but in my case I am doing STO by using delivery VL01 and receipt by MIGO.
    I want to know abt- How to create Condition Record for STO so that STO order will have Moving Average Price f Material.
    Sorry I m new to MM so pls help.

    Solved

  • New Custom field to be created in condition records

    Hi,
    I have a requirement where-in there is a need to create new custom field (30 chars) as there is no standard field in condition record screen which can be used because of lenght limitation.
    This new field needs to be populated from incoming inbound idoc (COND_A04).
    Kindly provide me necessary changes that needs to be made to achieve this.
    Thanks
    Rama

    Dear Rama,
    Add this field in below structure
    If field is for header than add in structure - KOMKAZ
    For for item KOMPAZ
    After add this new field in stcture, That field available in field catelog. Add this field in field catelog and than maintain this field in pricing table.
    Also mapp this new field value in below pricing exit.
    Program : MV45AFZZ
    User exit for header: USEREXIT_PRICING_PREPARE_TKOMK.
    User exit for item : USEREXIT_PRICING_PREPARE_ITEM
    Regards,
    Haresh

Maybe you are looking for

  • Printer Sharing with XP Machine

    I have Windows 7 RC, 64 bit loaded with an HP Deskjet 5150 Serises printer that I want to share with my XP machines. I've worked through all the other posts to get the file sharing working (same work groups, network discovery on, etc.) Now I went to

  • How to upload data information without ELM ?

    Hi All, If I want to upload address data information to use it for creating target group. What are the ways/sources to do this apart from ELM. Thank you in advance for the suggession. Priyanka

  • Installing windows with parallels

    Hey, I wond to install windows on my mac with parallels buth when I put the windows installation cd in my mac and start the installation progress, the installation cd disappears out of the finder. Can someone help me to resolve this please

  • Tables for routing (for work center)

    hi friends, I am doing report on routing but i did not get value for work center i got tables CRHD CRCA CRCO CRHH CRHS CRTX KAKO KAZY . i try to get result by using link with PLPO and PLKO. in TCode CA03 when i see the technical attributes it stors t

  • How to use Underline feature in Font Class

    I am making an applet to test the Bold, Italic and Underline feature of any Font but there is no such Font Constant to Underline the Text. Can you help me to get Underlined Text through Font class or any such alternative to achieve my goal? Thanks. A