cancel
Showing results for 
Search instead for 
Did you mean: 

Concatenating String to Display Details Error

0 Kudos

Referencing code posted by @abhilash.kumar on 06/21/2012, I am trying to collect detail records in a single field. In some cases, the code below works, but in others, I receive an error stating, "String length is less than 0 or not an integer". I realize that I'm getting this error because there are some blank values being returned and the code is subtracting from zero, I just don't know how to fix it and after perusing discussions, I haven't came to a conclusion. Any help is greatly appreciated!

This is going into my details section:

WhilePrintingRecords;
stringvar array arr;
numbervar i;
if not({Customer.Country} in arr) then
(
    i := i + 1;
    redim preserve arr[i];
    arr[i] := {Customer.Country};
);
arr[i]

This is going into my footer section:

WhilePrintingRecords;
stringvar array arr;
stringvar fin;
numbervar j;
for j := 1 to ubound(arr) do
fin := fin + arr[j] + ", ";
left(fin,len(fin)-2);

Referencing: https://archive.sap.com/discussions/thread/3195910

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Scott,

Change the code on the footer to:

WhilePrintingRecords;
stringvar array arr;
Join(arr, ", ");

-Abhilash

0 Kudos

Thank you, Sir!

Answers (0)