‎2006 Mar 27 9:35 AM
Hi to all..
I had created a new inbound function module for delivery, while testing it at WE19 through option 'Test Inbound idoc via a function module' checking the options 'call in debugging mode' & 'in foreground' am getting an error called interface for function 'XXX...'is incorrect, i think the code is right coz am just retreving a single field and passing that data to a call transaction.
Can any one pls suggest how to resolve this.
Thanks in advance.
Regards,
Shinoy
‎2006 Mar 27 9:52 AM
Hi Shinoy,
Does your inbound FM has all parameters:
" IMPORTING
*" VALUE(INPUT_METHOD) LIKE BDWFAP_PAR-INPUTMETHD
*" VALUE(MASS_PROCESSING) LIKE BDWFAP_PAR-MASS_PROC
*" EXPORTING
*" VALUE(WORKFLOW_RESULT) LIKE BDWFAP_PAR-RESULT
*" VALUE(APPLICATION_VARIABLE) LIKE BDWFAP_PAR-APPL_VAR
*" VALUE(IN_UPDATE_TASK) LIKE BDWFAP_PAR-UPDATETASK
*" VALUE(CALL_TRANSACTION_DONE) LIKE BDWFAP_PAR-CALLTRANS
*" TABLES
*" IDOC_CONTRL STRUCTURE EDIDC
*" IDOC_DATA STRUCTURE EDIDD
*" IDOC_STATUS STRUCTURE BDIDOCSTAT
*" RETURN_VARIABLES STRUCTURE BDWFRETVAR
*" SERIALIZATION_INFO STRUCTURE BDI_SER
Regards,
John.
‎2006 Mar 27 9:58 AM
Hi John,
I had all the parameters as you mentioned, can u lookup the code...
FUNCTION-POOL Z_RCPT_ADV. "MESSAGE-ID ..
*Constants declaration.
CONSTANTS: c_mod type c value 'A',
c_upd type c value 'S',
c_idoc_type TYPE edi_idoctp VALUE 'DELVRY03'.
DATA: v_docnum LIKE bdidocstat-docnum,
v_vbeln LIKE likp-vbeln,
wa_E1EDK07 LIKE E1EDK07.
*Work Area Declaration
DATA: v_doctyp TYPE EDIDC.
*Internal table declaration
DATA: BEGIN OF i_bdcmsgcoll OCCURS 0.
INCLUDE STRUCTURE bdcmsgcoll.
DATA: END OF i_bdcmsgcoll.
DATA: BEGIN OF bdc_data OCCURS 100.
INCLUDE STRUCTURE BDCDATA.
DATA: END OF bdc_data.
-
FUNCTION Z_RCPT_ADV_VL32N.
*"----
""Local interface:
*" IMPORTING
*" VALUE(INPUT_METHOD) LIKE BDWFAP_PAR-INPUTMETHD
*" VALUE(MASS_PROCESSING) LIKE BDWFAP_PAR-MASS_PROC
*" EXPORTING
*" VALUE(WORKFLOW_RESULT) LIKE BDWFAP_PAR-RESULT
*" VALUE(APPLICATION_VARIABLE) LIKE BDWFAP_PAR-APPL_VAR
*" VALUE(IN_UPDATE_TASK) LIKE BDWFAP_PAR-UPDATETASK
*" VALUE(CALL_TRANSACTION_DONE) LIKE BDWFAP_PAR-CALLTRANS
*" TABLES
*" IDOC_CONTROL STRUCTURE EDIDC
*" IDOC_DATA STRUCTURE EDIDD
*" IDOC_STATUS STRUCTURE BDIDOCSTAT
*" RETURN_VARIABLES STRUCTURE BDWFRETVAR
*" SERIALIZATION_INFO STRUCTURE BDI_SER
*" EXCEPTIONS
*" WRONG_FUNCTION_CALLED
*"----
v_docnum = idoc_control-docnum.
Check if the function called correctly
READ TABLE idoc_control INDEX 1.
IF SY-SUBRC <> 0.
EXIT.
ELSEIF v_doctyp-idoctp <> c_idoc_type.
RAISE wrong_function_called.
ENDIF.
LOOP AT idoc_control. " Check all idocs.
CHECK NOT idoc_data is INITIAL.
READ TABLE idoc_data WITH KEY docnum = v_docnum
segnam = 'E1EDK07'.
wa_E1EDK07 = idoc_data-sdata.
v_vbeln = wa_E1EDK07-vbeln.
REFRESH bdc_data.
CLEAR bdc_data.
bdc_data-program = 'SAPMV50A'.
bdc_data-dynpro = '4140'.
bdc_data-dynbegin = 'X'.
bdc_data-fnam = 'LIKP-VBELN'.
bdc_data-fval = v_vbeln.
APPEND bdc_data.
bdc_data-dynbegin = ' '.
bdc_data-fnam = 'BDC_OKCODE'.
bdc_data-fval = '=WABU_T'.
APPEND bdc_data.
Call VL32N with generated data
CALL TRANSACTION 'VL32N'
USING bdc_data
MODE c_mod
UPDATE c_upd
MESSAGES INTO i_bdcmsgcoll.
READ TABLE i_bdcmsgcoll TRANSPORTING NO FIELDS
WITH KEY MSGTYP = 'E'.
IF SY-SUBRC = 0.
idoc_status-docnum = v_docnum.
idoc_status-status = '51'.
idoc_status-msgid = 'ZWWU_PM'.
idoc_status-msgno = '000'.
idoc_status-msgv1 = i_bdcmsgcoll-MSGV1.
idoc_status-msgv2 = i_bdcmsgcoll-MSGV2.
APPEND idoc_status.
CLEAR idoc_status.
workflow_result = '99999'.
return_variables-wf_param = 'ERROR_IDOCS'.
return_variables-doc_number = idoc_control-docnum.
APPEND return_variables.
ENDIF.
REFRESH idoc_status.
REFRESH i_bdcmsgcoll.
ENDLOOP. " End of idoc_control loop.
ENDFUNCTION.
‎2006 Mar 27 10:22 AM
Hi Shinoy,
Your code is ok, but there should be something wrong with the interface of the FM, as you don't enter the debugger but get an error message. Is the message type you are using correctly assigned to this FM?
Regards,
John.
‎2006 Mar 27 1:47 PM
John thanx for the suggestion, i solved the problem myself, coz at the FM table parameters instead of 'IDOC_CONTRL' i had mentioned IDOC_CONTROL'.
‎2006 Mar 27 10:13 AM
Could it be possible that one or more objects in the Function Group have not been activated ?
Please make sure all includes are activated.