‎2007 Feb 15 9:47 PM
Output is not displaying in the grid. I am getting empty Grid. The code i had written is
-
REPORT ZBPALV.
type-pools SLIS.
data: w_fcat type slis_fieldcat_alv,
t_fcat type slis_t_fieldcat_alv.
w_fcat-fieldname = 'kunnr'.
w_fcat-seltext_m = 'Customer'.
append w_fcat to t_fcat.
data: begin of ty_kna1 occurs 100,
kunnr type kunnr,
end of ty_kna1.
select kunnr from kna1 into table ty_kna1.
*loop at ty_kna1.
*
*write: ty_kna1-kunnr.
*
*endloop.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ' '
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = t_fcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ty_kna1
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.
-
can any one help me on this issue
Thanks in advance
‎2007 Feb 15 9:53 PM
Hi,
Just make following change.
w_fcat-fieldname = '<b>KUNNR</b>'.
w_fcat-seltext_m = 'Customer'.
Regards,
Amit
‎2007 Feb 15 9:53 PM
Hi,
Just make following change.
w_fcat-fieldname = '<b>KUNNR</b>'.
w_fcat-seltext_m = 'Customer'.
Regards,
Amit
‎2007 Feb 15 9:54 PM
Hi,
Pass
data: ws_repid like sy-repid.
ws_repid = sy-repid.
I_CALLBACK_PROGRAM = ws_repid
Regards
Subramanian
‎2007 Feb 15 11:08 PM
HI,
Change upper case of 'kunnr'.
w_fcat-fieldname = 'KUNNR'.
regards
sarath
‎2007 Feb 15 11:25 PM
Hi,
Check this modified code..
type-pools SLIS.
data: w_fcat type slis_fieldcat_alv,
t_fcat type slis_t_fieldcat_alv.
w_fcat-fieldname = 'KUNNR'.
w_fcat-seltext_m = 'Customer'.
append w_fcat to t_fcat.
data: begin of ty_kna1 occurs 100,
kunnr type kunnr,
end of ty_kna1.
select kunnr from kna1 into table ty_kna1.
*loop at ty_kna1.
*
*write: ty_kna1-kunnr.
*
*endloop.
data: s_layout type slis_layout_alv.
s_layout-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IS_LAYOUT = s_layout
IT_FIELDCAT = t_fcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ty_kna1
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.
THanks,
Naren
‎2007 Feb 15 11:40 PM
Hi,
I think most ALV errors are caused by bas field catalog. Best is to build standard field catalog and then modify:
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'KNA1'
CHANGING
ct_fieldcat = t_fcat
EXCEPTIONS
others = 0.
delete t_fcat where not fieldname = 'KUNNR'.
This field catalog has much more: F1 Help, I/O Conversion and everything.
Regards,
Clemens
‎2007 Feb 16 3:29 AM
data : repid like sy-repid.
repid = sy-repid.
w_fcat-fieldname = 'KUNNR'.
w_fcat-seltext_m = 'Customer'.
w_fcat-col_pos = 1.
append w_fcat to t_fcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = t_fcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ty_kna1
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = ty_kna1
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.
if it does not work after the changes i have told justcheck in debug mode whether your itab is getting populated or not. before calling the reuse alv in debug mode.
regards
shiba dutta