Creating your own jde c routine is pretty easy once you understand the c BSFN involved.
However, more the jde pre-processor.
Inside, B4200311, it checks the contents of the F42UI12, and if values exists, it uses that value. This is done within routine I4200310_LoadDataFromF42UI12.
In this routine, is checks if the value is NULL, if Null it does not use the value (and will use it from the F4211 if changing an existing line).
The problem the std pre-processor has in P4210, is that the application ER will pass blanks (not nulls) to the parameters. This is entirely different from a NER call to the same BSFN. As in NER, when a parameter is not defined, the value is a null.
Sure, you can write your own c cache BSFN (or use a WF), and after the F4211ENDDoc call (in Async) call your own NER in Async. Your NER will run after the F4211EndDoc has completed. And by reading your own cache/wf, you can then update the F4211 record.
Problem with this, is the amount of extra update statements to the F4211.
What you can always do, is in the F4211Enddoc, read your own cache/wf, and override the F4211 value directly (i.e. only the one I/o statement to the F4211).
However, you can't use the above solution(s) when the values you want to store in the F4211 affects how the F4211 edit line will execute. When this happens, you need to store the values into the F42UI12.
To summarise what you need to do, to set values in the F42UI12:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
If you wrote your own c bsfn to update the F42UI12 cache, you would get the current cache record. Set your new field(s), then write/update the cache record. Of course, your c bsfn, should cater for updating the F42UI12 cache and the F42UI12 wf (depending on the use cache/wf flag).
Outside coding in C, you need to treat the cache like a full table I/O statement. I.e. Read all the values in, set the field(s) and then write/update the record.
The same principle exists for caches (when using them outside c).
The reason why c is different, is that when the cache is read, all the current values are loaded into a datastructure. To match this in ER code, you have to read all the current values into variables. And of course, for the first F42UI12 record, when it is written, all the fields contain null, except those fields you have set.
So in P4210, to store values in the F42UI12, you need to get any existing values in the F42UI12 (there is a BSFN to read the F42UI12). If no F42UI12 cache record exists, then for existing lines, you need to get the current F4211 values. Set the fields(s) required, and then update the F42UI12 (call the pre-processor).
Hope that helps.