Hi,
I am posting a GR for a subcontracting PO. The movement for the parent is 101 and the component are 543 (out of vendor stock - stock type O).
I want to be able to change the value of the components as they post to value of the parent (field MSEG-DMBTR). Effectively, I want to control the valuation update before creating the accounting document.
I have tried the BADIS:
MB_DOCUMENT_UPDATE
MB_DOUCMENT_BADI
MB_MIGO_BADI
But I am not sure I am using them correctly.
Any advice is appreciated.
Thanks.
JP
Hi JP,
since you got no other suggestions, here comes my idea, which might complicate the whole stuff:
You thought about changes in booking GR, I think about changing PO. In pricing of PO you can influence value of subtotal B (KOMP-WAVWR).
You might a) add a requirement to prevent adding the costs or b) add a formula to correct the value of KOMP-WAVWR directly.
By this way you avoid differences between PO / GR / invoice... I don't know, if there might be a problem - but better make some changes at the beginning, not at the end.
Maybe an other field has to be changed in your case, but without having an example I can't help much further. There are some routines in RV61AFZB in addition to normal pricing-UE for communication-structure filling.
Somewhere here also price control (moving average / standard) is used - perhaps switching temporarily to standard with amount 0.00 is easier to handle.
Good luck!
Christian
Hi,
your right, condition approach can't work. Anyway, I misunderstood your requirement ('I want to be able to change value of component', I want to prevent the cost(s) of sub-item A ... being posted').
So you 'just' want to re-direct the costs from parent to somewhere else. (I can't imagine any other place as the parent, because that is the result of the production, but customers are very inventive in such tasks).
Sounds like (one of) the first two BADIs are correct place to do the changes.
It's not a smart solution, but perhaps more 'standard' way: create a correction booking.
To be able to create an additional document, you have to be outside of the GR booking.
To leave GR, create change pointers with FM CHANGE_POINTERS_CREATE_DIRECT (in MB_DOCUMENT_UPDATE)
and start a report with FM BP_EVENT_RAISE (this complicate way is needed to leave transaction without an (implicit) commit work). In the additional report you can make the correction booking. By this way you will have more documents in the system, but you won't get a mess with wrong bookings - separate documents should always be able to identify and changed if necessary.
Regards,
Christian
Hi JP,
if you like to CHANGE XMKPF and XMSEG in MB_DOCUMENT_UPDATE, then you should have a look at the ABAP-help on assign->dynamical assign->variant 4a.
With a pointer linking to the variables of the calling program of this BADI, you can make value changes - from process point of view that's as bad as a modification (but you don't need object keys with your coding inside the BADI).
Regards,
Christian
Add a comment