2007 Nov 24 7:02 PM
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.
2007 Nov 24 7: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.
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.
2007 Nov 24 7: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.
2007 Nov 24 7:48 PM
2007 Nov 24 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.
2007 Nov 24 10:50 PM
Hi,
What the dump says? Can you please paste the dump message here?
Regards,
Satish
2007 Nov 25 9: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.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |