Hi Mapping Gurus,
I have an issue with UDF queues, I am really not good as of the momment with queues and arrays that's why I am seeking your help.
I have a mapping IDoc to FILE (fixed field); each row in the file will be generated for every IDoc item (1 row generated for every E1EDP01)
One target field in the row has a validation as follows:
If E1EDP05-KSCHL = VALUE1; then map -KPERC field of that E1EDP05's occurence to target field.
I can not achieve this with Standarad Functions only.
I encounter mismatch in the number of queues
For example I have one IDoc with seven E1EDP01, "each" having 4 E1EDP05 in it; "all" E1EDP05 has field KSCHL but only one has VALUE1; "not all" E1EDP05 has the field KPERC in it.
As you can see, there is already a mismatch in the number of queues between E1EDP05-KSCHL, E1EDP05-KPERC, and E1EDP01.
So if I have One IDoc with seven E1EDP01 having four E1EDP05 in it with having the VALUE1 on the second occurence of E1EDP05 on the second occurence of E1EDP01, my resulting file should consists of:
7 ROWS
on the 2nd ROW, the value of KPERC from the corresponding E1EDP05-KSCHL occurence will be mapped
While for the 1st, 3rd, 4th, 5th, 6th, 7th rows the field will be field with space.
***Previously I had a simple validation performed on this field, and it is populated in the correct ROW of the corresponding occurence of the E1EDP01 segment and for validation = false I have padded it with space successfully.
***The issue only arises on my new validation because of the mismatch in the queues thereby wrong value/context is being mapped
Given the requirement above, can someone provide me a UDF code wherein the UDF will take the occurrence of the KSCHL=VALUE1, determine on what occurrence of E1EDP01 it is, and map the corresponding KPERC value to the corresponding ROW