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

ALV Cell width

Former Member
0 Likes
1,009

Dear Experts,

in the below codings when the text values increases beyond certain value texts are truncated i need full text to be displayed....


TYPES: BEGIN OF ty_outtab,
        value1 TYPE string,
        value2 TYPE i,
      END OF ty_outtab.

DATA: it_outtab TYPE TABLE OF ty_outtab,
      wa_outtab TYPE          ty_outtab.

DATA: it_fcat TYPE lvc_t_fcat,
      wa_fcat TYPE lvc_s_fcat.

DATA: wa_layo TYPE          lvc_s_layo.

wa_outtab-value1 = 'Lorem ipsum dolor'.
wa_outtab-value2 = 1.
APPEND wa_outtab TO it_outtab.

wa_outtab-value1 =
'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidun sap asdfas asdfa asdf asfd adf asdf asdf fas afj ash kajfh kajh akjlh akjh akjl hakjh fakj h.'.
wa_outtab-value2 = 2.
APPEND wa_outtab TO it_outtab.

wa_fcat-fieldname = 'VALUE1'.
wa_fcat-tabname   = 'IT_OUTTAB'.
wa_fcat-scrtext_s = 'Value 1'.
wa_fcat-outputlen = '1000'.
APPEND wa_fcat TO it_fcat.

CLEAR wa_fcat.

wa_fcat-fieldname = 'VALUE2'.
wa_fcat-tabname   = 'IT_OUTTAB'.
wa_fcat-scrtext_s = 'Value 2'.
wa_fcat-outputlen = '1000'.
APPEND wa_fcat TO it_fcat.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
  EXPORTING
    i_grid_title    = 'TEST'
    is_layout_lvc   = wa_layo
    it_fieldcat_lvc = it_fcat
  TABLES
    t_outtab        = it_outtab
  EXCEPTIONS
    program_error   = 1
    OTHERS          = 2.

IF sy-subrc  = 0.
  WRITE 'Something went wrong!'.
ENDIF.

thanks and regards.

Thirukumaran. R

1 ACCEPTED SOLUTION
Read only

daixiong_jiang3
Active Participant
0 Likes
807

As per SAP NOTE 422660, ALV grid: Field lengths are limited to 128 characters

Summary

Symptom

The ALV cuts off field contents after 128 characters. However, you can enter more than 128 characters in these field in the input-enabled grid.

Additional key words

ABAP List Viewer, SAP List Viewer,

ALV grid control, CL_GUI_ALV_GRID,

Field length restriction, field length

Cause and prerequisites

The restriction to 128 characters is due to technical reasons and cannot be avoided. If the input-enabled grid is used, more characters can be entered.

Solution

Maintain the source code corrections outlined in the correction instructions.

5 REPLIES 5
Read only

daixiong_jiang3
Active Participant
0 Likes
808

As per SAP NOTE 422660, ALV grid: Field lengths are limited to 128 characters

Summary

Symptom

The ALV cuts off field contents after 128 characters. However, you can enter more than 128 characters in these field in the input-enabled grid.

Additional key words

ABAP List Viewer, SAP List Viewer,

ALV grid control, CL_GUI_ALV_GRID,

Field length restriction, field length

Cause and prerequisites

The restriction to 128 characters is due to technical reasons and cannot be avoided. If the input-enabled grid is used, more characters can be entered.

Solution

Maintain the source code corrections outlined in the correction instructions.

Read only

0 Likes
807

can u make changes in my code.,

Thanks and Regards,

Thirukumaran. R

Read only

Former Member
0 Likes
807

Hi,

The truncation occurs when length exceeds 142 .

In your case , the string length is more than this, so it was truncated.

Read only

0 Likes
807

i need whole text what ever is there in ouput.

Thanks and Regards,

Thirukumaran. R

Read only

Former Member
0 Likes
807

As it has been said, you have a restriction on length. So cut the string into multiple columns and assign accordingly in field catalog.

Or have multiple rows for bigger texts in ALV by putting blanks for other fields in those extended rows.

Regards,

Sumit