Skip to Content
0
Former Member
Sep 27, 2012 at 09:27 AM

ALV Grid/List issue

15 Views

Hi All,

I have a particular issue in ALV grid, (using the REUSE_ALV_GRID_DISPLAY FM).

While displaying the output, if the output table has only 1 record, in that case the output is Grid, which is correct.

However, if the output is multiple records (more than 1) then output is in LIST format which is NOT the expected output. I am trying to figure out the reason but not of much use. could you guys please help here?

code snippet is:

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_BUFFER_ACTIVE = 'X'

i_callback_program = gv_repid

i_callback_user_command = 'USER_COMMAND' "To call the VA03 tcode on click of delivery number

i_callback_pf_status_set = 'PFSTATUS' "To display standard PF Status

is_layout = gs_layout

it_fieldcat = gt_fieldcat

TABLES

t_outtab = gt_output.

FORM build_layout .

gs_layout-zebra = 'X'.

gs_layout-colwidth_optimize = 'X'.

ENDFORM.

DATA: lv_count TYPE i.

lv_count = lv_count + 1.

gs_fieldcat-fieldname = 'VBELN'.

gs_fieldcat-tabname = 'GT_OUTPUT'.

gs_fieldcat-seltext_l = text-002.

gs_fieldcat-hotspot = 'X'.

gs_fieldcat-col_pos = lv_count.

APPEND gs_fieldcat TO gt_fieldcat.

CLEAR gs_fieldcat.

lv_count = lv_count + 1.

gs_fieldcat-fieldname = 'PLNUM'.

gs_fieldcat-tabname = 'GT_OUTPUT'.

gs_fieldcat-seltext_l = text-003.

gs_fieldcat-col_pos = lv_count.

APPEND gs_fieldcat TO gt_fieldcat.

CLEAR gs_fieldcat.

lv_count = lv_count + 1.

gs_fieldcat-fieldname = 'AUFNR'.

gs_fieldcat-tabname = 'GT_OUTPUT'.

gs_fieldcat-seltext_l = text-004.

gs_fieldcat-col_pos = lv_count.

APPEND gs_fieldcat TO gt_fieldcat.

CLEAR gs_fieldcat.

lv_count = lv_count + 1.

gs_fieldcat-fieldname = 'MESSAGE'.

gs_fieldcat-tabname = 'GT_OUTPUT'.

gs_fieldcat-seltext_l = text-005.

gs_fieldcat-col_pos = lv_count.

APPEND gs_fieldcat TO gt_fieldcat.

CLEAR gs_fieldcat.