06-13-2017 11:40 AM
Code I am using, How can I resolve the dump I am getting.
type-pools: slis.
tables: mara.
selection-screen begin of block b1 with frame title text-001.
select-options: s_input for mara-matnr obligatory.
selection-screen end of block b1.
data: it_itab type table of mara,
wa_itab type mara.
data: it_fcat type slis_t_fieldcat_alv,
wa_fcat type slis_fieldcat_alv.
DATA : I_HEADING TYPE SLIS_T_LISTHEADER .
DATA : WA_HEADING LIKE LINE OF I_HEADING .
DATA: it_event type slis_t_event,
wa_event type slis_alv_event.
start-of-selection.
select *
from mara
into table it_itab.
loop at it_itab into wa_itab.
endloop.
write: wa_itab-matnr, wa_itab-mtart, wa_itab-mbrsh, wa_itab-meins, wa_itab-brgew, wa_itab-ntgew.
*DATA IT_LIST_COMMENTARY TYPE SLIS_T_LISTHEADER.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
it_fieldcat = it_fcat "PASS FIELD CATALOG TO ALV
tables
t_outtab = it_itab.
if sy-subrc <> 0.
Message 'No Field catalogue available' Type 'E'.
endif.
FORM CREATE_FCAT .
WA_FCAT-COL_POS = '1' .
WA_FCAT-FIELDNAME = 'MATNR' .
WA_FCAT-TABNAME = 'IT_ITAB' .
WA_FCAT-SELTEXT_M = 'MATERIALNO' .
WA_FCAT-KEY = 'X' .
APPEND WA_FCAT TO IT_FCAT .
CLEAR WA_FCAT .
WA_FCAT-COL_POS = '2' .
WA_FCAT-FIELDNAME = 'MTART' .
WA_FCAT-TABNAME = 'IT_ITAB' .
WA_FCAT-SELTEXT_M = 'MATERIALTYPE' .
* WA_FCAT-NO_OUT = 'X' .
WA_FCAT-HOTSPOT = 'X' .
APPEND WA_FCAT TO IT_FCAT .
CLEAR WA_FCAT .
WA_FCAT-COL_POS = '3' .
WA_FCAT-FIELDNAME = 'MBRSH' .
WA_FCAT-REF_FIELDNAME = 'MBRSH' .
WA_FCAT-REF_TABNAME = 'MARA' .
WA_FCAT-TABNAME = 'IT_ITAB' .
WA_FCAT-SELTEXT_M = 'INDSECTOR' .
* WA_FCAT-EDIT = 'X' .
APPEND WA_FCAT TO IT_FCAT .
CLEAR WA_FCAT .
WA_FCAT-COL_POS = '4' .
WA_FCAT-FIELDNAME = 'MEINS' .
WA_FCAT-TABNAME = 'IT_ITAB' .
WA_FCAT-SELTEXT_M = 'MAT.UNITS' .
* WA_FCAT-EMPHASIZE = 'C610'.
APPEND WA_FCAT TO IT_FCAT .
CLEAR WA_FCAT .
WA_FCAT-COL_POS = '5' .
WA_FCAT-FIELDNAME = 'BRGEW' .
WA_FCAT-TABNAME = 'IT_ITAB' .
WA_FCAT-SELTEXT_M = 'MAT.UNITS' .
* WA_FCAT-EMPHASIZE = 'C610'.
APPEND WA_FCAT TO IT_FCAT .
CLEAR WA_FCAT .
WA_FCAT-COL_POS = '6' .
WA_FCAT-FIELDNAME = 'NTGEW' .
WA_FCAT-TABNAME = 'IT_ITAB' .
WA_FCAT-SELTEXT_M = 'MAT.UNITS' .
* WA_FCAT-EMPHASIZE = 'C610'.
APPEND WA_FCAT TO IT_FCAT .
CLEAR WA_FCAT .
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = I_HEADING
I_LOGO = 'LOGO_CH'
* I_END_OF_LIST_GRID = I_END_OF_LIST_GRID
* I_ALV_FORM = I_ALV_FORM
.
ENDFORM. " CREATE_FCAT
THE dump shows as below
method set_sort_criteria.
*... (1) Trace?
if not mr_trace is initial.
call method mr_trace->add_trace_item
exporting
i_trace_item = 'SET_SORT_CRITERIA'
ir_variant = m_cl_variant
it_data = mt_data
it_info = mt_info.
endif.
if m_cl_variant->mt_fieldcatalog is initial.
>>>>>>>>>>>>>>raise no_fieldcatalog_available.
endif.
m_cl_variant->mt_sort = it_sort.
06-14-2017 5:25 AM
Hi,
You are not writing the statement: perform create_fcat.
call the perform before FM 'reuse_alv_grid_display'.
You will get the output successfully.
06-13-2017 11:54 AM
Firstly, move sy-repid to a variable and use that instead of sy-repid because sy-repid could change during the call. Also, why are you specifying a call back program without specifying any of the callback events ? You also do not appear to be calling create-fcat (look at your error message.....)
Rich
06-13-2017 9:28 PM
For info, sy-repid behavior has been changed in release 6.10, it's no more a system field, it's a field from the program itself, and so it doesn't change anymore when another program is call. (cf note 325403 - Specification of SY-REPID as an actual parameter + release notes of ABAP 6.10)
06-14-2017 8:21 AM
Thanks Sandra, I've learnt my new something for today!
06-14-2017 5:25 AM
Hi,
You are not writing the statement: perform create_fcat.
call the perform before FM 'reuse_alv_grid_display'.
You will get the output successfully.
06-14-2017 5:33 AM
Thank You that did it.
I am a beginner in abap , did not think it would make any difference in the output.
06-14-2017 6:08 AM
It's not ABAP, it's a matter of programming logic. If you don't execute something, then it doesn't happen.
Note that Richard Harper already told you about that missing "perform create_fcat" yesterday.
06-14-2017 7:24 AM
Thank You Richard for your answer but I pondered over calling create-fcat and got confused over also putting sy-repid in a variable. I tried different scenarios but couldn't make it work.