Issue:
You cannot create multiple validity periods for the condition in Schedule Agreement (SA) / contract by BAPI_SAG_CREATE / BAPI_CONTRACT_CREATE.
Steps:
- Run T-code SE37 and input Function Module(FM) BAPI_SAG_CREATE/BAPI_CONTRACT_CREATE.
- Go to menu and select "Function Module" > 'Test' > 'Test sequences'.
- Input BAPI_SAG_CREATE/BAPI_CONTRACT_CREATE and BAPI_TRANSACTION_COMMIT, then press 'execute' button.
- Fill the import parameters including the following ones (with mutiple validity periods)
ITEM_COND_VALIDITY
ITEM_COND_VALIDITYX
ITEM_CONDITION
ITEM_CONDITIONX - Execute BAPI_SAG_CREATE/BAPI_CONTRACT_CREATE and BAPI_TRANSACTION_COMMIT, check the SA/contract generated.
- Run T-code ME33L/ME33K to display the SA/contract created in step 5.
- 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:
- Create the document with one validity period by BAPI_SAG_CREATE/BAPI_CONTRACT_CREATE.
- 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