Skip to Content

Crystal Reports: Displaying string fields from SAP transparent table

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    May 25, 2010 at 09:52 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 18, 2009 at 08:30 AM

    Hi Frank,

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

    Regards,

    Stratos

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Frank Meiser

      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?

  • avatar image
    Former Member
    Jul 22, 2009 at 05:04 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 28, 2009 at 04:52 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 07, 2009 at 02:21 PM

    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

    Add comment
    10|10000 characters needed characters exceeded