Skip to Content
0

SAP imported Crystal gives error "String length is less than 0 or not an integer"

Jan 24 at 06:16 PM

38

avatar image

Experts,

When I run the Crystal Report, I get no error. But when I import this to SAP, it gives me the "String length is less than 0 or not an integer" error on the Account Name formula. This Account Name formula is just to shorten the GL account not to show the segments.

Left({GetCurrentBalanceWithFX.AcctName}, Instr({GetCurrentBalanceWithFX.AcctName},'(STCAN')-1)

This error started when I copied (imported) one Sub-Report to another Sub-Report as they are similar, just pulling from different DB's. Before that the Main Report and one Sub-Report worked with this formula in Crystal and SAP B1.

error-114.png (106.4 kB)
10 |10000 characters needed characters left characters exceeded

Correction: When imported to SAP I do not get the error for the Main report, when I suppress the sub-reports. I get the error only when I activate the sub-reports again.

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Brian Dong Jan 24 at 07:32 PM
1

Hi Marli,

This usually happens if the field is NULL or empty. Have your formula check for a valid string like:

If Not ISNULL ({GetCurrentBalanceWithFX.AcctName}) Or 
     {GetCurrentBalanceWithFX.AcctName} <> "" Then 
     Left({GetCurrentBalanceWithFX.AcctName}, Instr({GetCurrentBalanceWithFX.AcctName},'(STCAN')-1) 
Else ""; 

When the subreport is suppressed, it doesn't run so you don't get the error.

Good luck,

Brian

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

Brian,

Thanks for your reply.

I changed that formula, but still get the error in SAP, not in Crystal.

error-131.png (87.7 kB)
0

Hi Marli,

Let's change this to check if the string (STCAN is in the field then.

If InStr ({GetCurrentBalanceWithFX.AcctName}, "(STCAN") >= 1 Then 
     Left({GetCurrentBalanceWithFX.AcctName}, Instr({GetCurrentBalanceWithFX.AcctName},"(STCAN")-1) 
Else ""; 

I also changed your single quotes (') to double quotes (") because that has caused problems.

Good luck,

Brian

1

Brian,

I'll test that change a little later.

I have added field by field to the sub-report, and tested each time, to see which one was causing issues and accidentally found that it had to do with Data Source locations. When it was incorrectly set, I did not have this issue, when I corrected it, the issue presented itself - Therefor I'm thinking this is an issue on the Stored Procedure....

I'll try your suggestion and see what happens.

Thanks.

0