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

ALV LIST

my alv list display is breaking after certain width to next line so how to align all the column plz advice.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 02:33 PM

    Hello,

    Make this change in the layout.

    layout- colwidth_optimize = 'X'.

    Regards,

    Vasanth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 04:19 AM

    Hi,

    Manually create the fieldcatalog,u can get the output which u want.

    • Data Declaration

    TYPE-POOLS: SLIS.

    TABLES: MARA.

    SELECT-OPTIONS: MATNR FOR MARA-MATNR NO-EXTENSION.

    TYPES: BEGIN OF I_MARA,

    MATNR LIKE MARA-MATNR,

    MTART LIKE MARA-MTART,

    MEINS LIKE MARA-MEINS,

    GROES LIKE MARA-GROES,

    VOLUM LIKE MARA-VOLUM,

    END OF I_MARA.

    DATA: IT_MARA TYPE STANDARD TABLE OF I_MARA INITIAL SIZE 0.

    • ALV Data Declaration

    DATA: FLDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,

    I_REPID TYPE SY-REPID.

    START-OF-SELECTION.

    PERFORM DATA_RETRIEVAL.

    PERFORM BLD_FLDCAT.

    PERFORM DISPLAY_ALV_REPORT.

    • Build field catalog for ALV

    FORM BLD_FLDCAT.

    FLDCAT-FIELDNAME = 'MATNR'.

    FLDCAT-SELTEXT_M = 'MATERIAL NUMBER'.

    FLDCAT-COL_POS = 0.

    FLDCAT-OUTPUTLEN = 25.

    APPEND FLDCAT TO FLDCAT.

    CLEAR FLDCAT.

    FLDCAT-FIELDNAME = 'MTART'.

    FLDCAT-SELTEXT_M = 'MATERIAL TYPE'.

    FLDCAT-EMPHASIZE = 'C111'.

    APPEND FLDCAT TO FLDCAT.

    CLEAR FLDCAT.

    FLDCAT-FIELDNAME = 'MEINS'.

    FLDCAT-SELTEXT_M = 'UNIT OF MEASURE'.

    APPEND FLDCAT TO FLDCAT.

    CLEAR FLDCAT.

    FLDCAT-FIELDNAME = 'GROES'.

    FLDCAT-SELTEXT_M = 'SIZE'.

    APPEND FLDCAT TO FLDCAT.

    CLEAR FLDCAT.

    FLDCAT-FIELDNAME = 'VOLUM'.

    FLDCAT-SELTEXT_M = 'VOLUME'.

    APPEND FLDCAT TO FLDCAT.

    CLEAR FLDCAT.

    ENDFORM.

    • Display report using ALV List

    FORM DISPLAY_ALV_REPORT.

    I_REPID = SY-REPID.

    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

    EXPORTING

    I_CALLBACK_PROGRAM = 'I_REPID'

    IT_FIELDCAT = FLDCAT[]

    I_SAVE = 'A'

    TABLES

    T_OUTTAB = IT_MARA.

    EXCEPTIONS

    PROGRAM_ERROR = 1

    OTHERS = 2.

    IF SY-SUBRC <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    ENDFORM.

    • Retrieve data from MARA table and populate itab IT_MARA

    FORM DATA_RETRIEVAL.

    SELECT MATNR MTART MEINS GROES VOLUM

    INTO TABLE IT_MARA FROM MARA

    WHERE MATNR IN MATNR.

    ENDFORM.

    observe the field width "MATNR",it is 25 characters length.if u change this u can find the defference.

    reward points,if it is useful.

    Thanks,

    chandu.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 11:28 AM

    resolved

    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.