Custom functionality to P43250 - issue with duplicate PO lines


Hi List,

I`m currently working on a custom functionality for app P43250 in which users need to add a lot and lot information to in transit PO lines, even if said PO are not meant to be split into multiple orders. there is this shipment rule that only applies to our country in which the PO must have a lot when it reaches our borders.

So I checked the ER on P43250 to learn when does this information is passed and I found these 2 BSFN for lot creation and F43121 update which are:

F4108 Update Lot Master - X4108
F43121 Update Line Split in Receipt Routing - N4301430

Then I tried to add both BSNF to the OK button of the Receipt Routing Movement form of this app so when the user marks the GC OP with a 1 the script would create the needed lot information with X4108 and then pass the lot information along with the line order information to the N4301430 so the F43121 and F43092 files would be updated with the lot information that we just created.

The problem comes when the process is finished and the user is returned to the main form, and finds that the order didn't update the line in question, instead it created 2 more IN TRANSIT lines both with the same amount and the Lot we created but the original line passed to the next status and no new lot in the Lot/serial field.

please if someone can help me pin point the error or better yet, help me understand the functionality of this BSNF it would be much appreciated.

Thank you for your time,