Application Development and Automation 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: 
Read only

using call function 'REUSE_ALV_FIELDCATALOG_MERGE'

Former Member
0 Likes
1,879

Hi All,

I want to fetch data for one column (customer name column) in my customized report that I have copied from the standard SAP report(FBL3N).

I think we will use function module 'REUSE_ALV_FIELDCATALOG_MERGE' for doing so, but please explain how to do this.

If there are other methods for doing the same, please let me know.

Regards,

Ravindra

Edited by: Ravindra Singh on Mar 25, 2008 12:10 PM

1 ACCEPTED SOLUTION
Read only

Clemenss
Active Contributor
0 Likes
796

Hi Ravindra,

REUSE_ALV_FIELDCATALOG_MERGE is used to create the field catalog required for display in ALV list viewer. It is never used to fetch any data.

If your new field is part of display structure RFPOSXEXT, it will show up automatically.

Regards,

Clemens

Hi All,

I want to fetch data for one column (customer name column) in my customized report that I have copied from the standard SAP report(FBL3N).

I think we will use function module 'REUSE_ALV_FIELDCATALOG_MERGE' for doing so, but please explain how to do this.

If there are other methods for doing the same, please let me know.

Regards,

Ravindra

Edited by: Ravindra Singh on Mar 25, 2008 12:10 PM

4 REPLIES 4
Read only

Former Member
0 Likes
796

Hi,

Use like this

data: iline type table of zstock with header line.

data: gt_fieldcat type slis_t_fieldcat_alv.

perform setup-fieldcatalog using gt_fieldcat[].

form setup-fieldcatalog using fieldcat type slist_fieldcat_alv.

data: ls_fieldcat type slis_fieldcat_alv.

call function 'REUSE_ALV_FIELDCATALOG_MERGE'

exporting

i_internal_tabname = 'ILINE'

i_structure_name = 'ZSTOCK'

changing

ct_fieldcat = _fieldcat.

loop at fieldcat into lsfieldcat.

case ls_fieldcat-fieldname.

when 'DEPT'.

ls_fieldcat-no_out = 'X'.

when 'DESCR'.

ls_fieldcat-no_out = 'X'.

when 'GOOD_PRD'.

ls_fieldcat-do_sum = 'X'.

endcase.

modify fieldcat from lsfieldcat.

endloop.

endform. " FIELDCATALOG

Ravi

Read only

Former Member
0 Likes
796

function REUSE_ALV_FIELDCATALOG_MERGE

An example :-

Please note that structure ZSTOCK is a custom table and iline looks as follow :-

data: iline type table of zstock with header line.

data: gt_fieldcat type slis_t_fieldcat_alv.

perform setup-fieldcatalog using gt_fieldcat[].

form setup-fieldcatalog using fieldcat type slist_fieldcat_alv.

data: ls_fieldcat type slis_fieldcat_alv.

call function 'REUSE_ALV_FIELDCATALOG_MERGE'

exporting

i_internal_tabname = 'ILINE'

i_structure_name = 'ZSTOCK'

changing

ct_fieldcat = _fieldcat.

loop at fieldcat into lsfieldcat.

case ls_fieldcat-fieldname.

when 'DEPT'.

ls_fieldcat-no_out = 'X'.

when 'DESCR'.

ls_fieldcat-no_out = 'X'.

when 'GOOD_PRD'.

ls_fieldcat-do_sum = 'X'.

endcase.

modify fieldcat from lsfieldcat.

endloop.

endform. " FIELDCATALOG

Read only

Former Member
0 Likes
796

The function REUSE_ALV_FIELDCATALOG_MERGE is used for retrieve a catalog=

from a table defined in DDICT. Then you can modify it as you want. You=

can see an example in BALV* programs demos.

Look this example:

in the program J_1AINFG is called as:

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' =20

EXPORTING =20

i_internal_tabname = TABLEINT

i_structure_name = 'J_1AIFALVHDR' =20

CHANGING =20

ct_fieldcat = i_fieldcat[]. =20

where i_structure name is defined in DDICT. Then you can add, delete, or=

modify masks, lengths, etc. properties of fields in this table.

In my program I need add a lot of fields

LOOP AT i_fieldcat INTO wa_fieldcat. =20

MOVE wa_fieldcat TO wa_auxfieldcat. =20

CASE wa_fieldcat-col_pos. =20

WHEN 27. =20

CLEAR wa_fieldcat. =20

wa_fieldcat-fieldname = 'COEFIC1'. =20

wa_fieldcat-tabname = g_tabname_header. =20

wa_fieldcat-col_pos = 27. =20

wa_fieldcat-seltext_s = 'Coef.Per.'. =20

wa_fieldcat-seltext_m = 'Coefic.Per=EDodo'. =20

wa_fieldcat-seltext_l = 'Coeficiente del Per=EDodo'. =20

wa_fieldcat-outputlen = 9. =20

wa_fieldcat-just = 'R'. =20

APPEND wa_fieldcat TO auxcatalogo. =20

ADD 1 TO wa_auxfieldcat-col_pos. =20

..

ENDCASE.

ENDLOOP.

i_fieldcat[] = auxcatalogo[].

This is the table that you show in ALV format.

Try modify some fields and see the layout.

In the called program use the REUSE_ALV_HIERSEQ_LIST_DISPLAY

but is similar for the REUSE_ALV_LIST_DISPLAY.

Regards ,

Muneesh Gitta

Read only

Clemenss
Active Contributor
0 Likes
797

Hi Ravindra,

REUSE_ALV_FIELDCATALOG_MERGE is used to create the field catalog required for display in ALV list viewer. It is never used to fetch any data.

If your new field is part of display structure RFPOSXEXT, it will show up automatically.

Regards,

Clemens