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

ALV

Hello Everyone,

I am just testing the following code...to practice on ALV. For some reason, I am not able to see the output. It gives out a memory dump, if I try to run this. After some troubleshooting...found that it gives the memory dump when I call the function...REUSE_ALV_GRID_DISPLAY. Also found that if I use some data dictionary structure for my field catalog...it does not give me this memory dump. Could anyone please help me on this. What I am doing in creating fieldcatalog, that I should not be doing??

I do have some confusion about the field catalog function as well. If I use the function: REUSE_ALV_FIELDCATALOG_MERGE...do I still need to populate my field catalog internal table with the field names or this function should do it for me. I did check the field catalog internal table after calling this function, but it does not show any field names in it.

Thanks for the great help...in advanced.

type-pools : slis.

tables sflight.

DATA WS_REPNAME LIKE SY-REPID.

WS_REPNAME = SY-REPID.

data : itab1 type slis_t_fieldcat_alv.

data : wa type slis_fieldcat_alv.

data: begin of itab occurs 0,

CARRID like sflight-carrid,

CONNID like sflight-connid,

FLDATE like sflight-fldate,

PRICE like sflight-price,

CURRENCY like sflight-currency,

PLANETYPE like sflight-planetype,

SEATSMAX like sflight-seatsmax,

end of itab.

select * from sflight into corresponding fields of table itab.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = WS_REPNAME

  • I_INTERNAL_TABNAME = Internal output table field name

I_STRUCTURE_NAME = 'ITAB'

I_INCLNAME = WS_REPNAME

CHANGING

CT_FIELDCAT = ITAB1.

PERFORM BUILD_FIELD_CATELOG CHANGING itab1.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

IT_FIELDCAT = ITAB1

TABLES

T_OUTTAB = ITAB.

FORM BUILD_FIELD_CATELOG CHANGING itab1 TYPE slis_t_fieldcat_alv.

wa-col_pos = 1.

wa-fieldname = 'carrid'.

wa-seltext_s = 'Airline id'.

wa-tabname = 'itab'.

append wa to itab1.

wa-col_pos = 2.

wa-fieldname = 'connid'.

wa-seltext_s = 'Connection id'.

wa-tabname = 'itab'.

append wa to itab1.

wa-col_pos = 3.

wa-fieldname = 'fldate'.

wa-seltext_s = 'DATE'.

wa-tabname = 'itab'.

append wa to itab1.

wa-col_pos = 4.

wa-fieldname = 'price'.

wa-seltext_s = 'PRICE'.

wa-tabname = 'itab'.

append wa to itab1.

wa-col_pos = 5.

wa-fieldname = 'currency'.

wa-seltext_s = 'Currency'.

wa-tabname = 'itab'.

append wa to itab1.

wa-col_pos = 6.

wa-fieldname = 'planetype'.

wa-seltext_s = 'PLANE-TYPE'.

wa-tabname = 'itab'.

append wa to itab1.

wa-col_pos = 7.

wa-fieldname = 'seatsmax'.

wa-seltext_s = 'MAX. SEATS'.

wa-tabname = 'itab'.

append wa to itab1.

ENDFORM.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2007 at 07:47 PM

    Hi,

    While building your fieldcatalog you should make sure that all the field names should be in upper case. example as below :

    wa-col_pos = 1.
    wa-fieldname = 'CARRID'. "Changed carrid to CARRID
    wa-seltext_s = 'Airline id'.
    wa-tabname = 'itab'.
    append wa to itab1.
    
    wa-col_pos = 2.
    wa-fieldname = 'CONNID'. "Changed connid to CONNID
    wa-seltext_s = 'Connection id'.
    wa-tabname = 'itab'.
    append wa to itab1.

    You need to change all the fieldname to upper case, then you can overcome this issue.

    Thanks,

    Sriram Ponna.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 24, 2007 at 07:48 PM

    Hello

    The sample report <b>ZUS_SDN_FIELDCATALOG_1</b> in thread

    field catalog generation using merge function

    demonstrates how to use internal data definitions (instead of DDIC structures) for generating the fieldcatalog.

    However, I highly disregard to use internal data definitions.

    Regards

    Uwe

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2007 at 10:37 PM

    Hello,

    Thanks for the replies. I did what you guys suggested...did little bit more research on it... but still getting the memory dump. I guess it might be this minisap version...I just downloaded couple of days ago, might have some issues...Well I will try this on with my other pc....and see how things are....thanks for the great help! Appreciate your input.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 25, 2007 at 09:31 PM

    Hello All,

    Thanks for the great help! Well I found the solution to my runtime errors. Apparently I needed to pass the table name with square brackets while calling the GRID DISPLAY function...like this:

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    IT_FIELDCAT = ITAB1 <--- instead of this, I should pass the table as ITAB1[]

    TABLES

    T_OUTTAB = ITAB. <---and this one as well...ITAB[]

    that fixed my problem.

    Thanks for all those who helped me.

    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.