Page tree
Skip to end of metadata
Go to start of metadata

Issue:

You cannot create multiple validity periods for the condition in Schedule Agreement (SA) / contract by BAPI_SAG_CREATE / BAPI_CONTRACT_CREATE.

Steps:

  1. Run T-code SE37 and input Function Module(FM) BAPI_SAG_CREATE/BAPI_CONTRACT_CREATE.
  2. Go to menu and select "Function Module" > 'Test' > 'Test sequences'.
  3. Input BAPI_SAG_CREATE/BAPI_CONTRACT_CREATE and BAPI_TRANSACTION_COMMIT, then press 'execute' button.
  4. Fill the import parameters including the following ones (with mutiple validity periods)           
                  ITEM_COND_VALIDITY
                  ITEM_COND_VALIDITYX
                  ITEM_CONDITION
                  ITEM_CONDITIONX
  5. Execute BAPI_SAG_CREATE/BAPI_CONTRACT_CREATE and BAPI_TRANSACTION_COMMIT, check the SA/contract generated. 
  6. Run T-code ME33L/ME33K to display the SA/contract created in step 5.
  7. Go to condition screen, you will see the mutiple validity periods which filled in step 4 are not reflected.   

Solution:

This is the standard system behaviour. BAPI works like on-line transactions, it is not possible to create more than one validity periods at the same time.

If you try in T-code ME31K/ME31L, you will find you can only add one validity at one time. After saving, you can enter the others in T-code ME32K/ME32L. So the solution has two steps as well:

  1. Create the document with one validity period by BAPI_SAG_CREATE/BAPI_CONTRACT_CREATE.
  2. Change the SA/contract (adding other validity periods) by BAPI_SAG_CHANGE/BAPI_CONTRACT_CHANGE.

Related notes / content:

1883789 BAPI_SAG_CREATE/BAPI_CONTRACT_CREATE : Cannot create multiple validity periods for condition