comma separated list

TFrank

Member
Hi,

I am searching for a solution for the following problem:

I've got a new report with new processing options. There is a field on the processing option where you can edit line types as a comma separated list (Example: "N1,N,T").

What I want to do now is to check the F4211 Line Type against this list. What I have found so far is the function 'FindStringInString', but this function does not directly find the element of the list. So if you remove the "N" in the list above it would find the "N" in "N1".

A possible workaround is the use UDC's, but I'm searching for some other functions like
- "Number of Elements" as a sum of all Elements in this list,
- "Number of Entry" as an index value for a special item or
- "Entry Value" as the return-value for a given index.

Does anybody have any ideas, solutions, remarks or hints? ;-)

Thomas
 
What I understand from your question is that you are trying to get user input for line types and then you are going to compare each line type which you will get from F4211. If this is true then what you are doing is going to take a long time and you will end up reading F4211 as many times as the line types entered by the user.

Secondly instead of looking for a specific line type in your processing option why dont you look for COMMAS and do simple addition and subtraction and get the Line type values.

Question: Why dont you put your line types in data selection and do a break on line type.
 
To your question: The report already has a data selection. Under certain circumstances I will have to fill the field ADDJ in the F4211. But this depends on the other records of the same sales order. So what I have to do is to loop through all records of the same sales order (I will do this in a select - do while loop) and try to find a record who's line type is part of the comma separated list.

In an other programming language there was a function called "lookup". This function returned the position number, if the element was found in the string or zero if it was not found. This was my idea to solve this problem.
With such a function I could easily loop through all records of a sales order and find the one I need.
 
Hi Thomas,

I found a need for almost exactly the same thing, a little while ago. As I
couldn't find anything to do it within JDE, I ended up writing a new (named
event rule) custom business function to allow me to check a value against
each element of a comma-delimited list. It uses B7500150 to find the
character-position of each comma, and then uses this information to extract
each field from the list, and compares the search-value against each field
in turn. Rather crude, and not particularly efficient, but it works ;-)

Does that help?
Mark
 
Here are some suggestions for a work-around:

Search for the string with the comma included, for example "N," or "N1,".
Be sure to append a comma to the end of the string first, or that last pesky
bugger without a comma would be missed!

Or how about decatenating (is that a word?) the string? Than compare against
the elements therein. If you did that then you could append data selection
so that only those values are read.

Harry
 
Back
Top