Hi Jane
Great you're trying a BAPI for purchasing contracts! :)
Every system is a bit different. Yours looked good to me except for one thing

Line 34 maps item number in the ITEMX table as a hard coded value of "N". You want to map it to column N - the same column as the ITEM table has item number mapped to.
When I did that, I was able to run your script with a standard value contract and my vendor, purch org (which was hard coded) and materials.


Please give that a try, mapping your item number from the ITEMX table, and see if it works for you.
Best Regards,
Sigrid
------------------------------
Sigrid Kok
*Precisely Software Inc.
------------------------------
Original Message:
Sent: 02-20-2026 14:03
From: Jane Dobbs
Subject: BAPI_CONTRACT_CREATE issues
I am getting this errors:
" No instance of object type PurchasingContract has been created. External reference: # 1 Start of validity period is in the past Error transferring ExtensionIn data for enhancement CI_EKPODB Please enter material number or account assignment category Unit of measure not defined for language EN Enter Order Unit Please check the price "
I have put some sample data in. for the line items not all information is needed for different scenarios.
Thanks for your assistance.
Jane
------------------------------
Jane Dobbs
Specialist Supply Chain
Canadian Pacific Railway
Calgary AB
------------------------------