3 weeks ago - last edited 3 weeks ago
Hello,
We recently upgraded our SAP system from a very old version (SAP_APPL 604) to SAP_APPL 618 SP 23.
We’re facing an issue where several programs that use BAPI_CONTRACT_CHANGE to modify contracts have stopped working properly when adding new items.
All the new items created with this BAPI are now being created without any price. Before the upgrade, this process worked correctly.
This only happens with new items — if I modify an existing item and add a new condition record through the BAPI, then the price appears correctly.
In the ITEM and ITEMX tables, I’m filling the fields NET_PRICE, PRICE_UNIT, and PO_UNIT.
I’ve also tried filling PO_UNIT_ISO, ORDERPR_UN, and ORDERPR_UN_ISO.
I’ve tested both filling and leaving empty the ITEM_CONDITION and ITEM_COND_VALIDITY tables (and their corresponding _X tables).
But nothing works — the new items still appear without price.
RicardoRomero_1_0-1761561223789.png
When I click the "Condition Records" button, sometimes it doesn’t show anything or doesn’t go anywhere (in display mode), and other times it shows what looks like an empty condition record.
RicardoRomero_1_1-1761561244334.png
If I double-click it, a window appears asking for conversion factors, and then I get an error saying I need to specify the unit of measure — but I’m already providing it in the BAPI.
RicardoRomero_1_2-1761561260249.png
RicardoRomero_1_3-1761561266958.png
Interestingly, if I try to modify this same item later using the BAPI, and I fill the ITEM_CONDITION and ITEM_COND_VALIDITY tables (the same way I did when creating), then the price updates correctly.
I’m not sure if this is some issue related to the unit of measure (sometimes GETDETAIL returns "UNI" and other times "ST"...) or something else.
I’ve checked notes like 1102280 - BAPI_CONTRACT_CHANGE conditions are not created, but it doesn’t apply to our version.
Has anyone faced this issue or has any idea what could be going wrong?
Thanks in advance!
EDIT: I've tried creating new items with a different unit, EUR, and in this case is working fine. If there is a problem with the UNI unit, where can I see what is happening? I use tried to use CONVERSION_EXIT_CUNIT_INPUT to transform always de unit to internal format in the BAPI...
EDIT2: It also fails with other units
3 weeks ago
Solved. It seems that in all our programs, the SERIAL_ID field in the conditions table was being incremented by 1 from the last SERIAL_ID of that item. However, this ID is not unique at the item level, but rather at the entire document level.
So, when the item didn’t exist yet and several new ones were added, our programs were always setting this SERIAL_ID field to 1, which caused the items not to be created correctly.
The funny thing is that this had been working like that for years with our previous version — it only started failing after the upgrade.
3 weeks ago
3 weeks ago
Thanks for answer.
I've checked the notes.
I think note 3590688 doesn't apply in our scenario.
I have some doubts with the other note:
3076153 - BAPI_CONTRACT_CHANGE does not update KONP-VKKAL
I our project I think this field VKKAL is always empty.
3 weeks ago
Solved. It seems that in all our programs, the SERIAL_ID field in the conditions table was being incremented by 1 from the last SERIAL_ID of that item. However, this ID is not unique at the item level, but rather at the entire document level.
So, when the item didn’t exist yet and several new ones were added, our programs were always setting this SERIAL_ID field to 1, which caused the items not to be created correctly.
The funny thing is that this had been working like that for years with our previous version — it only started failing after the upgrade.