Skip to Content
0

Concatenating String to Display Details Error

Mar 07 at 10:48 PM

23

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Abhilash Kumar
Mar 08 at 07:35 AM
0

Hi Scott,

Change the code on the footer to:

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

-Abhilash

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thank you, Sir!

0