Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

please let me know where i have to correct for my alv display

Former Member
0 Kudos

perform display_report.

FORM display_report .

IF NOT itab[] IS INITIAL.

PERFORM create_fldcat.

PERFORM create_layout.

PERFORM display_report_alv.

else.

MESSAGE s047.

endif.

ENDFORM.

FORM create_fldcat .

REFRESH t_report_fieldcat.

PERFORM add_report_fields USING:

'1' 'component' c_report_tabname text-001 ,

'2' 'release' c_report_tabname text-002 ,

'3' 'EXTRELEASE' c_report_tabname text-003 ,

'4' 'COMP_TYPE' c_report_tabname text-004 .

ENDFORM. " create_fldcat

FORM create_layout .

CLEAR w_layout.

w_layout-colwidth_optimize = 'X'. "Optimise column width

w_layout-zebra = 'X'. "Stripy rows

w_layout-cell_merge = 'X'. "Merge cells

ENDFORM. " create_layout

FORM display_report_alv .

DATA: v_repid LIKE sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = v_repid

is_layout = w_layout

    • it_sort = t_report_sort "DS1K932739*

it_fieldcat = t_report_fieldcat

TABLES

t_outtab = itab.

ENDFORM. " display_report_alv

FORM add_report_fields

USING &1 TYPE any

&2 TYPE any

&3 TYPE any

&4 TYPE any.

CLEAR w_report_fieldcat.

w_report_fieldcat-col_pos = &1.

w_report_fieldcat-fieldname = &2.

w_report_fieldcat-tabname = &3.

w_report_fieldcat-reptext_ddic = &4.

w_report_fieldcat-seltext_l = &4.

w_report_fieldcat-seltext_m = &4.

w_report_fieldcat-seltext_s = &4.

APPEND w_report_fieldcat TO t_report_fieldcat.

ENDFORM. " add_report_fields

in the debugging mode i came to know that &1,&2,&3,&4 are not referring to the location they have to.

can anyone tell me the solution please. i am new to ALV and trying to work onthis.

<REMOVED BY MODERATOR>

<LOCKED BY MODERATOR - URGENT, PLEASE HELP OR SIMILAR ARE FORBIDDEN>

requesting an immediate help in this regard.

thanks in advance

Edited by: Alvaro Tejada Galindo on Jun 25, 2008 3:44 PM

Edited by: Alvaro Tejada Galindo on Jun 25, 2008 4:03 PM

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

Error is with this lines...

'1' 'component' c_report_tabname text-001 ,
'2' 'release' c_report_tabname text-002 ,
'3' 'EXTRELEASE' c_report_tabname text-003 ,
'4' 'COMP_TYPE' c_report_tabname text-004 .

correction

'1' 'COMPONENT' c_report_tabname text-001 ,
'2' 'RELEASE' c_report_tabname text-002 ,
'3' 'EXTRELEASE' c_report_tabname text-003 ,
'4' 'COMP_TYPE' c_report_tabname text-004 .

6 REPLIES 6

Former Member
0 Kudos

use macro instead of SR add_report_fields.

Pl. see the modified code:

perform display_report.

FORM display_report .

IF NOT itab[] IS INITIAL.

PERFORM create_fldcat.

PERFORM create_layout.

PERFORM display_report_alv.

else.

MESSAGE s047.

endif.

ENDFORM.

FORM create_fldcat .

REFRESH t_report_fieldcat.

add_report_fields:

'1' 'COMPONENT' c_report_tabname text-001 ,

'2' 'RELEASE' c_report_tabname text-002 ,

'3' 'EXTRELEASE' c_report_tabname text-003 ,

'4' 'COMP_TYPE' c_report_tabname text-004 .

ENDFORM. " create_fldcat

FORM create_layout .

CLEAR w_layout.

w_layout-colwidth_optimize = 'X'. "Optimise column width

w_layout-zebra = 'X'. "Stripy rows

w_layout-cell_merge = 'X'. "Merge cells

ENDFORM. " create_layout

FORM display_report_alv .

DATA: v_repid LIKE sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = v_repid

is_layout = w_layout

  • it_sort = t_report_sort "DS1K932739

it_fieldcat = t_report_fieldcat

TABLES

t_outtab = itab.

ENDFORM. " display_report_alv

define add_report_fields.

CLEAR w_report_fieldcat.

w_report_fieldcat-col_pos = &1.

w_report_fieldcat-fieldname = &2.

w_report_fieldcat-tabname = &3.

w_report_fieldcat-reptext_ddic = &4.

w_report_fieldcat-seltext_l = &4.

w_report_fieldcat-seltext_m = &4.

w_report_fieldcat-seltext_s = &4.

APPEND w_report_fieldcat TO t_report_fieldcat.

end-of-definition. " add_report_fields

Regards,

Joy.

Edited by: Joyjit Ghosh on Jun 25, 2008 5:39 PM

former_member188685
Active Contributor
0 Kudos

Error is with this lines...

'1' 'component' c_report_tabname text-001 ,
'2' 'release' c_report_tabname text-002 ,
'3' 'EXTRELEASE' c_report_tabname text-003 ,
'4' 'COMP_TYPE' c_report_tabname text-004 .

correction

'1' 'COMPONENT' c_report_tabname text-001 ,
'2' 'RELEASE' c_report_tabname text-002 ,
'3' 'EXTRELEASE' c_report_tabname text-003 ,
'4' 'COMP_TYPE' c_report_tabname text-004 .

former_member188685
Active Contributor
0 Kudos

Use Caps' for field names when you are builidng the fieldcatalog.

0 Kudos

hi

one more doubt.

'1' 'COMPONENT' c_report_tabname text-001 ,

should the number of entries in the above row be equal to 4 if i am displaying 4 different fields(i.e. if my display has 4 collumns)?

i didnt exactly undstd this.

0 Kudos

Hi Ravi,

No of pass by value in Subroutine(FORM) call has nothing to do with no.of fiedls which you are going to display in ALV.

The No.of pass by value in Subroutine call depend on how many pass by value parameters you have used in the Subroutine Definition.

Rewards if it helps.

Thanks,

Vigneswaran S

Former Member
0 Kudos

thanks alot friends . my issue is solved. i hv to use capitals in blding field catalog.

thanks alot.