Calling F4311 Edit Line multiple times in a loop


Legendary Poster
Hi folks,

Can someone help me with something I maybe doing wrong in the code below please?

Basically I save records off to a workfile, F554111P. then I read through that work file and write a PO line for however many I encounter.

What's happening is the first line is working fine but then that's it. 2 3 4 etc don't work and there is no clear error in the log. So I am at a loss.

I am incrementing the LNID. So I've no idea

Code is attached as it's too big to paste




  • R554111CM VEND break.txt
    14.1 KB · Views: 19


Legendary Poster
Hi John,

The debug log should provide some insight into this, but you may want to try not passing the line number to edit line. I checked a similar process we do and we are letting it assign the number. Just a stab. Post the debug, if you want.



Legendary Poster
Hi Craig,

Thanks for this. That's odd if that works :) I'll try Monday.

But how does the cache know it needs to update/create a new PO line if you don't feed in the LNID?

I'm having trouble uploading the log, sorry.
Discover how to build no-code data integrations and business process automations.


Legendary Poster
I commented out the LNID and it's created the first line at 1.000 but not created anymore.

I'll check the logs now and I can see I am having errors when checking F43090. So I am hoping it was that all along :)
Last edited:


Legendary Poster
Have you verified if the variable cWrittenToWorkFile_EV01 is being set to 1 for calls after line 1.000? It looks like you are relying on this being set from the call to F4311EditLine. It might be worth a look to verify that this is working as expected.


Legendary Poster
I did thanks.

It's a variable fed both ways. First call its 0 and then the value passed back is used on lines 2 & 3 etc

I think it's this F43090 issue as the line that did work didn't have this error and the F4311EditLine log for that call is far greater
Last edited:


Legendary Poster
Hi again,

If anyone has any code of them using F4311 Edit Line in a loop, can they kindly please post it up here?

I've fixed what I thought was the Supplier Item setup issues but I still get the same error. It maybe something else when I start debugging. but that won't be for a few days.

So I'm hoping someone else has done this and I can check the code against mine.




Legendary Poster
I've got this to work now.
All I've done is add TRDJ and Promised date etc. I added data into F4311Z1 etc and ran r4311Z1I with logging on.
Looked at what it feeds in and copied it.

Works like a charm


hi John,

So you used EDI finally, and discarded the MBF method? Just need to know as i am in similar requirement

I have a requirement of updating/Amending existing Purchase order in JDE

The PO order header and detail lines information will come from a third party system (BP net) through a Flat file

I need to create a report witch will read this Flat file and will modify - Qty, date, delivery instruction etc on the existing JDE Purchase order

In my knowledge (verified with oracle also) - there is no such existing batch application to attain this requirement. (only available program is Interactive application- P4310) (Even EDI will only work for creating new PO, not Updating existing one)

can you advise me in this, Can i use the way you attched, modifying the action code


Active Member

No what I'm saying is I looked at another UBE that reads data in a loop and uses the same BSFNs.
I added data into F4311Z1 etc and ran R4311Z1I with logging on, then just copied the calls the base E1 UBE used.

Look at what R4311Z1I does and you'll be ok :)

But you may want to run that UBE to change an existing PO, not create one