12-03-2007 1:38 PM
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
12-03-2007 1:54 PM
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 .
12-03-2007 1:42 PM
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
12-03-2007 1:44 PM
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
12-03-2007 1:54 PM
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 .