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

Run-time error

Former Member
0 Likes
1,133

Hi,

I developed a report program and when I try to execute the program,I am getting a run-time error as

'The call to the function module "REUSE_ALV_FIELDCATALOG_MERGE" is incorrect:

The function module interface allows you to specify only

fields of a particular type under "I_INTERNAL_TABNAME".

The field "T_OUTPUT" specified here is a different

field type.'

The internal table T_OUTPUT is my output internal table.I have declared it in the program as follows.

types: begin of ty_output,

empid like zheempl-empid,

grade like zheempl-grade,

location like zheempl-location,

pu like zheempl-pu,

name1 like zheempl-name1,

role like zhealoc-role,

stdat like zhealoc-stdat,

endat like zhealoc-endat,

end of ty_output.

data: t_output type standard table of ty_output.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = W_PROG

I_INTERNAL_TABNAME = T_OUTPUT

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = W_PROG

I_BYPASSING_BUFFER = 'X'

  • I_BUFFER_ACTIVE =

CHANGING

ct_fieldcat = T_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.

When do we get this kind of error and what would be the reason for the error?

10 REPLIES 10
Read only

former_member156446
Active Contributor
0 Likes
1,071

Refer to [this link>>|http://www.sap-img.com/fu015.htm] on delerations of *merge

Read only

Former Member
0 Likes
1,071

Hi,

declare the Internal table like below and pass to FM...

DATA : begin of T_OUTPUT occurs 0,

empid like zheempl-empid,

grade like zheempl-grade,

location like zheempl-location,

pu like zheempl-pu,

name1 like zheempl-name1,

role like zhealoc-role,

stdat like zhealoc-stdat,

endat like zhealoc-endat,

end of T_OUTPUT.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = W_PROG

I_INTERNAL_TABNAME = 'T_OUTPUT'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = W_PROG

I_BYPASSING_BUFFER = 'X'

  • I_BUFFER_ACTIVE =

CHANGING

ct_fieldcat = T_FIELDCAT

  • EXCEPTIONS

  • INCONSISTENT_INTERFACE = 1

  • PROGRAM_ERROR = 2

  • OTHERS = 3

.

Hope it works!!

Rgds,

Pavan

Read only

Former Member
0 Likes
1,071

Change

I_INTERNAL_TABNAME = T_OUTPUT

to

I_INTERNAL_TABNAME = 'T_OUTPUT'

Cheers,

Neil.

Read only

0 Likes
1,071

Hi,

Thank you.I have passed T_OUTPUT internal table in single quotes.Now the program is not throwing any run-time error but T_FIELDCAT internal table is empty.

Read only

0 Likes
1,071

Hi,

Are you passing sy-repid to W_prog?

Regards,

Ankur Parab

Read only

0 Likes
1,071

Yes I am passing sy-repid to w_prog.But still T_FIELDCAT is empty.

Read only

0 Likes
1,071

You cannot use TYPE when declaring the internal table. You have to use LIKE if you want to use the fielcat FM.

Read only

Former Member
0 Likes
1,071

Try this,

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = W_PROG
* I_INTERNAL_TABNAME = T_OUTPUT
* I_STRUCTURE_NAME =
* I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = W_PROG
I_BYPASSING_BUFFER = 'X'
* I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = T_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

Read only

saumya_govil
Active Contributor
0 Likes
1,071

Hi,

Pass internal table as :

I_INTERNAL_TABNAME = 'T_OUTPUT'

Hope this helps!

Regards,

Saumya

Read only

saumya_govil
Active Contributor
0 Likes
1,071

Hi,

You need to maintain the field catalog yourself using the following code:


Data : i_fieldcat TYPE slis_t_fieldcat_alv.

fc_tmp-fieldname  = 'FIELDNAME'.
  fc_tmp-tabname   = 'T_OUTPUT'.
  fc_tmp-outputlen  = '20'.
  fc_tmp-col_pos    = 1.
  APPEND fc_tmp TO i_fieldcat.

  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
   EXPORTING
*   I_INTERFACE_CHECK              = ' '
     i_bypassing_buffer             = 'X'
     i_buffer_active                = ' '
     i_callback_program             = '<report name> '
*   I_CALLBACK_PF_STATUS_SET       = ' '
*   I_CALLBACK_USER_COMMAND        = ' '
*   I_STRUCTURE_NAME               =
*   IS_LAYOUT                      =
     it_fieldcat                    = i_fieldcat
*   IT_EXCLUDING                   =
*   IT_SPECIAL_GROUPS              =
*   IT_SORT                        =
*   IT_FILTER                      =
*   IS_SEL_HIDE                    =
*   I_DEFAULT                      = 'X'
     i_save                         = 'A'
*   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
*   IR_SALV_LIST_ADAPTER           =
*   IT_EXCEPT_QINFO                =
*   I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
* IMPORTING
*   E_EXIT_CAUSED_BY_CALLER        =
*   ES_EXIT_CAUSED_BY_USER         =
    TABLES
      t_outtab                       = t_output.
* EXCEPTIONS
*   PROGRAM_ERROR                  = 1
*   OTHERS                         = 2.

Regards,

Saumya