Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Reading LCHR from database

tabraiz_khan
Participant
0 Likes
2,002

Hi,

I'm reading a LCHR field from my table with a SELECT statement.

The value i get seems to be truncated.

Is there any other way i could use to read the whole data?

Will READ_TEXT work?

Thanks,

Tabraiz

2 REPLIES 2
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,051

LCHR is a character string of any length ...

So you can try creating a text object and text id in se75 and try with read_text.

Im not sure about this..

Read only

0 Likes
1,051

You have a limitation of 255 characters on every alv that you use to show the results.

So you have to export the data from the database table.

Let's try to explain:

You have a database table with 2 fields (e.g.)

LENT TYPE INT2 (2 Byte Integer (Signed)), this field itis used for save the length of the LCHR field

ERROR_MESSAGE TYPE SMO_1500 LCHR (character 1500), this field it's used for save the string value with 1500 character.

You can't read this data with the TCODE SE16 or SE16N or SE11, because exist a limitation of 255 character on ALV tables.

Create a report like that to export the data to a file:

  SELECT *
     FROM zsrm_wlu_004
     INTO TABLE lt_zsrm_wlu_004
    WHERE wi IN s_wi AND
          ano IN s_ano AND
          wi_aagent IN s_agent .

CALL FUNCTION 'GUI_DOWNLOAD'
    
EXPORTING
       filename                       
= p_file_download
      filetype                       
= 'ASC'
     TABLES
       data_tab                       
= lt_zsrm_wlu_004