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: 

use of FM: REUSE_ALV_FIELDCATALOG_MERGE

Former Member
0 Kudos

hi all,

i am using the FM REUSE_ALV_FIELDCATALOG_MERGE.

in the parameters when i pass structure name then it works fine.

but when i am using internal table and want to pass to the FM then it gives me the dump.so how can i use internal table.........

thanks in advance

regards

nilesh

8 REPLIES 8

Former Member
0 Kudos

Hi,

You need to pass structure only and program bname.

It will give you field catalog back in internal table and u ned to pass that to main ALV_GRID or ALV_LIST FM.

example :

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = l_repid

i_structure_name = l_struc_name

CHANGING

ct_fieldcat = cht_fieldcat

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

former_member404244
Active Contributor
0 Kudos

Hi ,

chk the below example.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = v_repid

i_internal_tabname = 'I_FINAL'

i_inclname = v_repid

CHANGING

ct_fieldcat = i_fieldcat

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

regards,

nagaraj

0 Kudos

i got the solution, but i am not getting why is it necessary to pass the report name in i_inclname as we already passed it in i_program_name.........

thank you

nilesh

Former Member
0 Kudos

Hi Nilesh,

Are you sure that the internal table declaration is correct and agrees with what is expected by the FM.(SLIS_TABNAME)

Also, what does the dump say?

Regs,

Sameer

Former Member
0 Kudos

Hi,

The only problem one might have is that the report and table names

need to be in capital letters.*

  • Store report name

i_repid = sy-repid.

  • Create Fieldcatalogue from internal table

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = i_repid

I_INTERNAL_TABNAME = 'IMAT' "capital letters!

I_INCLNAME = i_repid

CHANGING

CT_FIELDCAT = int_fcat

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3.

Hope it helps.

Reward if helpful.

Regards,

Sipra

Former Member
0 Kudos

pass one more variable

i_inclname = ur program name...

if u still getting dump...

post d declaration of ur table types...ok

(ex:in d declaration like matnr TYPE mara-matnar)

Ramesh.

Former Member
0 Kudos

ass one more variable

i_inclname = ur program name...

and

also make sure that all d parameters which u r passing should b written in CAPITAL letters not in small letters..

if u still getting dump...

post d declaration of ur table types...ok

(ex:in d declaration like matnr TYPE mara-matnar)

Ramesh.

former_member404244
Active Contributor
0 Kudos

Hi Nilesh,

its required..

please award with points to the answers which u find helpful..

regards,

nagaraj

Message was edited by: nagaraj kumar nishtala