Application Development 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: 

ALV output problem in displaying the field lengths.( LONG_DES1 & LONG DES)

Former Member
0 Kudos

I have declared itab of ALV output like below...

  • Internal table for ALV report generation***********

DATA : Begin of pdet_otab_alv occurs 0,

bukrs LIKE bsid-bukrs, "Company code

postm(4), "Posting month (YYMM format)

xblnr LIKE bsid-xblnr, "Reference document number

kunnr LIKE bsid-kunnr, "Customer (Supplier Billing Customer)

name1 LIKE kna1-name1, "Name 1

buzei like bsid-buzei,

gjahr like bsid-gjahr,

filkd like bsid-filkd, "Rep Number

rname like kna1-name1, "Rep Name

belnr LIKE bsid-belnr, "Document number (invoice number)

blart LIKE bsid-blart, "Document type

zfbdt LIKE bsid-zfbdt, "Baseline date

zterm LIKE knb1-zterm, "Terms

netdt LIKE bsega-netdt,"Due date

sgtxt LIKE bsid-sgtxt, "Text

agerg TYPE t_agerg, "Age range of invoice

wrbtr LIKE bsid-wrbtr, "Original invoice amount

due LIKE bsid-wrbtr, "Amount outstanding on invoice

        1. long_des(250) type c, " Long description

<b> long_des TYPE string,

long_des1 TYPE string,</b>

date_s(10) type c, " Date

short_des(20) type c, " Short Description

counter type i,

End of pdet_otab_alv.

And after filling the internal table fields ( fields 'LONG_DES1' & 'LONG_DES' from FM READ_TEXT 's longtext, which are of 265 chars each )

<b>'LONG_DES1' & 'LONG_DES' are trimmed in ALV out put WHY ?</b>

w_fieldcat-fieldname = 'LONG_DES1'.

w_fieldcat-tabname = 'PDEL_OTAB_ALV'.

  • w_fieldcat-ref_fieldname = 'SCRTEXT_L'.

  • w_fieldcat-ref_tabname = 'DD03P'.

w_fieldcat-seltext_l = 'Original Note'.

w_fieldcat-col_pos = 17.

APPEND w_fieldcat TO fieldcat.

CLEAR w_fieldcat.

w_fieldcat-fieldname = 'LONG_DES'.

w_fieldcat-tabname = 'PDEL_OTAB_ALV'.

  • w_fieldcat-ref_fieldname = 'SCRTEXT_L'.

  • w_fieldcat-ref_tabname = 'DD03P'.

w_fieldcat-seltext_l = 'Latest Note'.

w_fieldcat-col_pos = 18.

APPEND w_fieldcat TO fieldcat.

CLEAR w_fieldcat.

*###

<b>next part i.e., before passing fieldcat.... I have filled s_layout like below.</b>

<b> s_layout-max_linesize = 1000.

s_layout-colwidth_optimize = 'X'.</b>

  • Call the following function to display output in ALV form

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = 'ZFRSBOI0'

is_layout = s_layout

it_fieldcat = fieldcat

it_events = p_events[]

  • it_sort = p_it_sort[]

i_save = 'A'

TABLES

t_outtab = pdet_otab_alv1

EXCEPTIONS

program_error = 1

OTHERS = 2.

  • If the function call is not successful, raise error message

  • and come out from the program

IF sy-subrc <> 0.

message e000(00) with

'Unable to display report'(e01).

exit.

ENDIF.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Try to modify your fieldcat for those fields :

w_fieldcat-outputlen = '256'.

Regards,

Nicolas

8 REPLIES 8

Former Member
0 Kudos

Hi Sam,

declare like this and see

long_des(90) TYPE c,

long_des1(90) TYPE c,

Regards,

Satish

Former Member
0 Kudos

Satish I have to display lengthy fields around 265 characters( even more than that as I am getting long text from READ_TEXT FM ).

So I declared them as STRING...

The probelm may be in ALV part ( I have seen till before ALV the fields are carrying all their characters with our missing )..

Thanks.

0 Kudos

Just try by giving length instead of giving as string and see whether you are getting data in ALV or not?

Regards,

Satish

Former Member
0 Kudos

I have declared like

long_des(1000) TYPE c,

long_des1(1000) TYPE c,

But there is of no use.

Thanks

Former Member
0 Kudos

Hi,

Try to modify your fieldcat for those fields :

w_fieldcat-outputlen = '256'.

Regards,

Nicolas

Former Member
0 Kudos

No Use

Thanks.

0 Kudos

I Sam,

Your code is right, but this is a ALV limitation. You can´t show more tha 132 characters ina field.

regards,

Former Member
0 Kudos

some body suggested me....we can display full length of text by below coding ?

Is that not correct - just asking....

....

s_layout-max_linesize = 1000.

s_layout-colwidth_optimize = 'X'.

  • Call the following function to display output in ALV form

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = 'ZFRSBOI0'

is_layout = s_layout

it_fieldcat = fieldcat

it_events = p_events[]

  • it_sort = p_it_sort[]

i_save = 'A'

TABLES

t_outtab = pdet_otab_alv1

EXCEPTIONS

program_error = 1

OTHERS = 2.

  • If the function call is not successful, raise error message

  • and come out from the program

IF sy-subrc <> 0.

message e000(00) with

'Unable to display report'(e01).

exit.

ENDIF.