Sample Custom idoc inbound function module
Hi Friends
I am receiving Inbound Idoc ,I Need to save the IDOC data into ZTable
Plz ..Can any one give me Sample idoc inbound FM to Config the WE20(partner profile)
Regards
Ram
HI Rama,
I presumed that You are talking about a FM to create inbound IDOC. So for creating inbound IDOC you can use '
CALL FUNCTION 'IDOC_INBOUND_ASYNCHRONOUS'
TABLES
idoc_control_rec_40 = gt_edidc
idoc_data_rec_40 = gt_edidd.
IF sy-subrc NE 0.
* MESSAGE e000 WITH text-003.
* ELSE.
* MESSAGE i000 WITH text-004 .
ENDIF.
just prepare edidc and edidd record in and pass it to the FM..
Hope this will work for you...
Thanks
Similar Messages
-
Creating a custom IDoc inbound function module
I have created a custom idoc.I wanted to create a custom IDoc inbound function module, this Function module will provide to launch a BAPI .Tell me how to "create" inbound function module for the custom idoc ?
Goto any standard for the Paramtetres
*" IMPORTING
*" REFERENCE(INPUT_METHOD) LIKE BDWFAP_PAR-INPUTMETHD
*" REFERENCE(MASS_PROCESSING) LIKE BDWFAP_PAR-MASS_PROC
*" EXPORTING
*" REFERENCE(WORKFLOW_RESULT) LIKE BDWFAP_PAR-RESULT
*" REFERENCE(APPLICATION_VARIABLE) LIKE BDWFAP_PAR-APPL_VAR
*" REFERENCE(IN_UPDATE_TASK) LIKE BDWFAP_PAR-UPDATETASK
*" REFERENCE(CALL_TRANSACTION_DONE) LIKE BDWFAP_PAR-CALLTRANS
*" REFERENCE(DOCUMENT_NUMBER) LIKE VBAK-VBELN
*" TABLES
*" IDOC_CONTRL STRUCTURE EDIDC
*" IDOC_DATA STRUCTURE EDIDD
*" IDOC_STATUS STRUCTURE BDIDOCSTAT
*" RETURN_VARIABLES STRUCTURE BDWFRETVAR
*" SERIALIZATION_INFO STRUCTURE BDI_SER
*" EDI_TEXT STRUCTURE EDIORDTXT1 OPTIONAL
*" EDI_TEXT_LINES STRUCTURE EDIORDTXT2 OPTIONAL
Do the below configs.
1.Recognise the funcmod as Inbound -BD51
2.Register the Function module in WE57 .
3.we42 Process code .
4. WE20 -PARTNER Profile
I hope it resolves ur Query.
Rgds
Sree M -
Need help for IDOC inbound function module !
Hi guys please help me to create a IDOC inbound function module.
What are the parameters and tables.
How to write the code.
What it does.
Please send me one inbound func module code if possuble
ThanksHi,
You need to create an inbound function module. Then define the process code in transaction we42 and attach the function module to this process code.
In the function module you create you need to define tables of types EDIDC (Control record (IDoc)), EDIDD (Data record (IDoc)) and BDIDOCSTAT (ALE IDoc status (subset of all IDoc status fields)).
Regards,
Soumya. -
IDOC inbound function module!
Has anybody worked on IDOC inbound function module !
What is the meaning of the following steps !
IDOC_STATUS-DOCNUM = IDOC_CONTROL-DOCNUM.
IDOC_STATUS-STATUS = '51'.
IDOC_STATUS-MSGTY = 'E'
IDOC_STATUS-MSGID = ' ZE'
IDOC_STATUS-MSGNO = '007'
IDOC_STATUS-MSGV1 = IT_LIKP-vbeln.
APPEND IDOC_STATUS.
What are possible values for MSGTY,MSGID, MSGNO.....
What do they mean !
Edited by: Alvaro Tejada Galindo on Mar 10, 2008 7:18 PM"here nothing complicated ...
"status 51 means 'Application document not posted'
"in WE02 you can see this message
IDoc: 0000000000001254 Status: Application document not posted
IDOC_STATUS-DOCNUM = IDOC_CONTROL-DOCNUM. "IDoc number
IDOC_STATUS-STATUS = '51'. "stauts code
IDOC_STATUS-MSGTY = 'E' "error type
IDOC_STATUS-MSGID = ' ZE' "message class ID
IDOC_STATUS-MSGNO = '007' "message number in ZE
IDOC_STATUS-MSGV1 = IT_LIKP-vbeln. "document number or order number
APPEND IDOC_STATUS. -
Problem with IDOC inbound function module
hi
While excecuting the inbound function module in WE19
I am getting error (short dump)
Incorrect parameter with Call transaction.Creating a Function Module (Direct Inbound Processing)
This step describes how to create a function module which is identified by the IDoc Interface using a new process code and called from ALE (field TBD52-FUNCNAME). Direct inbound processing using a function module (not using a workflow) always includes the ALE layer. This setting (processing with function module and ALE layer) is identified by the value 6 in the field TEDE2-EDIVRS, which is read by the function module IDOC_START_INBOUND. IDOC_START_INBOUND then calls ALE.
Prerequisites
You must have completed the required steps in Defining and Using a Basic Type .
Procedure
Choose Tools ® ABAP Workbench ® Development ® Function Builder, and create a new function module.
Create the segments as global data in your function group. The function module should copy the application data from the segments into the corresponding application tables and modify the IDoc status accordingly. If an error occurs, the function module must set the corresponding workflow parameters for exception handling.
Activate the function module: From the initial screen of the Function Builder select .
In the example, create the function module IDOC_INPUT_TESTER with a global interface. The function module is called when an IDoc of type TESTER01 is received for inbound processing. You will assign an application object ("standard order") to this IDoc type and therefore maintain tables from SD. To do this, call transaction VA01 using the command CALL TRANSACTION. Please note that the intention here is not to simulate a realistic standard order, but only to illustrate how data reaches application tables from an IDoc table via segment structures (form routine READ_IDOC_TESTER) and how the function module triggers an event for exception handling (by returning suitable return variables to the ALE layer in the FORM routine RETURN_VARIABLES_FILL).
A comprehensive example of the code for an inbound function module is provided in the ALE documentation in the SAP Library under Example Program to Generate an IDoc. This function module, for example, also checks whether the logical message is correct and calls a (fictitious) second function module which first writes the application data and then returns the number of the generated document. In addition, status 53 is only set if the application document was posted correctly.
Administration parameters for IDOC_INPUT_TESTER
Application abbreviation
V (Sales and Distribution)
Processing type
Normal, start immediately
Interface for IDOC_INPUT_TESTER (global interface)
Formal parameters
Reference structure
Explanation
Import parameters
INPUT_METHOD
BDWFAP_PAR-INPUTMETHD
Describes how the function module is to be processed (example: in the background)
MASS_PROCESSING
BDWFAP_PAR-MASS_PROC
Mass inbound processing? (indicator)
Export parameters
WORKFLOW_RESULT
BDWFAP_PAR-RESULT
Set to 99999 if an event is to be triggered for error handling.
APPLICATION_VARIABLE
BDWFAP_PAR-APPL_VAR
Variable freely available from application for workflow
IN_UPDATE_TASK
BDWFAP_PAR-UPDATETASK
Asynchronous update? (indicator is not set in example)
CALL_TRANSACTION_DONE
BDWFAP_PAR-CALLTRANS
Transaction called? (indicator is not set in example)
Table
IDOC_CONTRL
EDIDC
IDoc control record
IDOC_DATA
EDIDD
IDoc data records
IDOC_STATUS
BDIDOCSTAT
IDoc status records for ALE
RETURN_VARIABLES
BDWFRETVAR
IDoc assigned to Object type method parameters.
SERIALIZATION_INFO
BDI_SER
If several IDocs are to be processed in a certain sequence: this structure contains the necessary information
Example
FUNCTION IDOC_INPUT_TESTER.
""Globale Schnittstelle:
*" 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 OPTIONAL
*" IDOC_DATA STRUCTURE EDIDD
*" IDOC_STATUS STRUCTURE BDIDOCSTAT
*" RETURN_VARIABLES STRUCTURE BDWFRETVAR
*" SERIALIZATION_INFO STRUCTURE BDI_SER
initialize SET/GET Parameter and internal tables
PERFORM INITIALIZE_ORGANIZATIONAL_DATA.
Move IDOC to internal tables of application
PERFORM READ_IDOC_TESTER.
call transaction Order Entry VA01
PERFORM CALL_VA01_IDOC_ORDERS USING ERRORCODE.
set status value
perform write_status_record using errorcode.
return values of function module
PERFORM RETURN_VARIABLES_FILL USING ERRORCODE.
ENDFUNCTION.
FORM INITIALIZE_ORGANIZATIONAL_DATA.
initialize SET/GET parameters
SET PARAMETER ID 'VKO' FIELD SPACE.
SET PARAMETER ID 'VTW' FIELD SPACE.
SET PARAMETER ID 'SPA' FIELD SPACE.
SET PARAMETER ID 'VKB' FIELD SPACE.
SET PARAMETER ID 'VKG' FIELD SPACE.
initialize internal tables
REFRESH BDCDATA.
CLEAR BDCDATA.
CLEAR BELEGNUMMER.
CLEAR ERRTAB.
REFRESH ERRTAB.
REFRESH XBDCMSGCOLL.
CLEAR XBDCMSGCOLL.
ENDFORM. " INITIALIZE_ORGANIZATIONAL_DATA
FORM READ_IDOC_TESTER.
PERFORM INITIALIZE_IDOC.
LOOP AT IDOC_DATA
WHERE DOCNUM = IDOC_CONTRL-DOCNUM.
CASE IDOC_DATA-SEGNAM.
header data
WHEN 'E1HEAD'.
MOVE IDOC_DATA-SDATA TO E1HEAD.
PERFORM PROCESS_SEGMENT_E1HEAD.
position data
WHEN 'E1ITEM'.
MOVE IDOC_DATA-SDATA TO E1ITEM.
PERFORM PROCESS_SEGMENT_E1ITEM.
ENDCASE.
ENDLOOP.
only when there were one or more items
CHECK FIRST NE 'X'.
APPEND XVBAP. "last one
ENDFORM. " READ_IDOC_TESTER
FORM INITIALIZE_IDOC.
CLEAR XVBAK.
REFRESH XVBAP.
CLEAR XVBAP.
POSNR = 0.
FIRST = 'X'.
ENDFORM. " INITIALIZE_IDOC
FORM PROCESS_SEGMENT_E1HEAD.
requested date of delivery
WLDAT = E1HEAD-WLDAT.
delivery date
XVBAK-BSTDK = E1HEAD-BSTDK.
customer number
XVBAK-KUNNR = E1HEAD-AUGEB.
order number
XVBAK-BSTNK = E1HEAD-BELNR.
division
XVBAK-SPART = E1HEAD-SPART.
distribution channel
XVBAK-VTWEG = E1HEAD-VTWEG.
sales organization
XVBAK-VKORG = E1HEAD-VKORG.
order type
XVBAK-AUART = E1HEAD-AUART.
do not fill incoterms (inco1, inco2)
customer function
CALL CUSTOMER-FUNCTION '001'
EXPORTING
PI_VBAK621 = XVBAK
IMPORTING
PE_VBAK621 = XVBAK
TABLES
PT_IDOC_DATA_RECORDS = IDOC_DATA.
ENDFORM. " PROCESS_SEGMENT_E1HEAD
FORM PROCESS_SEGMENT_E1ITEM.
position number
XVBAP-POSNR = XVBAP-POSNR + 1.
amount
XVBAP-WMENG = E1ITEM-MENGE.
unit
CALL FUNCTION 'ISO_TO_SAP_MEASURE_UNIT_CODE'
EXPORTING
ISO_CODE = E1ITEM-BMEINH
IMPORTING
SAP_CODE = XVBAP-VRKME
EXCEPTIONS
OTHERS = 0.
material number
XVBAP-MATNR = E1ITEM-LMATNR.
CALL CUSTOMER-FUNCTION '002'
EXPORTING
PI_VBAP621 = XVBAP
IMPORTING
PE_VBAP621 = XVBAP
TABLES
PT_IDOC_DATA_RECORDS = IDOC_DATA.
APPEND XVBAP.
ENDFORM. " PROCESS_SEGMENT_E1ITEM
FORM CALL_VA01_IDOC_ORDERS USING ERRORCODE.
call transaction first dynpro
PERFORM DYNPRO_START.
call transaction double-line entry
PERFORM DYNPRO_DETAIL2.
incoterms
PERFORM DYNPRO_HEAD_300.
call transaction item datas
PERFORM DYNPRO_POSITION.
PERFORM DYNPRO_SET USING 'BDC_OKCODE' 'SICH'.
determine input method
IF INPUT_METHOD IS INITIAL.
INPUT_METHOD = 'N'.
ENDIF.
call transaction VA01
CALL TRANSACTION 'VA01' USING BDCDATA
MODE INPUT_METHOD
UPDATE 'S'
MESSAGES INTO XBDCMSGCOLL.
errorcode = SY-SUBRC. " remember returncode for status update
ENDFORM. " CALL_VA01_IDOC_ORDERS
form write_status_record using errorcode.
FILL IDOC_STATUS
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IF ERRORCODE = 0.
IDOC_STATUS-STATUS = BELEG_GEBUCHT. "value 53
GET PARAMETER ID 'AUN' FIELD BELEGNUMMER.
IDOC_STATUS-MSGID = 'V1'.
IDOC_STATUS-MSGNO = '311'.
IDOC_STATUS-MSGV1 = 'Terminauftrag'.
IDOC_STATUS-MSGV2 = BELEGNUMMER.
ELSE.
IDOC_STATUS-STATUS = BELEG_NICHT_GEBUCHT. "value 51
IDOC_STATUS-MSGID = SY-MSwGID.
IDOC_STATUS-MSGNO = SY-MSGNO.
IDOC_STATUS-MSGV1 = SY-MSGV1.
IDOC_STATUS-MSGV2 = SY-MSGV2.
IDOC_STATUS-MSGV3 = SY-MSGV3.
IDOC_STATUS-MSGV4 = SY-MSGV4.
ENDIF.
APPEND IDOC_STATUS.
ENDFORM.
FORM DYNPRO_START.
PERFORM DYNPRO_NEW USING PROGRAMM_AUFTRAG
DYNPRO-EINSTIEG
CHANGING LAST_DYNPRO.
ordertype
PERFORM DYNPRO_SET USING 'VBAK-AUART' XVBAK-AUART.
sales organization
PERFORM DYNPRO_SET USING 'VBAK-VKORG' XVBAK-VKORG.
Distribution channel
PERFORM DYNPRO_SET USING 'VBAK-VTWEG' XVBAK-VTWEG.
Division
PERFORM DYNPRO_SET USING 'VBAK-SPART' XVBAK-SPART.
Sales office
PERFORM DYNPRO_SET USING 'VBAK-VKBUR' XVBAK-VKBUR.
Sales group
PERFORM DYNPRO_SET USING 'VBAK-VKGRP' XVBAK-VKGRP.
ENDFORM. " DYNPRO_START
FORM DYNPRO_NEW USING PROGNAME
DYNPRONR
CHANGING LAST_DYNPRO.
CLEAR BDCDATA.
BDCDATA-PROGRAM = PROGNAME.
BDCDATA-DYNPRO = DYNPRONR.
BDCDATA-DYNBEGIN = 'X'.
APPEND BDCDATA.
LAST_DYNPRO = DYNPRONR.
ENDFORM. " DYNPRO_NEW
FORM DYNPRO_SET USING FELDNAME
FELDINHALT.
CLEAR BDCDATA.
CHECK FELDINHALT NE SPACE.
dynpro field name
BDCDATA-FNAM = FELDNAME.
contents
BDCDATA-FVAL = FELDINHALT.
APPEND BDCDATA.
ENDFORM. " DYNPRO_SET
FORM DYNPRO_DETAIL2.
okcode
PERFORM DYNPRO_SET USING 'BDC_OKCODE' PANEL-UER2.
fix dynpro number 4001
PERFORM DYNPRO_NEW USING PROGRAMM_AUFTRAG
'4001'
CHANGING LAST_DYNPRO.
order party
PERFORM DYNPRO_SET USING 'KUAGV-KUNNR' XVBAK-KUNNR.
purchase order number
PERFORM DYNPRO_SET USING 'VBKD-BSTKD' XVBAK-BSTNK.
requested delivery date
PERFORM DYNPRO_DATE_SET USING 'VBKD-BSTDK' XVBAK-BSTDK.
purchase order date
PERFORM DYNPRO_DATE_SET USING 'RV45A-KETDAT' WLDAT.
ENDFORM. " DYNPRO_DETAIL2
FORM DYNPRO_DATE_SET USING FELDNAME
FELDINHALT.
DATA: DATE TYPE D.
CLEAR BDCDATA.
CHECK FELDINHALT NE SPACE.
BDCDATA-FNAM = FELDNAME.
WRITE FELDINHALT TO DATE.
BDCDATA-FVAL = DATE.
APPEND BDCDATA.
ENDFORM. " DYNPRO_DATE_SET
FORM DYNPRO_HEAD_300.
PERFORM DYNPRO_SET USING 'BDC_OKCODE' PANEL-KKAU.
incoterms part 1
IF NOT XVBAK-INCO1 IS INITIAL.
PERFORM DYNPRO_SET USING 'VBKD-INCO1' XVBAK-INCO1.
ENDIF.
incoterms part 2
IF NOT XVBAK-INCO2 IS INITIAL.
PERFORM DYNPRO_SET USING 'VBKD-INCO2' XVBAK-INCO2.
ENDIF.
PERFORM DYNPRO_SET USING 'BDC_OKCODE' 'BACK'.
ENDFORM. " DYNPRO_HEAD_300
FORM DYNPRO_POSITION.
LOOP AT XVBAP.
dynpro item double line entry
PERFORM DYNPRO_SET USING 'BDC_OKCODE' 'UER2'.
IF XVBAP-POSNR = 1.
material number
PERFORM DYNPRO_SET USING 'VBAP-MATNR(01)' XVBAP-MATNR.
order quantity
PERFORM DYNPRO_SET USING 'RV45A-KWMENG(01)' XVBAP-WMENG.
desired delivery date
PERFORM DYNPRO_DATE_SET USING 'RV45A-ETDAT(1)' WLDAT.
sales unit
PERFORM DYNPRO_SET USING 'VBAP-VRKME(1)' XVBAP-VRKME.
ELSE.
PERFORM DYNPRO_SET USING 'BDC_OKCODE' 'POAN'.
material number
PERFORM DYNPRO_SET USING 'VBAP-MATNR(02)' XVBAP-MATNR.
order quantity
PERFORM DYNPRO_SET USING 'RV45A-KWMENG(02)' XVBAP-WMENG.
desired delivery date
PERFORM DYNPRO_DATE_SET USING 'RV45A-ETDAT(02)' WLDAT.
sales unit
PERFORM DYNPRO_SET USING 'VBAP-VRKME(02)' XVBAP-VRKME.
ENDIF.
ENDLOOP.
ENDFORM. " DYNPRO_POSITION
FORM RETURN_VARIABLES_FILL USING ERRORCODE.
allocate IDOC numbers to Workflow output parameters
IF MASS_PROCESSING <> SPACE.
IF ERRORCODE = 0.
RETURN_VARIABLES-WF_PARAM = PID.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
APPEND RETURN_VARIABLES.
RETURN_VARIABLES-WF_PARAM = APO.
RETURN_VARIABLES-DOC_NUMBER = BELEGNUMMER.
APPEND RETURN_VARIABLES.
WORKFLOW_RESULT = C_WF_RESULT_OK.
ELSE.
RETURN_VARIABLES-WF_PARAM = EID.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
APPEND RETURN_VARIABLES.
WORKFLOW_RESULT = C_WF_RESULT_ERROR.
ENDIF.
ELSE.
IF ERRORCODE = 0.
RETURN_VARIABLES-WF_PARAM = APE.
RETURN_VARIABLES-DOC_NUMBER = BELEGNUMMER.
APPEND RETURN_VARIABLES.
WORKFLOW_RESULT = C_WF_RESULT_OK.
ELSE.
WORKFLOW_RESULT = C_WF_RESULT_ERROR.
ENDIF.
ENDIF.
ENDFORM. " RETURN_VARIABLES_FILL
Globale Daten von IDOC_INPUT_TESTER
TABLES: E1HEAD, E1ITEM.
DATA: BEGIN OF BDCDATA OCCURS 500.
INCLUDE STRUCTURE BDCDATA.
DATA: END OF BDCDATA.
DATA: BEGIN OF XVBAK. "Kopfdaten
INCLUDE STRUCTURE VBAK621.
DATA: END OF XVBAK.
DATA: BEGIN OF XVBAP OCCURS 50. "Position
INCLUDE STRUCTURE VBAP.
DATA: WMENG(18) TYPE C.
DATA: LFDAT LIKE VBAP-ABDAT.
DATA: KSCHL LIKE KOMV-KSCHL.
DATA: KBTRG(16) TYPE C.
DATA: KSCHL_NETWR LIKE KOMV-KSCHL.
DATA: KBTRG_NETWR(16) TYPE C.
DATA: INCO1 LIKE VBKD-INCO1.
DATA: INCO2 LIKE VBKD-INCO2.
DATA: YANTLF(1) TYPE C.
DATA: PRSDT LIKE VBKD-PRSDT.
DATA: HPRSFD LIKE TVAP-PRSFD.
DATA: END OF XVBAP.
DATA: BEGIN OF DYNPRO,
EINSTIEG LIKE T185V-DYNNR VALUE 101,
KKAU LIKE T185V-DYNNR,
UER2 LIKE T185V-DYNNR,
KBES LIKE T185V-DYNNR,
ERF1 LIKE T185V-DYNNR,
PBES LIKE T185V-DYNNR,
PKAU LIKE T185V-DYNNR,
PEIN LIKE T185V-DYNNR,
EID1 LIKE T185V-DYNNR,
POPO LIKE T185V-DYNNR,
EIPO LIKE T185V-DYNNR,
KPAR LIKE T185V-DYNNR,
PSDE LIKE T185V-DYNNR,
PPAR LIKE T185V-DYNNR,
KDE1 LIKE T185V-DYNNR,
KDE2 LIKE T185V-DYNNR,
PDE1 LIKE T185V-DYNNR,
PDE2 LIKE T185V-DYNNR,
PKON LIKE T185V-DYNNR,
END OF DYNPRO.
DATA: BEGIN OF PANEL,
KKAU LIKE T185V-PANEL VALUE 'KKAU',
UER2 LIKE T185V-PANEL VALUE 'UER2',
KBES LIKE T185V-PANEL VALUE 'KBES',
ERF1 LIKE T185V-PANEL VALUE 'ERF1',
PBES LIKE T185V-PANEL VALUE 'PBES',
PKAU LIKE T185V-PANEL VALUE 'PKAU',
PEIN LIKE T185V-PANEL VALUE 'PEIN',
EID1 LIKE T185V-PANEL VALUE 'EID1',
EIAN LIKE T185V-PANEL VALUE 'EIAN',
POPO LIKE T185V-PANEL VALUE 'POPO',
EIPO LIKE T185V-PANEL VALUE 'EIPO',
KPAR LIKE T185V-PANEL VALUE 'KPAR',
PSDE LIKE T185V-PANEL VALUE 'PSDE',
POAN LIKE T185V-PANEL VALUE 'POAN',
PPAR LIKE T185V-PANEL VALUE 'PPAR',
KDE1 LIKE T185V-PANEL VALUE 'KDE1',
KDE2 LIKE T185V-PANEL VALUE 'KDE2',
PDE1 LIKE T185V-PANEL VALUE 'PDE1',
PDE2 LIKE T185V-PANEL VALUE 'PDE2',
PKON LIKE T185V-PANEL VALUE 'PKON',
KOAN LIKE T185V-PANEL VALUE 'KOAN',
END OF PANEL.
DATA: BEGIN OF ERRTAB OCCURS 20,
TRANS LIKE TSTC-TCODE,
ARBGB LIKE T100-ARBGB,
CLASS(1) TYPE C,
MSGNR LIKE T100-MSGNR,
TEXT LIKE T100-TEXT,
TEXT(123) TYPE C,
MSGV1 LIKE SY-MSGV1,
MSGV2 LIKE SY-MSGV2,
MSGV3 LIKE SY-MSGV3,
MSGV4 LIKE SY-MSGV4,
END OF ERRTAB.
*---- Hilfsfelder -
DATA: PROGRAMM_AUFTRAG LIKE T185V-AGIDV VALUE 'SAPMV45A'.
DATA: LAST_DYNPRO LIKE T185V-DYNNR,
WLDAT LIKE VBAK-BSTDK,
POSNR LIKE VBAP-POSNR,
FIRST(1) TYPE C VALUE 'X'.
DATA: BEGIN OF XBDCMSGCOLL OCCURS 10.
INCLUDE STRUCTURE BDCMSGCOLL.
DATA: END OF XBDCMSGCOLL.
Terminauftrag ( Auftragsart wird fest gesetzt !)
DATA: BELEGNUMMER LIKE VBAK-VBELN.
DATA: ERRORCODE LIKE SY-SUBRC.
Statuswerte fuer IDOC-Status
DATA: BELEG_NICHT_GEBUCHT LIKE TEDS1-STATUS VALUE '51'.
DATA: BELEG_GEBUCHT LIKE TEDS1-STATUS VALUE '53'.
*- Direktwerte für Return_variables -
data:
eid like bdwfretvar-wf_param value 'Error_IDOCs',
pid like bdwfretvar-wf_param value 'Processed_IDOCs',
apo like bdwfretvar-wf_param value 'Appl_Objects',
ape like bdwfretvar-wf_param value 'Appl_Object'.
*- Direktwerte für Workflow_Result -
DATA: C_WF_RESULT_ERROR LIKE BDWFAP_PAR-RESULT VALUE '99999'.
DATA: C_WF_RESULT_OK LIKE BDWFAP_PAR-RESULT VALUE '0'. -
Idocs - Inbound function module
Hi All,
I'm facing a prolem while testing the inbound function module thru transaction WE19.
The steps i'm following.
1) i'll give the message type & will proceed further
2) when i select the idoc & click on the push button "inbound function module " , My Z FM will displayed afterwards when i press enter a error message will be displayed.as"Interface for the Z function module is Incorrect"
i have created Z funtion module, Z message type,Z IDOC type,Z segment type. Z process Code
All the configuration like WE57,WE20,WE42 has been done.
Please help.
Points will be rewarded
Thanks,
SureshkumarSuresh , please check if ure function module interface is as per the template below:
IMPORTING
INPUT_METHOD LIKE BDWFAP_PAR-INPUTMETHD
MASS_PROCESSING LIKE BDWFAP_PAR-MASS_PROC
EXPORT
WORKFLOW_RESULT LIKE BDWFAP_PAR-RESULT
APPLICATION_VARIABLE LIKE BDWFAP_PAR-APPL_VAR
IN_UPDATE_TASK LIKE BDWFAP_PAR-UPDATETASK
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
This is the general required format for IDoc inblund processing using FM.
Message was edited by:
Ayan Banerjee -
Reg : IDOC - inbound function module
HI guys,
I have an ....list of error inbound idocs .......(presently using function module X)......
but recently we made lot of changes in inbound function module and release as "Y"...hence presently all idocs Uses the inbound function module 'Y'.
In this scenario i wanted to re-process the old idocs.....(which were in error state 51).......Which should use the old function module 'X'.....(it should not use Function module 'Y')
In short 'based on the date ....my inbound function module should be assigned while processing idocs.
idoc date < 01.01.2011 then old function module (I.E FM "X")
idoc date > = 01.01.2011 then new function module (i.e. FM "Y")
regards
GirishYou can't do that via the standard config. You can, however, embed the call to your 'X' function in your new 'Y' function based on your date criteria. Whether that date is hard-coded or stored in TVARVC is up to you.
-
Inbound function module for custom IDOC
HI,
I have created custom IDOC.I need to create inbound function module for that custom IDOC.Can any one send me sample
function module for custom IDOC.(what are all the import Export,tables parameters and exceptions that I need to create for function module)
Thanks&Regards
Rama.MekalaHI Rama,
I presumed that You are talking about a FM to create inbound IDOC. So for creating inbound IDOC you can use '
CALL FUNCTION 'IDOC_INBOUND_ASYNCHRONOUS'
TABLES
idoc_control_rec_40 = gt_edidc
idoc_data_rec_40 = gt_edidd.
IF sy-subrc NE 0.
* MESSAGE e000 WITH text-003.
* ELSE.
* MESSAGE i000 WITH text-004 .
ENDIF.
just prepare edidc and edidd record in and pass it to the FM..
Hope this will work for you...
Thanks -
JDBC to IDoc (Custom inbound function module)
Hi,
In my scenario JDBC to IDoc, I am using a custom function module to change the planned order. When I exectue the function module in WE19, it works fine and the IDoc status is also updated correctly.
But when I execute the entire interface right from JDBC, the status of the IDoc is set to 51 and the description it is giving is "No status record was passed to ALE by the application".
Can any one help me with this, where exactly is the error?For IDOC status 51 : Inbound IDOC
In WE19, Give the IDOC number & execute ... then put the cursor on the idoc control record . then click on the Standard Inbound push button on the application tool bar.it will show show all the details like partner no,type , message type , process code & function module name ...
now put a break point in the function module .. & debug .
if u r using customised inbound function module , then click on inbound function module .. there u will get a pop screen with FM name & debugging option in both background & foreground mode... -
How to create the INBOUND Function Module for INBOUND IDOCs
Hi Friends,
Can any Suggest me How to proceed to Create an INBOUND Function Module for Processing the INBOUND IDOCS
which are recieved from XI Server ?
I am working in SAP-ISU
Here i will recieve the INBOUND IDOCs for the Meter Reading Orders.
We have a Standard INBOUND FUNCTION MODULE
IDOC_INPUT_ISU_MR_UPLOAD
which Uploads the Meter Reading Results.
I copied the Same function Module into ZIDOC_INPUT_
and working on it.
Can any one suggest me, whether i am going in correct way or not.
In IDOC_INPUT_ISU_MR_UPLOAD Inbound fun module,
BAPI_MTRREADDOC_UPLOAD is used to Update or Insert the Meter Reading Results,
My requirment is to Insert and Update the Meter Reading Orders which are Inbounded from XI.
Can I Use the Same BAPI
BAPI_MTRREADDOC_UPLOAD
to Update the below fields,
EABL-SERNR
EABL-ZWNUMMER
EABLG-ABLESGR
EABL-V_ZWSTAND
EABL-N_ZWSTAND
EABL-ABLHINW
EABL-ZSKIPC
EABL-ADAT
EABL-ATIMTATS
EABL-ADATTATS
EABL-ATIM
EABL-ZMESSAGE
EABL-ABLESER(Meter reader number)
Kindly Suggest me,
Thanks in Advance,
GaneshHello Ganesh
I think you are going completely astray with you z-function module for IDoc processing.
If you look at TABLES parameter METERREADINGRESULTS (type BAPIEABLU ) of BAPI_MTRREADDOC_UPLOAD you will find many of the requested fields already:
EABL-SERNR => BAPIEABLU-SERIALNO
EABL-ZWNUMMER =>REGISTER
EABLG-ABLESGR
EABL-V_ZWSTAND
EABL-N_ZWSTAND
EABL-ABLHINW
EABL-ZSKIPC
EABL-ADAT
EABL-ATIMTATS => ACTUALMRTIME
EABL-ADATTATS => ACTUALMRDATE
EABL-ATIM
EABL-ZMESSAGE
EABL-ABLESER(Meter reader number)
Field EABL-ZMESSAGE appears to be custom field (at least I cannot find it on ECC 6.0). If this field was added using include CI_EABL then you probably can get these values into the BAPI using the EXTENSIONIN parameter.
Check routine CHECK_UPLOADRECORDS in the BAPI which allows two extension structures:
- BAPI_TE_EABL
- BAPI_TE_EOSB
Not surprisingly BAPI_TE_EABL contains the include CI_EABL.
Regards
Uwe -
How to find out the inbound function module in the extended idoc
Hi,
how to find out the inbound function module in the extended idocs
Thanks .through we41/we42 you can find the inbound function module.......
or
thorough we19(idoc test tool) ....
give the input as message type or basic idoc..
press exec...
then you can find th button on application tool bar as inbound funtion module....
from here also you can find..........
<REMOVED BY MODERATOR>
Khasimsa
Edited by: Alvaro Tejada Galindo on Apr 14, 2008 1:34 PM -
IDOC from inbound function module
Hi All,
I have a inbound function module..
I dont know its Idoc type.
Ho to find the IDOC based on Inbound Function module
Thanks
AmrutaHi Amruta
Inbound Function Moduel always in the format of IDOC_INPUT_XXXXXXX
xxxxxx is the your Message type...
Based on you message type u can get you idoc type....
if function moduel is Standard one ...
Thanks
Ram -
Inbound function module for IDoc type INFRECMASS01
Hello everybody,
What is the inbound function module for IDoc type INFRECMASS01?
I tried IDOC_INPUT_INFREC (as for IDoc INFREC01), but I got the following message (B1 044): Incorrect function module IDOC_INPUT_INFREC called up
Thanks in advance
RolandThe only difference between INFRECMASS01 and INFREC01 is that repitition of the same segments. However, the standard function module is hardcoded with IDOC type INFREC01, so if you want to use the MASS IDOC copy the standard one and put in the logic to loop around and process the info records one by one.
There is no standard funtion that can process mass idoc of the info record.
Regards,
Ravi
Note: Please mark the helpful answers -
Inbound IDoc Posting Function Module
Give me an example of how to write "Inbound IDoc Posting Function Module".
In my IDOC i have 10 segments each containing 1 field.
How do i create the Inbound IDoc Posting Function Module ??
Is the following code correct ??
FUNCTION ZIDOC_INBOUND.
""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_CONTRL STRUCTURE EDIDC
*" IDOC_DATA STRUCTURE EDIDD
*" IDOC_STATUS STRUCTURE BDIDOCSTAT
*" RETURN_VARIABLES STRUCTURE BDWFRETVAR
*" SERIALIZATION_INFO STRUCTURE BDI_SER
*" EXCEPTIONS
*" WRONG_FUNCTION_CALLED
*DATABASE TABLES
TABLES:LIKPUK.
*DATA DECLARATIONS
DATA: SALES_ORDER_NUM LIKE Z1VBELN.
DATA: DEL_TYPE LIKE Z1LFART.
DATA: ACTUAL_GOODS_MOVEMENT_DATE LIKE Z1WADAT_IST.
DATA: SHIPPING_POINT LIKE Z1VSTEL.
DATA: LOADING_POINT LIKE Z1LSTEL.
DATA: ROUTE_PGI LIKE Z1ROUTE.
DATA: PICK_DATA LIKE Z1KODAT.
DATA: CUST_NO LIKE Z1KUNNR.
DATA: LOCAL_DATE LIKE Z1STDAT.
DATA: TOTAL_GOOD_MOV LIKE Z1WBSTK.
*INTERNAL TABLE DECLARATION
DATA:
IT_LIKP LIKE LIKPUK OCCURS 0 WITH HEADER LINE.
INITIALIZE WORK FLOW
WORK_RESULT = C_WF_RESULT_OK.
LOOP AT IDOC_CONTRL.
MAKE SURE WE HAVE CORRECT MESSAGE TYPE PASSED.
IF IDOC_CONTRL-MESTYP NE 'Z_IDOC_PGI'.
RAISE WRONG_FUNCTION_CALLED.
ENDIF.
CLEAR APPLICATION BUFFERS BEFORE READING NEW ENTRY
CLEAR :IT_LIKP.
REFRESH IT_LIKP.
*PROCESS ALL THE DATA RECORDS IN AN IDOC AND TRANSFER THEM TO
*APPLICATION BUFFERS
INCLUDE MBDCONWF.
LOOP AT IDOC_DATA WHERE DOCNUM EQ idoc_contrl-docnum.
CASE IDOC_DATA-SEGNAM.
WHEN'Z1VBELN'.
SALES_ORDER_NUM = IDOC_DATA-SDATA.
MOVE-CORRESPONDING SALES_ORDER_NUM TO IT_LIKP.
WHEN 'Z1LFART'.
DEL_TYPE = IDOC_DATA-SDATA.
MOVE-CORRESPONDING DEL_TYPE TO IT_LIKP.
WHEN 'Z1WADAT_IST'.
ACTUAL_GOODS_MOVEMENT_DATE = IDOC_DATA-SDATA.
MOVE-CORRESPONDING ACTUAL_GOODS_MOVEMENT_DATE TO IT_LIKP.
WHEN 'Z1VSTEL'.
SHIPPING_POINT = IDOC_DATA-SDATA.
MOVE-CORRESPONDING SHIPPING_POINT TO IT_LIKP.
WHEN 'Z1LSTEL'.
LOADING_POINT = IDOC_DATA-SDATA.
MOVE-CORRESPONDING LOADING_POINT TO IT_LIKP.
WHEN 'Z1ROUTE'.
ROUTE_PGI = IDOC_DATA-SDATA.
MOVE-CORRESPONDING ROUTE_PGI TO IT_LIKP.
WHEN 'Z1KODAT'.
PICK_DATA = IDOC_DATA-SDATA.
MOVE-CORRESPONDING PICK_DATA TO IT_LIKP.
WHEN'Z1KUNNR'.
CUST_NO = IDOC_DATA-SDATA.
MOVE-CORRESPONDING CUST_NO TO IT_LIKP.
WHEN'Z1STDAT'.
LOCAL_DATE = IDOC_DATA-SDATA.
MOVE-CORRESPONDING LOCAL_DATE TO IT_LIKP.
WHEN'Z1WBSTK'.
TOTAL_GOOD_MOV = IDOC_DATA-SDATA.
MOVE-CORRESPONDING TOTAL_GOOD_MOV TO IT_LIKP.
ENDCASE.
ENDLOOP.
selecting data from the database
select * from likp into corresponding fields of table it_likp.
add status record
IF SY-SUBRC EQ 0.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '53'.
IDOC_STATUS-MSGTY = 'I'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '004'.
IDOC_STATUS-MSGV1 = it_likp-VBELN.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
ELSE.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '51'.
IDOC_STATUS-MSGTY = 'E'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '005'.
IDOC_STATUS-MSGV1 = it_likp-VBELN.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
WORKFLOW_RESULT = C_WF_RESULT_ERROR.
RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
APPEND RETURN_VARIABLES.
CLEAR RETURN_VARIABLES.
ENDIF.
IF SY-SUBRC EQ 0.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '53'.
IDOC_STATUS-MSGTY = 'I'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '004'.
IDOC_STATUS-MSGV1 = IT_LIKP-LFART.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
ELSE.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '51'.
IDOC_STATUS-MSGTY = 'E'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '005'.
IDOC_STATUS-MSGV1 = IT_LIKP-LFART.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
WORKFLOW_RESULT = C_WF_RESULT_ERROR.
RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
APPEND RETURN_VARIABLES.
CLEAR RETURN_VARIABLES.
ENDIF.
IF SY-SUBRC EQ 0.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '53'.
IDOC_STATUS-MSGTY = 'I'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '004'.
IDOC_STATUS-MSGV1 = IT_LIKP-WADAT_IST.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
ELSE.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '51'.
IDOC_STATUS-MSGTY = 'E'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '005'.
IDOC_STATUS-MSGV1 = IT_LIKP-WADAT_IST.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
WORKFLOW_RESULT = C_WF_RESULT_ERROR.
RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
APPEND RETURN_VARIABLES.
CLEAR RETURN_VARIABLES.
ENDIF.
IF SY-SUBRC EQ 0.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '53'.
IDOC_STATUS-MSGTY = 'I'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '004'.
IDOC_STATUS-MSGV1 = IT_LIKP-VSTEL.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
ELSE.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '51'.
IDOC_STATUS-MSGTY = 'E'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '005'.
IDOC_STATUS-MSGV1 = IT_LIKP-VSTEL.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
WORKFLOW_RESULT = C_WF_RESULT_ERROR.
RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
APPEND RETURN_VARIABLES.
CLEAR RETURN_VARIABLES.
ENDIF.
IF SY-SUBRC EQ 0.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '53'.
IDOC_STATUS-MSGTY = 'I'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '004'.
IDOC_STATUS-MSGV1 = IT_LIKP-LSTEL.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
ELSE.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '51'.
IDOC_STATUS-MSGTY = 'E'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '005'.
IDOC_STATUS-MSGV1 = IT_LIKP-LSTEL.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
WORKFLOW_RESULT = C_WF_RESULT_ERROR.
RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
APPEND RETURN_VARIABLES.
CLEAR RETURN_VARIABLES.
ENDIF.
IF SY-SUBRC EQ 0.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '53'.
IDOC_STATUS-MSGTY = 'I'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '004'.
IDOC_STATUS-MSGV1 = IT_LIKP-ROUTE.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
ELSE.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '51'.
IDOC_STATUS-MSGTY = 'E'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '005'.
IDOC_STATUS-MSGV1 = IT_LIKP-ROUTE.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
WORKFLOW_RESULT = C_WF_RESULT_ERROR.
RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
APPEND RETURN_VARIABLES.
CLEAR RETURN_VARIABLES.
ENDIF.
IF SY-SUBRC EQ 0.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '53'.
IDOC_STATUS-MSGTY = 'I'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '004'.
IDOC_STATUS-MSGV1 = IT_LIKP-KODAT.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
ELSE.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '51'.
IDOC_STATUS-MSGTY = 'E'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '005'.
IDOC_STATUS-MSGV1 = IT_LIKP-KODAT.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
WORKFLOW_RESULT = C_WF_RESULT_ERROR.
RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
APPEND RETURN_VARIABLES.
CLEAR RETURN_VARIABLES.
ENDIF.
IF SY-SUBRC EQ 0.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '53'.
IDOC_STATUS-MSGTY = 'I'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '004'.
IDOC_STATUS-MSGV1 = IT_LIKP-KUNNR.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
ELSE.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '51'.
IDOC_STATUS-MSGTY = 'E'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '005'.
IDOC_STATUS-MSGV1 = IT_LIKP-KUNNR.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
WORKFLOW_RESULT = C_WF_RESULT_ERROR.
RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
APPEND RETURN_VARIABLES.
CLEAR RETURN_VARIABLES.
ENDIF.
IF SY-SUBRC EQ 0.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '53'.
IDOC_STATUS-MSGTY = 'I'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '004'.
IDOC_STATUS-MSGV1 = SY-DATLO.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
ELSE.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '51'.
IDOC_STATUS-MSGTY = 'E'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '005'.
IDOC_STATUS-MSGV1 = SY-DATLO.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
WORKFLOW_RESULT = C_WF_RESULT_ERROR.
RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
APPEND RETURN_VARIABLES.
CLEAR RETURN_VARIABLES.
ENDIF.
IF SY-SUBRC EQ 0.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '53'.
IDOC_STATUS-MSGTY = 'I'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '004'.
IDOC_STATUS-MSGV1 = IT_LIKP-WBSTK.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
ELSE.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-STATUS = '51'.
IDOC_STATUS-MSGTY = 'E'.
IDOC_STATUS-MSGID = 'YM'.
IDOC_STATUS-MSGNO = '005'.
IDOC_STATUS-MSGV1 = IT_LIKP-WBSTK.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
WORKFLOW_RESULT = C_WF_RESULT_ERROR.
RETURN_VARIABLES-WF_PARAM = 'Error_Idocs'.
RETURN_VARIABLES-DOC_NUMBER = IDOC_CONTRL-DOCNUM.
APPEND RETURN_VARIABLES.
CLEAR RETURN_VARIABLES.
ENDIF.
endloop.
endfunction.Hi,
First goto WE20-> click on the logical system , now select the receiver LS which you are using as your partner. Now in the inbound parameters cehck what is the process code is attached.
once you get the process code then go to WE42 tcode.. there you give the process code and then double click you will get the function module IDOC_INPUT_FIDCMT.
Hopw you got my point.
Regards,
Nagaraj -
Can an inbound function module generate IDOC?
Hello Everyone,
Does not Sound a proper question , but yes thats the requirement,
I have a requirement that the inbound processing function module on encountering certain document in IDOC has to do some processing and Generate and IDOC!
I have not started coding yet, becasue before that wanted to make sure, thats it is possible.
Do you think , we can use MASTER_IDOC_DISTRIBUTE within inbound function module? IF the answer is 'NO' Please let me know the reasons.
All suggestions would be rewarded.
RegardsHi Trivenn,
Yes, we can use the FM "MASTER_IDOC_DISTRIBUTE" in the inbound processing function module.
This has been implemented in our project without issues.
Maybe you are looking for
-
Installation of developer suit 10g on windows 7 64-bit
Dear all, I have successfully installed oracle 10g and developer suit 10g in my lappy which runs on windows 7 64-bit, I am able to launch form builder, create a new form and compile it. But when I runs the form the the internet explorer 8 crashes. Pl
-
My top 5 items i'd like to see in the next FCX update...
hopefully someone from Apple development reads this! Allow custom frame sizes for projects. a MUST! not everyone is creating movies in a standard video format - videos are needed for e-commerce, display panels, and web banners that wont fall into a
-
Needs to update Infotype using ALE-Change Pointers-ECC 6.0
HR Experts, We are using ECC 6.0. There are two SAP-HR systems.. for e.g system A and B. We would like to send data from system A to B. If there are any changes in system A for Infotype-0, 1, 2, 6, 8, the IDOC should be generated and it should delive
-
There are still no BW systems connected to the Datasource
Hi All, We are currently implementing BW retail project and trying to retrieve POS data using IDOCs through PIPE but we are facing a problem when we try to process idoc from POS workbench (/POSDW/MON0).We are sending idocs(WBUPON- POS interface: Upl
-
HI, We are using 8.1 and we are doing a recon on AD resource. But if there is an email changed on the AD natively it is not getting updated to IDM. What is the best solution to update it. I was thinking about activesync to AD. Is it a good idea or ar