Hi Moazzam
I am not 100% sure, but in the POITEMX table, you may need to also select "PO_ITEMX". We are not using material group, but I have learned with the BAPI's that the back end values are what you want for the input. If the "user" sees a material group of "CHEMBIO", the back end value may be "CHEMB". I have attached a copy of our version of this same script. Maybe it will give you some ideas for yours.
------------------------------
Vanessa Kutasi
Foundation Admin./Application Analyst II
Idexx Operations, Inc.
USA
------------------------------
Original Message:
Sent: 03-29-2023 08:58
From: Moazzam Mubarak
Subject: Help with BAPI_PO_CREATE1 script (time sensitive)
Hi community,
I need help with BAPI_PO_CREATE1 script. I created my first one for a material coded PO which works fine as the fields like Material Group and Delivery Date are defaulted while Account Assignment tab is not to be used. However, I need to create scripts for Short Text and Services PO's as well (we are at advanced stages of an S/4 migration project). In these 2 PO types mentioned later, I also need to upload additional fields like Delivery Date, Material Group, GL Account and Cost Center. When I add these fields, the upload fails and I get the error "Material group XXX not defined" while it is defined (tried various valid material groups and I get the same error every time). Looks like this is the first error where the upload stops and it would have the same problem with fields like delivery date and GL account/ cost center. I think I'm making a basic mistake but can't figure it out after spending so much time (my script is attached). Wondering if someone can share a script using the same BAPI where they have used one or more of these fields and/ or guide what needs to be corrected. Pressed with tight deadlines!
------------------------------
Moazzam Mubarak
De Beers Consolidated Mines
AB
------------------------------