2022 Dec 16 2:44 PM
Hi there,
I have a specific function module called remotely that creates an offer and in some cases the order that goes with it using the BAPI_SALESORDER_CRATEFROMDAT2 function module.
In a test case, I'm using a material that has a sub item set via CS03.
When I only create my offer via my FM and create the order via VA01, I have no problem.
When I create both via my FM, my sub item remains Open (problem with VBUP) and there is no line in VBFA.
Do you have any idea how to solve this problem?
Regards.
2022 Dec 16 10:19 PM
When you say VBFA is empty, it sounds like you are not passing the REF_DOC in ORDER_HEADER_IN and also using the X in the corresponding ORDER_HEADER_INX.
2022 Dec 19 9:20 AM
I expressed myself badly, I have the line of my material (my first item), but not that of my sub-item in VBFA.
REF_DOC is populated.
2022 Dec 19 9:24 AM
2022 Dec 22 8:26 AM
2022 Dec 22 12:56 PM
I haven't played with BAPI_SALESORDER_CRATEFROMDAT2 in context of offer documents - but I guess it is not enough to fill REF_DOC in ORDER_HEADER_IN only. This way you describe the reference for the header data only - not for item data. The system has still no information about references that should be applied for items.
I would try to fill also fields: REF_DOC, REF_DOC_IT, REF_DOC_CA - in BAPISDITM structure - parameter ORDER_ITEMS_IN (and corresponding 'X' fields in ORDER_ITEMS_INX of course).
This is how it works when you create a return order (with BAPI_CUSTOMERRETURN_CREATE / reference to an invoice for example) - so I think the logic will be the same in BAPI_SALESORDER_CRATEFROMDAT2 when creating with reference to an offer.
regards
2022 Dec 22 11:14 PM
BAPI and transaction VA01 should behave in the same way. If not, it can be because :
Can you show how do you fill parameters of the BAPI ?