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: 

Type conflict error

Former Member
0 Kudos

Hi all,

I am using    HR_MAINTAIN_MASTERDATA

Though I have declared correct parameters a runtime error is generating.

Type conflict while calling fm.

DATA : it_return TYPE TABLE OF  BAPIRETURN1,

        wa_return TYPE   BAPIRETURN1,

        it_message TYPE TABLE OF BAPIRETURN1,

        wa_message TYPE BAPIRETURN1.

CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'

                      EXPORTING

                        PERNR                    = wa_final-pernr

                        ACTIO                    = 'INS'

                        TCLAS                    = 'A'

                        BEGDA                    = wa_final-begda

                        ENDDA                    = '99991231'

                        SEQNR                    = '000'

                        PLANS                    = '00000000'

                        DIALOG_MODE              = '0'

                        LUW_MODE                 = '1'

*                       NO_EXISTENCE_CHECK       = ' '

*                       NO_ENQUEUE               = ' '

                      IMPORTING

*                       RETURN                   =

                        RETURN1                  = it_return

*                       HR_RETURN                =

                       TABLES

                         proposed_values          = proposed_values

*                       MODIFIED_KEYS            =

1 ACCEPTED SOLUTION

0 Kudos

Hi ,

The parameter RETURN1 is a STRUCTURE, not TABLE

Please change the statement "DATA : it_return TYPE TABLE OF  BAPIRETURN1,"

into "DATA : it_return like BAPIRETURN1," and try again.

Hope this would help~

Regards

Cheng

19 REPLIES 19

nishant_krishen3
Explorer
0 Kudos

Hi ,

Please check the data type of all import and export parameter data type . All parameter should be same data type as declared in HR_MAINTAIN_MASTERDATA' this module.

Regards

Nishant

0 Kudos

Nishant ,

I am getting this error in Return parameter. As you can see I have declared the return parameter same as there in the FM.

0 Kudos

You have not declared the RETURN parameter as it is in the function module. RETURN is an EXPORTING parameter that is defined LIKE BAPIRETURN.

nishant_krishen3
Explorer
0 Kudos

Hi ,

Declare this way,

DATA : it_return like  BAPIRETURN1,

         wa_return TYPE   BAPIRETURN1,

         it_message TYPE TABLE OF BAPIRETURN1,

         wa_message TYPE BAPIRETURN1.

DATA : proposed_values TYPE TABLE OF PPROP.


Regards

Nsihant

0 Kudos

Actually I am using it_return in loop for getting messages.

LOOP AT it_return INTO wa_return .

       wa_message = wa_return.

       APPEND wa_message to it_message.

       clear wa_message.

   ENDLOOP.


so in your case the system will fire an error of header line.

I dont know but the declaration is correct though the runtime error is generated.

0 Kudos

Hi ,

You can write this like,

it_return TYPE TABLE OF BAPIRETURN1 WITH HEADER LINE,


Than you can write-


loop at it_return .

   wa_message = it_return-message.

       APPEND wa_message to it_message.

       clear wa_message.

endloop.


0 Kudos

If I write with header line then what is the need to declare workarea for it?

0 Kudos

No need to declare.

0 Kudos

Nishant Krishen wrote:

it_return TYPE TABLE OF BAPIRETURN1 WITH HEADER LINE,


This is BAD ADVICE. Never use tables with header lines. They are obsolete, and bad programming.

Former Member
0 Kudos

hi,

please post the full error log.

with error line number.

and post the data declaration of proposed_values , wa_final.

Regards,

Satyen

0 Kudos

Hi ,

The parameter RETURN1 is a STRUCTURE, not TABLE

Please change the statement "DATA : it_return TYPE TABLE OF  BAPIRETURN1,"

into "DATA : it_return like BAPIRETURN1," and try again.

Hope this would help~

Regards

Cheng

0 Kudos

Panda I declared as you said. But when I loop on it_return gives 'Neither specified under tables'.

0 Kudos

HI Yash,

Have you used my code. if there is any issue tell me.

Reagrds

Nishant

0 Kudos

As wrote, this return parameter is not an internal table just a single structure, no LOOP required, append the unique record (if not initial) to your message itab.

IF it_return-message IS NOT INITIAL.
   wa_message = it_return-message. " if length/type differs
   APPEND wa_message TO it_message. " else just  APPEND it_return-message TO it_message.
ENDIF.

Take also the habit of using SCI to check your codes (Menu : Program, check, code inspector)

Regards,
Raymond

0 Kudos

Hello Yash,

    The it_return works as a structure. So if you declare it as it_return TYPE bapireturn, I guess you can find the return message. As it's not internal table, you won't be able to LOOP on it.

Regards,

Anubhab

0 Kudos

Thank you Nishant.

I tried with using with header line.

Thank you.

0 Kudos

This message was moderated.

Former Member
0 Kudos

HI ,

The parameter return1 is in IMPORTING parameter, not in tables.

So u pass wa_return instead of it_return. Your problem will be solved.

Thanks

vijay

0 Kudos

If an importing parameter is affected to a table type (that is not the case)  it will be an internal table...

eg. : RETURN TYPE BAPIRET1_LIST. " is an internal table of records with BAPIRET1 structure

Regards,

Raymond