BAPI_AGREEMENT_MAINTAIN

Hi Experts,
I have a requirement to create contracts (ME31k) in background. For this purpose I am using BAPI_AGREEMENT_MAINTAIN. However I am not able to successfully create contracts in background using this BAPI. This bapi contains BDC recording for ME31K and has recoding for a particular field
EKPO-APOMS. But this field does not exist anywhere while we are creating contracts directly through ME31K. This field is present in Additional Data of Items (materials) screen while using ME31L transaction.
Any help regarding this matter will be highly appreciated and rewarded.
Thanks and Regards,
Arun.

hi Jyoti,
Any help regarding this matter will be highly appreciated and *rewarded*.
not supposed to write this
you can try  BAPI_CUSTSCHEDULAGREE_CONFDELV and BAPI_SALES_DEL_SCHEDULE_CREATE
hope this helps
regards
Aakash Banga
Edited by: aakash banga on Feb 2, 2009 5:26 PM
Edited by: aakash banga on Feb 2, 2009 5:26 PM

Similar Messages

  • SA not updated with BAPI_AGREEMENT_MAINTAIN

    Hello all,
    i tried to update one of the field in ekpo for schedule agreement using BAPI_AGREEMENT_MAINTAIN, although with the message "the Schedule agreement is changed" but the SA haven't change yet. Anyone can help?
    Below is my coding:
    data: PO_NUMBER like BAPIMEPOHEADER-PO_NUMBER.
    data: PO_HEADER like BAPIMEPOHEADER.
    data: PO_ITEM like BAPIMEPOITEM occurs 0 with header line.
    data: PO_ITEMX like BAPIMEPOITEMX occurs 0 with header line.
    data: RETURN like BAPIRET2 occurs 0 with header line.
    *data: PO_NUMBER like BAPIMEPOHEADER-PO_NUMBER.
    data: IM_AGREEMENT_HEADER like BAPIOAHEAD occurs 0 with header line.
    data: IM_AGREEMENT_HEADER_X like BAPIOAHEAX occurs 0 with header line.
    data: IM_AGREEMENT_ITEMS like BAPIOAITEM occurs 0 with header line.
    data: IM_AGREEMENT_ITEMS_X like BAPIOAITEX occurs 0 with header line.
    SELECT *
    FROM ekko
    WHERE ebeln = '0088011092'.
    endselect.
    IM_AGREEMENT_HEADER-AGMT_NO = ekko-ebeln.
    IM_AGREEMENT_HEADER-LANGU = ekko-SPRAS. "Language
    IM_AGREEMENT_HEADER-VAT_CNTRY = ekko-STCEG_L. "country id code
    IM_AGREEMENT_HEADER-CURRENCY = ekko-WAERS. "currency
    IM_AGREEMENT_HEADER-DOC_CAT = ekko-bstyp. "Pur doc categary
    IM_AGREEMENT_HEADER-DOC_TYPE = ekko-bsart. "Pur doc type
    Append IM_AGREEMENT_HEADER.
    IM_AGREEMENT_HEADER_X-AGMT_NO = 'X'.
    Append IM_AGREEMENT_HEADER_X.
    IM_AGREEMENT_ITEMS-AGRMT_ITEM = '00001'.
    IM_AGREEMENT_ITEMS-TRACKINGNO = 'Testing'.
    Append IM_AGREEMENT_ITEMS.
    IM_AGREEMENT_ITEMS_X-AGRMT_ITEM = '00001'.
    IM_AGREEMENT_ITEMS_X-TRACKINGNO = 'X'.
    append IM_AGREEMENT_ITEMS_X.
    CALL FUNCTION 'BAPI_AGREEMENT_MAINTAIN'
    EXPORTING
    IM_AGREEMENT_HEADER = IM_AGREEMENT_HEADER
    TABLES
    EXT_RETURN = RETURN
    IMT_AGREEMENT_ITEMS = IM_AGREEMENT_ITEMS
    IMT_AGREEMENT_ITEMS_X = IM_AGREEMENT_ITEMS_X.
    commit work and wait.
    LOOP AT RETURN.
    WRITE: /0(10) RETURN-TYPE,
    10(10) RETURN-ID,
    20(10) RETURN-NUMBER,
    30(40) RETURN-MESSAGE.
    ENDLOOP.

    Hi,
    I had the same problem.
    See coding in LMEAGF09 form process_screen_0211.
    Only some fields like the short text are updated - this is weak programming by SAP!!!
    e.g:
    short text
        IF NOT ims_ekpox-txz01 IS INITIAL.
          PERFORM bdc_field
            TABLES cht_bdcdata
            USING  'EKPO-TXZ01'
                   ims_ekpo-txz01.
        ENDIF.
    Regards,
    Andy

  • How to create Item Services (ME31K) with  BAPI_AGREEMENT_MAINTAIN

    Hi
    I need to create Contracts (Agreements) like ME31K with some BAPI . I know i can use BAPI_AGREEMENT_MAINTAIN .
    But , also to cteate the Items ; i need to create Services for each Item .
    (Actually i need even to create several conditions , that is Differents Prices for Date ranges, for each Service.)
    But i just see the BAPI  table IMT_AGREEMENT_ITEMS  for create the Agreement Items , but there is not any table for create the Services for each Item.
    Does somebody knows if It is possible to create the Services for each Item with this or other BAPI ?     Please help.
    NOTE. I can not use BAPI_CONTRACT_CREATE because my SAP version.
    Regards
    Frank

    Do it by ABAP programming.
    Regards

  • BAPI_AGREEMENT_MAINTAIN Doesn't UPDATE

    Hi all
    I have a problem with . I am trying modify WEBAZ field for transaction ME32L but although the bapi is executed successfully y  and  return the message 'Scheduling agreement 5500003590 changed' it  is not modified.
    Some body could help me or have any idea about it? Please
    my code is:
    LOOP AT t_ekpo INTO  wa_ekpo.
          READ TABLE t_ekko INTO wa_ekko WITH KEY ebeln = wa_ekpo-ebeln
                                              BINARY SEARCH.
          t_head-agmt_no   =  wa_ekpo-ebeln.
          t_head-doc_cat   =  wa_ekko-bstyp.
          t_head-comp_code =  wa_ekko-bukrs.
          t_head-doc_type  =  wa_ekko-bsart.
          t_head-currency  =  wa_ekko-waers.
          APPEND t_head.
          t_heax-agmt_no   =  c_x.
          t_heax-doc_cat   =  c_x.
          t_heax-comp_code =  c_x.
          t_heax-doc_type  =  c_x.
          t_heax-currency  =  c_x.
          APPEND  t_heax.
          READ TABLE t_out_aux INTO wa_outtab WITH KEY lifnr = wa_ekko-lifnr
                                                       werks = wa_ekpo-werks
                                                       BINARY SEARCH.
          t_item-agrmt_item = wa_ekpo-ebelp.
          t_item-gr_pr_time = wa_outtab-webaz_n.
          APPEND t_item.
          t_itex-agrmt_item = wa_ekpo-ebelp.
          t_itex-gr_pr_time = c_x.
          APPEND t_itex.
          AT END OF ebeln.
            CALL FUNCTION 'BAPI_AGREEMENT_MAINTAIN'
              EXPORTING
                im_agreement_header   = t_head
                im_agreement_header_x = t_heax
                im_all_items_passed   = c_x
              TABLES
                ext_return            = t_return
                imt_agreement_items   = t_item
                imt_agreement_items_x = t_itex.
            CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
            APPEND LINES OF t_return TO t_message.
            REFRESH:   t_head, t_heax, t_item[], t_itex[],  t_return.
          ENDAT.
    Limpia variables
          CLEAR: wa_ekpo, wa_ekpo_aux,  t_head, t_heax, t_item, t_itex, wa_outtab..
        ENDLOOP.

    Hi Marisol,
    Have you got the solution for your problem , if so, Please provide your inputs as i am also facing same issue exactly what you are getting.
    I tried commenting  "  im_all_items_passed" parameter and also i am passing workarea component values to "im_agreement_header" and  "im_agreement_header_x" parameters of below FM.
    But it is not updated GR Processing time at Agreement level (i.e. in ME32K) as i am getting "Contract Has changed" Sucessage message alone in T_ERROR[] parameter of below BAPI  FM.
      CALL FUNCTION 'BAPI_AGREEMENT_MAINTAIN'
                EXPORTING
                  im_agreement_header   = wa_header
                  im_agreement_header_x = wa_header_x
                 im_all_items_passed   = c_x
                 TABLES
                  ext_return            = t_error
                  imt_agreement_items   = t_bapiitem
                  imt_agreement_items_x = t_bapiitem_x.
    Waiting for the solution , Please help me out As soon as possible.
    Thanks,
    Satish

  • BAPI_AGREEMENT_MAINTAIN -Change an item in an agreement

    Hello,
    I found a bapi for changing agreements (BAPI_AGREEMENT_MAINTAIN), but I don't know how to use it.
    For example, if I want to change the SHORT_TEXT in the item data. Does anyone know which structures and fields  I exactly need to fill to change an item in an agreement?
    I found an earlier post on this BAPI, but that person  chose to edit via batch input.
    Thanks in advance.
    Minda

    I have the same problem, Can you send me how to use it.
    thank

  • ME31K :  BAPI_AGREEMENT_MAINTAIN

    Hi
    i am trying to create the contract using BAPI  :  BAPI_AGREEMENT_MAINTAIN .
    BUT i am getting an error : "Please enter material number or account assignment category"
    i am passing the following  parameters
      wa_contract_header-vendor = '300005' .                               
      wa_contract_header-doc_type =  'ZK' .                               
      wa_contract_header-creat_date =  sy-datum.                          
      wa_contract_header-purch_org = '1005' .                             
      wa_contract_header-pur_group = 'E60' .                              
      wa_contract_header-vper_start = sy-datum.               
      wa_contract_header-vper_end = l_date.                
      wa_contract_header-doc_cat = 'K'.
      wa_contract_header_x-vendor = cns_x.
      wa_contract_header_x-doc_type = cns_x.
      wa_contract_header_x-creat_date = cns_x.
      wa_contract_header_x-purch_org = cns_x.
      wa_contract_header_x-pur_group = cns_x.
      wa_contract_header_x-vper_start = cns_x.
      wa_contract_header_x-vper_end = cns_x.
      wa_contract_header_x-doc_cat = cns_x.
      wa_contract_detail-agrmt_item = '10'.
      wa_contract_detail-plant = 'CH00'.
      wa_contract_detail-stge_loc = '3000'.
      wa_contract_detail-matl_group   =   '701000FIN'.
        wa_contract_detail-material = '502233 T'.
        wa_contract_detail-ematerial = '502233 T'.
      wa_contract_detail-net_price = '10.00'.
      wa_contract_detail-target_qty = '100'.
      APPEND wa_contract_detail TO it_contract_detail.
      wa_contract_detail_x-agrmt_item = cns_x.
      wa_contract_detail_x-plant = cns_x.
      wa_contract_detail_x-stge_loc = cns_x.
      wa_contract_detail_x-matl_group = cns_x.
        wa_contract_detail_x-material = cns_x.
       wa_contract_detail-ematerial = cns_x.
      wa_contract_detail_x-net_price = cns_x.
      wa_contract_detail_x-target_qty = cns_x.
      APPEND wa_contract_detail_x TO it_contract_detail_x.
      CALL FUNCTION 'BAPI_AGREEMENT_MAINTAIN'
        EXPORTING
          im_agreement_header   = wa_contract_header
          im_agreement_header_x = wa_contract_header_x
        TABLES
          ext_return            = it_return
          imt_agreement_items   = it_contract_detail
          imt_agreement_items_x = it_contract_detail_x.
    Any help will be useful
    Regards
    Rahul

    Hi
    i am trying to create the contract using BAPI : BAPI_AGREEMENT_MAINTAIN .
    BUT i am getting an error : "Please enter material number or account assignment category"
    i am passing the following parameters
    wa_contract_header-vendor = '300005' .
    wa_contract_header-doc_type = 'ZK' .
    wa_contract_header-creat_date = sy-datum.
    wa_contract_header-purch_org = '1005' .
    wa_contract_header-pur_group = 'E60' .
    wa_contract_header-vper_start = sy-datum.
    wa_contract_header-vper_end = l_date.
    wa_contract_header-doc_cat = 'K'.
    wa_contract_header_x-vendor = cns_x.
    wa_contract_header_x-doc_type = cns_x.
    wa_contract_header_x-creat_date = cns_x.
    wa_contract_header_x-purch_org = cns_x.
    wa_contract_header_x-pur_group = cns_x.
    wa_contract_header_x-vper_start = cns_x.
    wa_contract_header_x-vper_end = cns_x.
    wa_contract_header_x-doc_cat = cns_x.
    wa_contract_detail-agrmt_item = '10'.
    wa_contract_detail-plant = 'CH00'.
    wa_contract_detail-stge_loc = '3000'.
    wa_contract_detail-matl_group = '701000FIN'.
    wa_contract_detail-material = '502233 T'.
    wa_contract_detail-net_price = '10.00'.
    wa_contract_detail-target_qty = '100'.
    APPEND wa_contract_detail TO it_contract_detail.
    wa_contract_detail_x-agrmt_item = cns_x.
    wa_contract_detail_x-plant = cns_x.
    wa_contract_detail_x-stge_loc = cns_x.
    wa_contract_detail_x-matl_group = cns_x.
    wa_contract_detail_x-material = cns_x.
    wa_contract_detail_x-net_price = cns_x.
    wa_contract_detail_x-target_qty = cns_x.
    APPEND wa_contract_detail_x TO it_contract_detail_x.
    CALL FUNCTION 'BAPI_AGREEMENT_MAINTAIN'
    EXPORTING
    im_agreement_header = wa_contract_header
    im_agreement_header_x = wa_contract_header_x
    TABLES
    ext_return = it_return
    imt_agreement_items = it_contract_detail
    imt_agreement_items_x = it_contract_detail_x.
    Any help will be useful
    Regards
    Rahul

  • BAPI/FM to change scheduling agreement's delivery status.

    Hi All,
    I have to check  "Delivery completed" indicator of scheduling agreement.
    I tried using BAPI_PO_CHANGE but it returns the message below:
    "Not possible to process a scheduling agreement using this function"
    Is there any other BAPI or FM to change the agreement.
    I do not want to use batch-input. But if there is no other option I will.
    Note:  I am using system 4.6C
    Thanks
    Mandeep

    hii
    try using BAPI_AGREEMENT_MAINTAIN FM.
    one another FM BAPI_SCHEDULE_MAINTAIN is used to create or change scheduling agreement delivery schedule lines.i hope any FM can help you.
    regards
    twinkal

  • Change Scheduling Agreement and Info Record using Bapi

    Hi Experts,
    Can anybody say how to change the Scheduling agreement and Info Record using Bapi.
    I use BAPI_AGREEMENT_MAINTAIN to change Scheduling Agreement .
    But it does not changing Scheduling lines.

    Hi,
    Please find the below link check the setting are correct or not
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a02cb00a-bfb4-2c10-98aa-e33e7f64ba28?quicklink=index&overridelayout=true
    Reagrds,
    Pramod

  • Creating Scheduling Agreement using Bapi

    Hi Gurus,
           I want to Create Scheduling agreement , InfoRecords using Bapi.
    I use BAPI_AGREEMENT_MAINTAIN .But it's not creating agreement.It throwing error message .
    Useful Answers will be rewarded with Points.

    Hi,
        Error Messages are Not Possible to determine a consumption account and No batch input data for screen.
    Could you suggest what all the Input field  I need to pass it .
    Thanks for Your help

  • BAPI for creating scheduling agreement with reference to Contract agreement

    Hi All ,
    Can anyone please suggest if there is any BAPI for creating scheduling agreement with reference to the contract agreement number.
    Thanks for your help.
    Vadivukkarasi

    Hi,
       Check this BAPI <b>BAPI_AGREEMENT_MAINTAIN.</b>
    check these
    BAPI_CUSTSCHEDULAGREE_CONFDELV Customer Sched. Agreement: Confirmation of Delivery; Document Flow Upd
    BAPI_SALES_DEL_SCHEDULE_CREATE BAPI for creation of releases in scheduling agreements
    Regards

  • BAPI for Scheduling Agreement

    any bapi for updating scheduling agreement ME38 txn
    i have checked bapi BAPI_AGREEMENT_MAINTAIN
    but how to maintatin schedulines over there

    first see the documentations.
    Regards
    Peram

  • Bapi for scheduling agreements!

    Hi can any one help me in changing the rate KBETR in ME32L transaction.
    Actually I cant find any parameters related to rate in BAPI_Agreement_maintain.
    If not, can some one suggest me the correct BAPI in changing it.
    Thank you.
    Shekar.

    Sorry, unfortunately that wasn't helping me.
    Actually I was looking for some thing where in I can populate the field KBETR from KNOP table i.e rate.
    If you can help me in finding this, that would be really helpful.
    Thank you,
    Shekar.

  • Copy service line items to new line items in the same contract (ME32K)?

    Hello friends,
    Requirement: There are many contracts (account assignment K) has service line items  (type 9). I need to copy a contract line item along with its service line items (1 or more) into a new line item in the same contract. I tried bapi_po_change but it says Contracts can't be processed with it, as only in this bapi we have a structure for ESLL services. BAPI_CONTRACT_CHANGE or create don't have structure for ESLL..how to achieve this through a bapi or a fm?
    So, in what way I could accomplish this? I came across some threads, which was helpful, but is not solving the purpose
    Any guidance here would be of great help.
    Thanks in advance.
    Mayank

    Use BAPI_AGREEMENT_MAINTAIN
    This BAPI can be used to create new service items in the contract but won't change existing lines. You can query the contract lines that you want to copy and later call the BAPI to recreate them

  • Update purchasing group in scheduling agreements

    Hi gurus,
    I'm trying to update purchasing group field in scheduling agreements, which are time-independent (EKKO-STAKO = ' ').
    In my environment, I'm not authorized to use CALL TRANSACTION statement.
    If possible, I'd need a way that works both in 4.6c and 6.0 versions.
    I have tried several options, but none works:
    -BAPI_SAG_CHANGE: "Scheduling agreements with time-independent conditions are not supported" (OSS note 1046794) (Also, this is not available in 4.6c)
    -BAPI_SCHEDULE_MAINTAIN: "Scheduling agreements with time-independent conditions are not supported" (OSS note 1046794) (Also, this is not available in 4.6c)
    -BAPI_AGREEMENT_MAINTAIN: Does not have the possibility to change field 'purchasing group'. (Moreover, it internally performs a CALL TRANSACTION).
    -ME_UPDATE_AGREEMENT_PO: I've been not able to change field 'purchasing group'.
    I'd be grateful about any hint. Thanks in advance!

    In case it is useful for anyone else, I have solved the problem using:
    CALL FUNCTION 'ME_UPDATE_DOCUMENT'
    Thanks anyway!

  • How to Change Scheduling Agreement Schedule line data thru BAPI ??

    Hii
           I want to change the shedule line data for a scheduling agreement .
    I used BAPI_PO_CHANGE but as this BAPI is used for PO only this gives a
    Error Message for Scheduling agreement .
    Please suggest me BAPI or FM to update the Scheduling agreement Schedule line.
    Regards
    Ajitabh Pradhhan

    as BAPI_AGREEMENT_MAINTAIN is not available in 4.6c
    Please help me out on hwo to maintain Scheduling Agreements .
    Regards
    Gaurav

Maybe you are looking for

  • IPad can no longer find my printer. Was working for two years. Laptop works fine

    I have tried turning everything off and then on again, that used to work.  Now I just get the message no airprint printer found. All software is up to date.  iOS 5.1.1 Hp printer is an AirPrint printer. It is up to date and was working fine.  Any sug

  • HP Pavilion dv6000 DVD drive issues

     I've had this issue for a while now and I've been able to get around it but it's really bugging me.  My laptop was unfortunately wedged under a heavy box while moving.  Everything else about the laptop runs fine, it's just the E: drive that refuses

  • Illustrator no longer opens files or saves changes w/ Mac

    Since I downloaded a new Security Update (Snow Leapord 10.6.8) I can no longer open new files in Illustrator.  Also when I open old files they will no longer save to PDF.  Anybody else see this issue? thanks

  • Is airdrop available for iphone 4s upgraded to ios7

    Just upgraded my phone to iOS7 and cant see airdrop in it. Its iPhone 4s 16Gb phone... Is it available for 4s users?

  • IPhoto is suddenly not responding

    Hi, I'm using OS X version 10.7.5 and iPhoto. It will open and show the most recent upload, but it just keeps loading and loading. I've shut down and restarted several times, with no success.