Parsing a String and getting the values as multiple records.

Hi,

Need to parse a string which contains Item codes seperated by comma. once it is done, for each item, we need to check the inventory and populate the same sttring with details.

eg:Request String ItemCodes|1000,1100,1001|

for each item, we have to check the inventory and reply with the qty.

Output String ItemCodes|1000^10,1100^20,1001^30|

How can it be done.

Thanks in advance,

Regards,

Vikas

Use STRSUBSTNO function.

It replaces ‘#’ and ‘%’ with values but I need to run a loop to check inventory and build back the response

There are many different ways to do this.

One NAV-like way to do this would be to use a dataport with record delimiter of a comma, and a field delimiter of a “^”. You could turn then parse the input string and turn it into a filter (or a group of filters) for your dataport.

That’s one sort an idea (with problems btw).

Another idea is just pump your output through a dataport.

If you are asking how to parse your input string, again there are many ways to do this. Again you can use a dataport. Again, you can parse it through code. I might prefer parsing this through code – select string is a nice function you can use that seperates strings that are delimited by commas.