Allgemein

Bapi to Create Contract in Sap Sd

CALL FUNCTION `BAPI_CONTRACT_CREATEFROMDATA` EXPORT * SALESDOCUMENTIN = contract_header_in = ls_cont_hdr_in contract_header_inx = ls_cont_hdr_inx * SENDER = * BINARY_RELATIONSHIPTYPE = ` * INT_NUMBER_ASSIGNMENT = ` ` * BEHAVE_WHEN_ERROR = ` ` * LOGIC_SWITCH = * TESTRUN = * CONVERT = ` IMPORT SALESDOCUMENT = lv_salesdoc TABLES RETURN = lt_return contract_items_in = lt_item_in contract_items_inx = lt_item_inx contract_partners = lt_partner * CONTRACT_CONDITIONS_IN = * CONTRACT_CONDITIONS_INX = * CONTRACT_CFGS_REF = * CONTRACT_CFGS_INST = * CONTRACT_CFGS_PART_OF = * CONTRACT_CFGS_VALUE = * CONTRACT_CFGS_BLOB = * CONTRACT_CFGS_VK = * CONTRACT_CFGS_REFINST = * contract_data_in = * contract_data_inx = * CONTRACT_TEXT = * CONTRACT_KEYS = * EXTENSIONIN = * PARTNERADDRESSES = * EXTENSIONEX =. This article describes how to create a contract (quantity contract) with standard BAPI BAPI_CONTRACT_CREATEFROMDATA. I`m working on a conversion program that uses lsmw to create contracts from the flat file. Idocs are created with LSMW and contracts are created in SAP with the BAPI_CONTRACT_CREATE. This is the mistake I face in the requirement. I passed my internal table data to the bapi structure (BAPI_CONTRACT_CREATE). When I run it, it displays the error as follows:—— No instance of the Purchase Agreement object type has been created. External reference: #1. CALL FUNCTION `BAPI_CONTRACT_CREATEFROMDATA` EXPORT contract_header_in = ls_header contract_header_inx = ls_header_x IMPORTING salesdocument = lv_vbeln TABLES return = lt_message contract_items_in = pt_item contract_items_inx = pt_item_x contract_partners = lt_partner contract_conditions_in = pt_condition contract_conditions_inx = pt_condition_x.

Thank you for your answer, but I want to create an MM contract without reference to an SD document. I use BAPI_CONTRACT_CREATE to create contracts. Within the FM, I also say that I have also defined values in the PARTNER structure. I can`t create a contract with the fn mod BAPI_CONTRACTE_CREATE. I get the following errors. Here is the type of contract – AUART – KM, but we have selected the type of contract as CQ in Tx- VA41. Dear Sir or Madam, does anyone know if there is a BAPI to create a purchase contract with ME31k, it would be of great help. Depending on the requirement, I need to create a contract and assign the start date and end date to the contract. > > > Dear Sir or Madam, > Does anyone know if there is a BAPI to create a purchase contract> with ME31k it would be of great help.> > Thank you in advance.> > Thank you and greetings,> Mohammad Ali,> SAP technical consultant,> > > „We forget that forgiveness is greater than revenge. People make mistakes.> We have the right to make mistakes. But the actions we take with rage > will haunt us forever. When I create a mm contract, using bapi BAPI_CONTRACT_CREATE, I get a return error like this: I just tested the BAPI in IDES and I can see the target defined in VA43.

However, the target quantity is in the ZMENG field (UoM in ZIEME), not KWMENG.As as far as I can understand, KWMENG is filled when you create a contract-based order, although I would ask an SD consultant. All types of sales documents (contract types) defined in the TVAk table. Open the TVAK table in Tx- SE16n and look for the CQ sales document type. Tx-VA41 can also be used to create contracts online. Let`s try to create a contract with Tx-VA41 so that we can know the minimum information required to create a contract and then create a contract with BAPI. IF sy-subrc 0. ENDIF. WRITE lv_msg. END LOOP. WRITE `Contract:`, lv_salesdoc , `has been created`. OR. CALL FUNCTION `BAPI_TRANSACTION_ROLLBACK`.

From: USER_1598679 via sap-dev [mailto:sap-dev@Groups.ITtoolbox.com] Posted: June 23, 2009 08:07 AMTo: Rakgomo, Abe ASubject: RE:[sap-dev] Bapi to create a contract using ME31k I need to create a contract with sliding scale conditions included in the contract. As I learned that this cannot be done directly by BAPI_CONTRACT_CREATE, I first create the contract and then try to modify it with BAPI_CONTRACT_CHANGE. The purchasing organization is the header data of a contract, that is, only one purchasing organization has negotiated this contract and may have created this contract in SAP. For the contract type, the F4 help will display a list of contract types and we will create a quantity contract – QC. Select CQ. I use the BAPI BAPI_CONTRACT_CREATE to create a new contract, but I don`t know how to fill in the custom fields in the EKKO and EKPO table. I use BAPI_CONTRACT_CREATE to create a framework agreement transaction (me31k). I also use the commit fm. However, the agreement will not be concluded. The code is as follows. Is this data necessary for open access creation or do I need to pass additional fields? Open the table – VBAK in Tx – SE11 and open the contract. I run a BAPI: BAPI_CONTRACT_CREATE to create a contract in SE37.

I am able to create a contract manually with ME31K, I pass the same values to this BAPI, but I get the following error at runtime. In the contract, the hardware unit is provided as a PC. Now check the internal presentation. *Data declarationDATA: ls_item TYPE bapisditm, lt_item TYPE TABLE OF bapisditm, ls_item_x TYPE bapisditmx, lt_item_x TYPE TABLE OF bapisditmx, ls_condition1 TYPE bapicond, lt_condition1 TYPE TABLE OF bapicond, ls_condition1_x TYPE bapicondx, lt_condition1_x TYPE TABLE OF bapicondx, ls_condition2 TYPE BAPICOND, lt_condition2 TYPE TABLE OF bapicond, ls_condition2_x Bapicondx TYPE, lt_condition2_x BAPICONDX TYPE TABLE, bapicond type ls_condition3, lt_condition3 bapicond TYPE TABLE, bapicondx type ls_condition3_x, lt_condition3_x bapicondx TYPE TABLE. We use BAPI_CONTRACT_CREATE to create a contract, but according to SAP documentation, this BAPI does not support the creation of service elements in the case of a contract. Typically, you can create a sales order or contract document with BAPI_SALESORDER_CREATEFROMDAT2 for the sales order and BAPI_CONTRACT_CREATEFROMDATA. However, you cannot insert or modify the billing plan data directly with these BAPIs….