Okay, here goes:
I've taken your "P4210 Enter SO w 3 lines" log as an example.
Using a text editor (Notepad will do in most cases), do the following:
1. Find the F4942 Insert statements in your log, by searching for "INSERT INTO:" until you hit F4942 (I left out the table name in my search on purpose; That way I will get an idea in what order records in the involved tables are created).
In this case, there are three F4942 Insert statements. Go to the 1st one of them:
INSERT INTO JDE_DEVELOPMENT.TESTDTA.F4942 VALUES (...)
(Note that when you searched for it, scrolling down the log, you saw that 3xF4211 and 1xF4201 were inserted before F4942 are inserted)
2. Now from this point, scroll UPWARDS until the first "*** Start dumping data structure for business function (...)" you come across. This can either be *entering* a function, or *exiting* a function. You will see a BSFN-level associated with it. In this case, it is the *exiting* of a function (DecimalsTriggerGetbyCOCRCD in this case), and it has "(BSFNLevel = 4)" associated to it. Now what this tells you, is that the F4942.Insert is also taking place at Level 4 (The calling applicaton -P4210 in this case- being Level 0). Had the first "*** Start dumping data structure for business function (...)" you come across been *entering* a function at Level 4, then the F4942.Insert would have been taking place at level 5. Are you still with me? Ok, let's continue then...
3. So we have established our F4942.Insert is taking place at Level 4. Now let's work our way back (or rather: up) until Level 0 (which in this case is P4210). That will give us the bsfn-flow. We do this as follows:
- From the point where you found "*** Start dumping data structure for business function DecimalsTriggerGetbyCOCRCD (...)", bring up the Find-thingy and copy&paste the "(BSFNLevel = 4)" part into the "Find what:" field;
- In the "Find what:" field, change the "4" into a "3", and search UPWARDS once. In this case, it will lead to "Calling Business function WriteShipmentDetail from UNKNOWN for ADCHIMIREL. Application Name [P4210], Version [ERCO0001] (BSFNLevel = 3)";
- In the "Find what:" field, change the "3" into a "2" and again search upwards once. In this case, it will lead to "Calling Business function F4215EndDoc from UNKNOWN for ADCHIMIREL. Application Name [P4210], Version [ERCO0001] (BSFNLevel = 2)";
- In the "Find what:" field, change the "2" into a "1" and again search upwards once. In this case, it will lead to EditSystemExistenceF99410. Now this is a bit tricky, because this is NOT the function that calls F4215EndDoc. I believe this has to do with asynch bsfn calls resulting in multiple parallel threads. This is were your basic knowledge of JDE bsfn-flows comes in handy: You probably know that F5215EndDoc is called from F4211FSEndDoc (And if you didn't, you will now
).
If you keep searching up, you will hit "Calling Business function F4211FSEndDoc from UNKNOWN for ADCHIMIREL. Application Name [P4210], Version [ERCO0001] (BSFNLevel = 1)" at one point. That's the one.
4. Congrats, you have found the bsfn-flow!
Which in this case is:
Lvl0
4210->
Lvl1:F4211FSEndDoc->
Lvl2:F4215EndDoc->
Lvl3:WriteShipmentDetail(N4900030)->
Lvl4:F4942.Insert.
Now, another important thing to notice in your case, is that the F4201 is written BEFORE F4942 is written. As you already saw in step 1, F4201 is inserted before F4942. In fact, F4215EndDoc (which eventually calls N4900030) is called AFTER F4201 is inserted. So based on all this, I concluded that you can put your logic in N4900030, and that you can safely do a Fetch from F4201 within this NER.
I hope all this is making some sense. It is imo a pretty simple yet powerful technique. It has helped me out many a time. This 'technique' also works for table updates, or any other interesting stuff you wanna analyse, e.g.: How (via which flow) is a certain error set, a certain function called, etc.
If you have any questions on this, just holler.
As an exercise, you can analyse your other log (P4210 Add 3rd line to SO) yourself. You'll find that the flow is pretty much the same (But without the F4201.Insert of course).