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: 

Hw to correct this error in BDC ?

Former Member
0 Kudos

Hi experts,

I am getting the error while excuting the BDC form statement

LOOP AT int_record.

PERFORM format_message using int_record-msgid

int_record-MSGNR

int_record-msgv1

int_record-msgv2

int_record-msgv3

int_record-msgv4.

ENDLOOP.

ENDFORM. " f_bdc_output

**********************************************************************

  • FORM : format_message

  • Created : 03.12.2007 17:13:28

**********************************************************************

FORM format_message USING P_MSGID LIKE SY-MSGID

P_msgnr LIKE SY-MSGNO

P_MSGV1 LIKE SY-MSGV1

P_MSGV2 LIKE SY-MSGV2

P_MSGV3 LIKE SY-MSGV3

P_MSGV4 LIKE SY-MSGV4.

Th error is given below :

"In PERFORM or CALL FUNCTION "FORMAT_MESSAGE", the actual parameter

"INT_RECORD-MSGNR" is incompatible with the formal parameter "P_MSGNR"."

Can anyone help me to solve this problem

Thanks

Sakthi C

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Try like this...



LOOP AT int_record.

PERFORM format_message using int_record-msgid
int_record-MSGNR
int_record-msgv1
int_record-msgv2
int_record-msgv3
int_record-msgv4.

ENDLOOP.
ENDFORM. " f_bdc_output
**********************************************************************
* FORM : format_message
* Created : 03.12.2007 17:13:28
**********************************************************************
FORM format_message USING 
P_MSGID  "Automaticlly refers to calling parameters
P_msgnr 
P_MSGV1 
P_MSGV2 
P_MSGV3 
P_MSGV4 .

3 REPLIES 3

Former Member
0 Kudos

Sakthi,

I didn't find any error in calling subroutine.

Try using TYPE instead of LIKE or pass MSGNO to a variable and use that variable in function module.

Regards,

Satish

JozsefSzikszai
Active Contributor
0 Kudos

hi Sakthi,

this is beacuse int_record-msgid is different type than SY-MSGID (dirrenet legth and/or type). A fast solution is to change like:

FORM format_message USING P_MSGID TYPE ANY, and so on...

Slower (but nicer) solution is to search for the data element of int_record-msgid and TYPE-ing with that data elemnt in the FORM.

hope this helps

ec

Former Member
0 Kudos

Try like this...



LOOP AT int_record.

PERFORM format_message using int_record-msgid
int_record-MSGNR
int_record-msgv1
int_record-msgv2
int_record-msgv3
int_record-msgv4.

ENDLOOP.
ENDFORM. " f_bdc_output
**********************************************************************
* FORM : format_message
* Created : 03.12.2007 17:13:28
**********************************************************************
FORM format_message USING 
P_MSGID  "Automaticlly refers to calling parameters
P_msgnr 
P_MSGV1 
P_MSGV2 
P_MSGV3 
P_MSGV4 .