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

ALV returning blank output

Hi all,

I'm converting a report into ALV format. My problem over is that my ALV output is blank.

FYI, I've checked on the internal table that I passed into the function 'REUSE_ALV_GRID_DISPLAY', there are 50 rows of data inside the internal table. Using the same internal table, I can even write out the report.

Even when I try to pass it in for ALV output, everything is display nicely (title, column header, column size) except the content are 50 blank rows.

Anyone can help? Thanks in advance!

Regards,

JT

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

10 Answers

  • Best Answer
    Posted on May 30, 2007 at 09:56 AM

    Hi

    There is some problem with your field catalog.

    Check whether the order of field catalog is same with list display order.

    Try to debug.

    Regards,

    Sree

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2007 at 11:39 AM

    Hi,

    It seems problem with the field catelog. Check all filed name written in CAPS...It should be alright.

    Cheers...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 31, 2007 at 03:19 AM

    Hi all,

    I've changed the order of field catalog to be the same as list display order as well as all the field name to upper-case.

    The output I get even worse. It only show me title and a blank grey page.

    I did ALV report for 3 times previously without any problem. This is the first time I encountered such problem and I've been debugging the problem for the past 4 days.

    Below is part of my code.

    TYPE-POOLS: SLIS.

    DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,

    I_SORT TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE,

    I_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER WITH HEADER LINE,

    I_EVENTS TYPE SLIS_T_EVENT WITH HEADER LINE,

    F2CODE LIKE SY-UCOMM VALUE '&ETA',

    LAYOUT TYPE SLIS_LAYOUT_ALV,

    GT_SLIS_T_EVENTS TYPE SLIS_T_EVENT,

    GW_SLIS_EVENTS TYPE SLIS_ALV_EVENT,

    C_PROG LIKE SY-REPID,

    INX2 TYPE SY-TABIX.

    TYPES: BEGIN OF TYPE_ALV,

    LZONE LIKE KNA1-LZONE,

    NAME1 LIKE KNA1-NAME1 ,

    VTEXT LIKE TZONT-VTEXT,

    COST TYPE P DECIMALS 2,

    NTGEW TYPE P DECIMALS 2,

    RMMT TYPE P DECIMALS 2,

    MATKL LIKE LIPS-MATKL,

    END OF TYPE_ALV.

    DATA: REC_ALV TYPE TYPE_ALV OCCURS 0 WITH HEADER LINE.

    • -------------------------------------------------------------------------------------------------

    • Move data into rec_alv

    • -------------------------------------------------------------------------------------------------

    CLEAR: rec_alv.

    rec_alv-lzone = rec-lzone.

    rec_alv-name1 = rec-name1.

    rec_alv-vtext = rec-vtext.

    rec_alv-cost = cost_text.

    rec_alv-ntgew = btgew_text.

    rec_alv-rmmt = rmmt_text.

    rec_alv-matkl = rec-matkl.

    APPEND rec_alv.

    • -------------------------------------------------------------------------------------------------

    • FORM BUILD_FIELDCAT

    • -------------------------------------------------------------------------------------------------

    FORM BUILD_FIELDCAT.

    PERFORM FIELDCAT USING:

    'REC_ALV' ' ' 'LZONE' '20' 'Transporter' ' ' ' ',

    'REC_ALV' ' ' 'NAME1' '35' 'Customer' ' ' ' ',

    'REC_ALV' ' ' 'VTEXT' '40' 'Area Coverage' ' ' ' ',

    'REC_ALV' ' ' 'COST' '15' 'Transport Cost Amount' ' ' 'X',

    'REC_ALV' ' ' 'NTGEW' '15' 'Sales Volume' ' ' 'X',

    'REC_ALV' ' ' 'RMMT' '15' 'Transport Cost' ' ' 'X',

    'REC_ALV' ' ' 'MATKL' '20' 'Material Group' ' ' ' '.

    ENDFORM.

    • -------------------------------------------------------------------------------------------------

    • FORM BUILD_SORTTABLE

    • -------------------------------------------------------------------------------------------------

    FORM BUILD_SORTTABLE.

    PERFORM SORTTABLE USING:

    '1' 'LZONE' 'REC_ALV' 'X' ' ' ' ',

    '2' 'NAME1' 'REC_ALV' 'X' ' ' ' ',

    '3' 'VTEXT' 'REC_ALV' 'X' ' ' ' ',

    '4' 'COST' 'REC_ALV' 'X' ' ' 'X',

    '5' 'NTGEW' 'REC_ALV' 'X' ' ' 'X',

    '6' 'RMMT' 'REC_ALV' 'X' ' ' 'X',

    '7' 'MATKL' 'REC_ALV' 'X' ' ' ' '.

    ENDFORM.

    • -------------------------------------------------------------------------------------------------

    • FORM DISPLAY_ALV

    • -------------------------------------------------------------------------------------------------

    FORM DISPLAY_ALV USING TITLE TYPE C.

    C_PROG = SY-REPID.

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    I_CALLBACK_PROGRAM = C_PROG

    IT_FIELDCAT = I_FIELDCAT[]

    IS_LAYOUT = LAYOUT

    I_GRID_TITLE = TITLE

    IT_SORT = I_SORT[]

    I_SAVE = 'A'

    TABLES

    T_OUTTAB = REC_ALV

    EXCEPTIONS

    PROGRAM_ERROR = 1

    OTHERS = 2.

    ENDFORM.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Also try this and check if it works.

      FORM BUILD_FIELDCAT.

      PERFORM FIELDCAT USING:

      'REC_ALV' 'KNA1' 'LZONE' '20' 'Transporter' ' ' ' ' <b>' '</b>,

      'REC_ALV' 'KNA1' 'NAME1' '35' 'Customer' ' ' ' ' <b>' '</b>,

      'REC_ALV' 'TZONT' 'VTEXT' '40' 'Area Coverage' ' ' ' ' <b>' '</b>,

      'REC_ALV' ' ' 'COST' '15' 'Transport Cost Amount' ' ' 'X' <b>'P'</b>,

      'REC_ALV' ' ' 'NTGEW' '15' 'Sales Volume' ' ' 'X' <b>'P'</b>,

      'REC_ALV' ' ' 'RMMT' '15' 'Transport Cost' ' ' 'X' <b>'P'</b>,

      'REC_ALV' 'LIPS' 'MATKL' '20' 'Material Group' ' ' ' ' <b>' '</b>.

      ENDFORM.

      FORM FIELDCAT USING A TYPE ANY

      B TYPE ANY

      C TYPE ANY

      D TYPE ANY

      E TYPE ANY

      F TYPE ANY

      G TYPE ANY

      <b>H TYPE ANY</b>.

      CLEAR I_FIELDCAT.

      I_FIELDCAT-TABNAME = A.

      I_FIELDCAT-REF_TABNAME = B.

      I_FIELDCAT-FIELDNAME = C.

      I_FIELDCAT-OUTPUTLEN = D.

      I_FIELDCAT-SELTEXT_M = E.

      I_FIELDCAT-KEY = F.

      I_FIELDCAT-DO_SUM = G.

      <b>I_FIELDCAT-INTTYPE = H</b>.

      APPEND I_FIELDCAT.

      CLEAR I_FIELDCAT.

      ENDFORM.

  • Posted on May 31, 2007 at 03:26 AM

    TYPE-POOLS: SLIS.

    DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,

    I_SORT TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE,

    I_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER WITH HEADER LINE,

    I_EVENTS TYPE SLIS_T_EVENT WITH HEADER LINE,

    F2CODE LIKE SY-UCOMM VALUE '&ETA',

    LAYOUT TYPE SLIS_LAYOUT_ALV,

    GT_SLIS_T_EVENTS TYPE SLIS_T_EVENT,

    GW_SLIS_EVENTS TYPE SLIS_ALV_EVENT,

    C_PROG LIKE SY-REPID,

    INX2 TYPE SY-TABIX.

    TYPES: BEGIN OF TYPE_ALV,

    LZONE LIKE KNA1-LZONE,

    NAME1 LIKE KNA1-NAME1 ,

    VTEXT LIKE TZONT-VTEXT,

    COST TYPE P DECIMALS 2,

    NTGEW TYPE P DECIMALS 2,

    RMMT TYPE P DECIMALS 2,

    MATKL LIKE LIPS-MATKL,

    END OF TYPE_ALV.

    DATA: REC_ALV TYPE TYPE_ALV OCCURS 0 WITH HEADER LINE.

    • -------------------------------------------------------------------------------------------------

    • Move data into rec_alv

    • -------------------------------------------------------------------------------------------------

    CLEAR: rec_alv.

    rec_alv-lzone = rec-lzone.

    rec_alv-name1 = rec-name1.

    rec_alv-vtext = rec-vtext.

    rec_alv-cost = cost_text.

    rec_alv-ntgew = btgew_text.

    rec_alv-rmmt = rmmt_text.

    rec_alv-matkl = rec-matkl.

    APPEND rec_alv.

    • -------------------------------------------------------------------------------------------------

    • FORM BUILD_FIELDCAT

    • -------------------------------------------------------------------------------------------------

    FORM BUILD_FIELDCAT.

    PERFORM FIELDCAT USING:

    <b>'LZONE' 'REC_ALV' ' ' '20' 'Transporter' ' ' ' ',

    'NAME1''REC_ALV' ' ' '35' 'Customer' ' ' ' ',

    'VTEXT' 'REC_ALV' ' ' '40' 'Area Coverage' ' ' ' ',

    'COST' 'REC_ALV' ' ' '15' 'Transport Cost Amount' ' ' 'X',

    'NTGEW''REC_ALV' ' ' '15' 'Sales Volume' ' ' 'X',

    'RMMT' 'REC_ALV' ' ' '15' 'Transport Cost' ' ' 'X',

    'MATKL' 'REC_ALV' ' ' '20' 'Material Group' ' ' ' '.</b>

    ENDFORM.

    • -------------------------------------------------------------------------------------------------

    • FORM BUILD_SORTTABLE

    • -------------------------------------------------------------------------------------------------

    FORM BUILD_SORTTABLE.

    PERFORM SORTTABLE USING:

    '1' 'LZONE' 'REC_ALV' 'X' ' ' ' ',

    '2' 'NAME1' 'REC_ALV' 'X' ' ' ' ',

    '3' 'VTEXT' 'REC_ALV' 'X' ' ' ' ',

    '4' 'COST' 'REC_ALV' 'X' ' ' 'X',

    '5' 'NTGEW' 'REC_ALV' 'X' ' ' 'X',

    '6' 'RMMT' 'REC_ALV' 'X' ' ' 'X',

    '7' 'MATKL' 'REC_ALV' 'X' ' ' ' '.

    ENDFORM.

    • -------------------------------------------------------------------------------------------------

    • FORM DISPLAY_ALV

    • -------------------------------------------------------------------------------------------------

    FORM DISPLAY_ALV USING TITLE TYPE C.

    C_PROG = SY-REPID.

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    I_CALLBACK_PROGRAM = C_PROG

    IT_FIELDCAT = I_FIELDCAT[]

    IS_LAYOUT = LAYOUT

    I_GRID_TITLE = TITLE

    IT_SORT = I_SORT[]

    I_SAVE = 'A'

    TABLES

    T_OUTTAB = REC_ALV

    EXCEPTIONS

    PROGRAM_ERROR = 1

    OTHERS = 2.

    ENDFORM.

    Fieldcatlaog should be assigned as follows:-

    wa_fieldcatalog-fieldname = 'WERKS'. " <b>FIELD NAME</b>

    wa_fieldcatalog-tabname = 'I_OUTPUT'. " <b>INTERNAL TABLE NAME</b>

    wa_fieldcatalog-no_out = ' '.

    wa_fieldcatalog-seltext_l = 'PLANT'.

    APPEND wa_fieldcatalog TO i_fieldcatalog.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 31, 2007 at 07:22 AM

    hi,

    call fieldcatalog in alv_grid_display

    for example.

    hi,

    d_fieldcat_wa-fieldname = 'MATNR'.

    d_fieldcat_wa-seltext_l = 'material number'.

    d_fieldcat_wa-edit = 'X'.

    d_fieldcat_wa-col_pos = 1.

    append d_fieldcat_wa to d_fieldcat.

    clear d_fieldcat_wa.

    data : gd_repid like sy-repid.

    gd_repid = sy-repid.

    call function module reuse_alv_grid_display.

    exporting.

    program name = gd_repid.

    t_fieldcatalog = d_fieldcat.

    importing.

    t_outtab = itab.

    exceptions.

    reward with points if helpful.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2007 at 09:57 AM

    hi JT,

    pls post ur code ??

    have you passed the program name ??

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 31, 2007 at 03:47 AM

    Hi all,

    I've tested out all the recommendation from you all but I'm still getting the same output which is the title and a blank grey page.

    Will update if I could manage to get this solve.

    Regards,

    JT

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 31, 2007 at 04:07 AM

    Hi,

    Please check your field name you are passing in field catalog they should be in capital eg: "BUKRS". if they are not in CAPS you will not get data in you field catalog.

    Regards,

    Ruchika saini

    Reward if useful.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 31, 2007 at 04:10 AM

    I would suggest you to change transporter, customer and all into capitals.

    regards,

    Ruchika

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 31, 2007 at 09:55 AM

    Hi all,

    My problem solved at last.

    The cause of my problem due to layout setting. Previous programmer save a layout and set it as default layout setting. After removing the setting, everything seems to be fine now.

    Thanks a lot for the suggestion and advice.

    Regards,

    JT

    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.