04-16-2014 6:41 AM
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 =
04-16-2014 6:55 AM
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
04-16-2014 6:43 AM
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
04-16-2014 6:45 AM
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.
04-16-2014 8:40 AM
You have not declared the RETURN parameter as it is in the function module. RETURN is an EXPORTING parameter that is defined LIKE BAPIRETURN.
04-16-2014 6:53 AM
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
04-16-2014 6:58 AM
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.
04-16-2014 7:09 AM
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.
04-16-2014 7:22 AM
If I write with header line then what is the need to declare workarea for it?
04-16-2014 7:24 AM
04-16-2014 8:38 AM
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.
04-16-2014 6:55 AM
hi,
please post the full error log.
with error line number.
and post the data declaration of proposed_values , wa_final.
Regards,
Satyen
04-16-2014 6:55 AM
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
04-16-2014 7:34 AM
Panda I declared as you said. But when I loop on it_return gives 'Neither specified under tables'.
04-16-2014 7:38 AM
HI Yash,
Have you used my code. if there is any issue tell me.
Reagrds
Nishant
04-16-2014 7:38 AM
As Panda 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
04-16-2014 7:47 AM
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
04-16-2014 8:04 AM
Thank you Nishant.
I tried with using with header line.
Thank you.
04-16-2014 8:13 AM
04-16-2014 8:21 AM
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
04-16-2014 8:33 AM
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