cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports: Displaying string fields from SAP transparent table

former_member593901
Participant
0 Kudos

Hello Experts,

we need to display long texts from SAP transparent tables. The length of the text is undefined, that means the text is saved in a string field of undefined length.

If I try to access such a table that contains a string field from Crystal Reports, the generated database doesn´t contain the string field.

Is this a fact or does there a possibility exist to display the string fields from SAP transparent tables ?

(Okay, we could write a program that splits the strings into char fields and then again concatenate the char fields in Crystal Report...)

Thanks in advance,

Frank

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi all,

I realise this is an old thread, but I was searching for help on a related problem and now I've solved it.

It seems if you select the LCHR field without also selecting the length field that precedes it then the text will be blank. If you add the length field to the selection then the text field will magically be filled in.

For example:


  SELECT  object_id  object_text
      FROM zmyobjects
      INTO CORRESPONDING FIELDS OF TABLE lt_object_texts.

Will leave the object text mysteriously blank. Whereas:


  SELECT  object_id  text_length  object_text
      FROM zmyobjects
      INTO CORRESPONDING FIELDS OF TABLE lt_object_texts.

will populate the object text.

It sounds like the same thing is happening with Crystal Reports. It would be nice if the syntax check could give us a clue about these things, before we think we've gone mad.

Best regards,

Paul.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hello experts,

I have the same problem. I have a transparant table in the SAP R/3 system. In this transparent table we have a field called VALUE_LTEXT this is a field of type LCHR length 32000.

When I connect to this table from the crystal application then I can see the field. But when I drag it into my report in the details section and execute the report then the field stays empty. No error. I also have a field called : changed by" which is of type CHAR length 12. When I drag this field in the report it shows me the data.

Question: Can Crystal handle LCHR fields, length 32000 ?

Kind regards,

Leon

Former Member
0 Kudos

After being pointed in a direction, I thought some research won't hurt...

It seems that Crystal Reports can only connect to table fields that are 254 characters of length or less!

Creating a string variable in Crystal can.....

 
The maximum length of a String constant, a String value held by a String variable, a String value returned by a function or a String element of a String array is 65,534 characters.

To build this long string i.e if you want to have a paragraph, is to set up your table with at least an ID, SEQ_NUM, STR_TEXT field, where the SEQ_NUM is merely the sequence in e.g 250 length chunks the long string has been unpacked to.

How to put the string back together in Crystal....

Create Variables...


ConcatenatedString...

whileprintingrecords;
stringvar i;
i:= i + totext([the field name that the text is in])

Place this variable in the detail section of the report


DisplayString..... 

whileprintingrecords;
stringvar i;

Place this in the Report Footer or Group Footer below the Details section.

To get the string to reconstruct correctly, you need to order by the SEQ_NUM... Hide or suppress the Detail Section and the full string text will display at the end.

IngoH
Active Contributor
0 Kudos

Hi Jaques,

sorry - but you talking now about variables in Crystal Reports but we started off with string fields in the tables in your SAP system.

so what is this about ?

thanks

Ingo

Former Member
0 Kudos

Hi Ingo,

Yes, 2 different issues. Firstly, the field length in the actual table... even in MS SQL, one can define a long field length e.g varchar(2000), and in the first post the SAP table was set to 65553... The initial challenge then was, since a string variable in Crystal can allow such a long length, why does Crystal not pick up the field if also defined as such or similar long length. Then I found the field length limit of 254 characters. I also tested this on MS SQL and anything longer than 254 does not work, so I presumed the same applies to the SAP table and looked towards "The sum of all its parts makes a whole" in then breaking up a long string at table level to fit the 254 limit and rebuilding it again using the variables in Crystal.

The fact is... Is there a limit on string field lengths in tables - Yes, 254 characters. This is all I was looking for so I could solve my problem....

Regards

Jacques

IngoH
Active Contributor
0 Kudos

HI Jacques,

seems like you jumping between lots of different topics so here some items to clarify things:

- is the question on supporting large string fields on top of a SAP table using OpenSQL Connectivity ?

- is the question on supporting large string objects in Crystal Reports parameters ?

Ingo

Former Member
0 Kudos

Hi Ingo,

This is the ultimate question.....

- is the question on supporting large string fields on top of a SAP table using OpenSQL Connectivity ?

The second is not the issue or actual question....however, I presume it will also be bound by the capability/limitation of the above?

- is the question on supporting large string objects in Crystal Reports parameters ?

Regards

Jacques

IngoH
Active Contributor
0 Kudos

and could you post the details of the table here ?

ingo

Former Member
0 Kudos

Hi All,

Is there a resolution or work around to this? We also have a table with a field of type string, length 65553. The field does not display in the field explorer or database expert. The other fields are visible. Any idea's to how we can deal with this field? ...and where can we find some of the listed known limitations in this regard?

Thanks

Jacques

IngoH
Active Contributor
0 Kudos

Hi Jacques,

what is the data type of the field in the table ?

could you provide the details on the table ?

thanks

INgo

0 Kudos

Hi Frank,

which CR driver do you use to access your transparent tables?

Regards,

Stratos

former_member593901
Participant
0 Kudos

Hi Stratos,

we´re using the "SAP Table, Cluster or Function" driver. Is there another possibility to directly access transparent tables ?

Thanks,

Frank

0 Kudos

Hi Frank,

as far as I know this is the way to go when accessing transparent tables. Is writing an ABAP function that reads explicitely the desired field an option for you? You can use the same driver to access it. Or is it possible to get your data indirectly via an infoset query?

Regards,

Stratos

PS: Do you use BO Enterprise or BO Edge? Which version?