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

Similar Messages

  • 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

    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

  • BAPI por ME31K

    Hi
    Does somebody knows wich BAPI can i use for create contracts like ME31K,  i was searching but i see there are mentioned several BAPIS like  BAPI_CONTRACT_CREATE , BAPI_AGREEMENT_MAINTAIN , BAPI_PO_CREATE, etc.
    Even  BAPI_CONTRACT_CREATEFROMDATA  was mentioned but i know this one is for VA41 not for ME31K.
    Does some body can help me please.
    Regards
    Frank

    Thanks
    Because my SAP version i must use AGREEMENT bapi   instead CONTRACT because this last does not exists.
    I'm gonna try to make it work.
    Thanks a lot.
    Regards
    Frank

  • How to validate long text in me31k( contract creation)

    Hi,
       I want to validate the long text in creation of contract(T_code - ME31k). In creation it self i want to get the long text for validation. How to get the long text value. For eg. "Release order text'  i am giving the value as '10'. While saving the document in ME31k i need to get the long text. Please do the needful.
    Thanks
    Jag
    Moderator Messag: Do not expect the forums to do your work for you.
    Edited by: kishan P on Jan 19, 2011 4:33 PM

    Use Read_text function module.
    you need to pass
    ID
    LANGUAGE
    NAME
    OBJECT   to the function moduel
    To find the Text id name language and object these are the following steps. Example: FB02
    1. goto FB02, Enter Document number
    2. from menuselect Goto>Header-->header Text..... New window will be displayed 
    3. select the Header Text. here you can see all the text. 
    4. click on the TEXT (which you want to know the Text id) , then press log ICON (you can find in bottom right of the text window) it looks like a rolled paper. 
    5. in the Next window you will find Text Name. Text ID, Language. etc...
    Regards,
    Lalit Mohan Gupta.

  • 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

  • MM Contract(ME31K) Attachment with name of the attachment

    Hello Experts,
    I am trying to attach documents to the MM contract using the transaction ME31K with attachment document name but I unable to achieve this.
    In OAC0/OAC2 we can configure type of document.
    And attachment can be done using  create->Store business document and drag and drop.
    When I see the attachment list I could see only attachment list but I want to maintain the file name as well.
    Anyone worked on this scenario?
    Please help me.
    Regards,
    Vadamalai A

    Hello Abijith,
    Thanks for your reply.
    my create attachment is disabled, how to enable? is there any settings required. What is the difference between Create Attachment and Store Business document(which is enabled now but we couldnt see the file names from attachment list).
    Regards,
    Vadamalai A

  • BLAORD, Payment term details are not updated automatically in ME31K

    Hi,
    Thru FM IDOC_INPUT_BLAORD, am posting contracts (IDOC type: BLAORD03). I am only passing terms of payment through E1EDK01-ZTERM. I am assuming that relevant data for the payment term will be picked up from configuration. I am not passing these values through the idoc.
    ZBD1T     Cash (Prompt Payment) Discount Days
    ZBD2T     Cash (Prompt Payment) Discount Days
    ZBD3T     Cash (Prompt Payment) Discount Days
    ZBD1P     Cash Discount Percentage 1
    ZBD2P     Cash Discount Percentage 2
    But these fileds are populated with zeros (initial values) in ME31K, please suggest any note?
    Thanks.

    Hi Julie,
    Thanks for your reply..
    Here the issue is, the user using Baseline date for two specific purpose.
    1.Due day calculation-auditing purpose
    2.Agning report
    For due day calculation they recently enable the option "payment term from invoice in -OBA3".Due to active the function,system copy the payment term and baseline date from invoice to residual item.it means the residual item having baseline data as invoice date not posting date.
    But for aging report purpose it has to be update posting date.
    now user want to meet these both requirement .How can it possible .Please suggest.
    Thank you
    Regards
    Dharma

  • Add a new column in Agreement Items table control (ME31K/ME32K/ME33K)

    Hi guys,
    I have a big issue.
    How can I add a new column at Agreement Items table control (ME31K/ME32K/ME33K) level.
    Thanks a lot.

    I think i solved the problem . The single way to to that is to modify the SAP standard Screen.

  • Best practice to use contract(ME31K) in reference a PR

    Hi,
         I create a PR(me51n) with service (the commitment is on the PR), next I create a contract(me31k) in reference with the PR. In the contract I do some change, I subdivide the service in two lines. After with ME57 I assign the contract with the PR.
    When I want to create a PO (contract release ord), should I us the contract in reference or the PR. If I use the contract my commitment do not follow and if I use 50% for my PR the commitment is used at 100%.
    What is the best practice?
    Best regards

    Hi,
      If I use the entire PR it is true but if I use only 50% of it. The commitment of the PR disappears and the commitment of the PO is 50% of the PR. And I want to found a way to transfert only the % of the commiment used in the PO.
    Best regards

  • How to read header text in MM contract (ME31K/ME32K) before saving record?

    Hi All,
    In ME31K / ME32K (Contracts), before saving the contract I would like to check if the user has entered header text in the contract or not.
    I am using customer exit MM06E005.
    Can anybody help me with this?
    Thanks in advance.

    Try creating dummy text id which will be part of text determination procedure @ Customers sales text & document header text.
    else, maintain the SO10-text against this text ID. whenver user createds quotation this text will be defaulted irrespective of the cusotmer.
          then based on if user want to modify the text they have to enter manually in this text id. print this text in header.
    Regards,
    Reazuddin MD

  • ME31k/ME32K  User Exit

    Hi ,
    In ME31k/ME32k  Program : SAPMM06E and screen 220
    based on the material ,the storage location is automatically populated .
    I want to make storage location as blank for new(ME31K) and existing contract (ME32k).
    Please let me regarding the same.
    Thanks
    A Raj

    Hi,
    Try this.
    goto se24, enter class cl_exithandler, goto method get_instance. Set breakpoint on the first if sy-subrc statement after the "get exit name". Run transaction when it is in debug window, check field exit_name for BADI.
    Check BADI to see if it allows you to change field storage location.
    Cheers.
    ...Reward if useful.

  • ME31K, ME32K, OUn & OPU

    Hi all,
    I'm looking fow where the OUN & OPU fields are being populated from when entering or changing a contract. We are creating/adding to contracts (me31k, me32k) and these units are defaulting from somewhere and I just can't find where. We used to be able to enter 'ea', but now the field automatically gets filled with 'PU" - Power Unit. Can someone please help me find where this is coming from?
    Many thanks!
    - Kathy

    Yes you can if the change log is activated in your system
    Go to the same setting in the SPRO and from header meny click on Utilities- change logs
    and give some date range, execute
    if the change log is active in your system than you will see who did it and when.

  • How to differentiate scaling information, condition or ratio info in me31k

    hi,
    I am working on me31k contract, i am giving some values and saving it. Initially i was using CDPOS table to find whether change or delete is done.
    Now i have requirement of how to check whether it is scaling information, condition information or ratio information.

    Thanks for your reply
    Is there a way to see what preset I chose when i first chose the sequence? As under 'sequence settings' i don't see this info.
    e.g
    DV PAL "Widescreen 48kHz"
    As i do not remember and fear it may ruin the HD video I am currently editing.
    Thanks

  • Price condition determination for purchasing contract(ME31K)

    Hi Experts,
         It is possible to apply  price condition determination in purchasng contract(ME31K)?  We had maintain the price condition for below keys: WBS/Material number and this condition record work well in purchase order. But I hope that this condition record is applied in pruchasing contract when we create contract by ME31K. Plz kindly give me a suggestion.
    So I want to check the condition dtermination is whether fullfil my requirement. If we can not use the price condition determination to get the net price, then we only go for user-exit to get it.
    Thank you very much in advance.

    >
    Gangrong Chen wrote:
    > Hi Experts,
    >  
    >      It is possible to apply  price condition determination in purchasng contract(ME31K)?  We had maintain the price condition for below keys: WBS/Material number and this condition record work well in purchase order. But I hope that this condition record is applied in pruchasing contract when we create contract by ME31K. Plz kindly give me a suggestion.
    >
    > So I want to check the condition dtermination is whether fullfil my requirement. If we can not use the price condition determination to get the net price, then we only go for user-exit to get it.
    >
    > Thank you very much in advance.
    Why not, in me31k, click on condition button on toolbar for item conditions and for header conditions, click on menu bar path HEADER>CONDITIONS and maintain your conditions accordingly.

Maybe you are looking for

  • "Read From Binary File" function Help ambiguity

    I must be getting tired, but for some reason a doubt crept in my mind as I was designing a new piece of code this morning: "is the "Read From Binary File" using the last file position or is it starting from the beginning of the file?" "That's a stupi

  • Installing over Ubuntu on MacBook Air 6,1

    I have a dual-booted MacBook Air 6,1 (early 2013). Currently it's running Mac OS and Ubuntu. Ubuntu was mostly a test as this is the first Mac I've owned since OS 8, and I wanted to feel out the hardware for compatibility issues. Now I'm looking into

  • I need the printer icon on the status bar

    My printer  does not show on the status bar

  • Formatting is off when opening Word docs in Pages and vice versa

    I recently decided to switch from Windows to Mac and bought a MacBook. I used to use Word on my Windows computer and now when I open .doc or .docx files in Pages, the formatting is off, i.e. bullets, tabs, spacing, etc. This formatting problem also h

  • How many SLD's require for 2 solman system requirements?

    Scenario1: One solman system for entire landscape->One SLD is required. Is this SLD should be a seperate system or can be within solman? Scenario2: One solman system for DEV/QAS and other solman system for PRD. How many SLDs are required? Can we mana