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

Type LCHR.

Former Member
0 Likes
1,370

Hello everyone.

How can I add a field with type "LCHR" to Ztable.

How I can read out from that field and also how to update that field with a value.

there are not many example to find on LCHR.

i have tried the following link to study:

http://help.sap.com/saphelp_45b/helpdata/en/bc/897415dc4ad111950d0060b03c6b76/content.htm

but it only gives theoretical explanation for lchr.

can someone help me with example  (in abap code).???

thank you

ojaswa

Hello everyone.

How can I add a field with type "LCHR" to Ztable.

How I can read out from that field and also how to update that field with a value.

there are not many example to find on LCHR.

i have tried the following link to study:

http://help.sap.com/saphelp_45b/helpdata/en/bc/897415dc4ad111950d0060b03c6b76/content.htm

but it only gives theoretical explanation for lchr.

can someone help me with example  (in abap code).???

thank you

ojaswa

1 REPLY 1
Read only

miguel_silva3
Explorer
0 Likes
865

Hello Ojaswa,

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
            .