Skip to Content
author's profile photo Former Member
Former Member

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

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 04:29 PM

    Hi,

    Try to modify your fieldcat for those fields :

    w_fieldcat-outputlen = '256'.

    Regards,

    Nicolas

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 03:56 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 03:43 PM

    Hi Sam,

    declare like this and see

    long_des(90) TYPE c,

    long_des1(90) TYPE c,

    Regards,

    Satish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 04:05 PM

    I have declared like

    long_des(1000) TYPE c,

    long_des1(1000) TYPE c,

    But there is of no use.

    Thanks

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 04:35 PM

    No Use

    Thanks.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 04:48 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.