‎2007 Jun 03 4:20 AM
Hi everyone,
Could you please provide me the steps to create an IDOC..Sample code will be helpful too..I am familiar with how to create idoc types but not getin the feel of how to actually create an IDOC...
Also if there is some good tutorial on this...it will help me understand the subject well...I want to know everythin about IDOC and how it works from scratch...
Thanks in Advance....
Cheers:
Jim
‎2007 Jun 03 4:49 AM
First set up configuration -
Logical system in SALE
RFC - Sm59
Distribution model view - BD64 ( if it is ALE then use,edi do not use )
Port - WE21 ( if it is ALE ,then choose TRFC Port,EDI then choose FILE Port)
Partner profile - WE20
Create new ztable in se11
Create new segment - WE31
Create new idoc type - WE30
Create new message type - WE81
Create message type to idoc type - WE82
table looks like matnr,maktx ( example ) ztable,mention segment also matnr,maktx
you will get partial output ,so use process code : MATM ( Material Master)
Now create a program :
See the example program :
&----
*& Report ZTEST_ALE
*&
&----
*&
*&
&----
REPORT ZTEST_ALE.
tables : zmara_01,
edidd,
edidc.
constants : c_mestyp type edidc-mestyp value 'ZAJI_MSG',
c_idoctp type edidc-idoctp value 'ZAJI_IDOC',
c_imtyp type edidc-cimtyp value 'Z_ACC_GL_POSTING01',
c_seg1 type edidd-segnam value 'E1BPACHE08',
c_seg2 type edidd-segnam value 'E1BPACGL08',
c_seg3 type edidd-segnam value 'E1BPACCR08',
c_seg4 type edidd-segnam value 'Z1BPACCR08',
c_seg5 type edidd-segnam value 'E1BPEXTC'.
Work Area for EDIDC
data wa_edidc like edidc.
Internal tabel
data i_edidc like edidc occurs 0 with header line.
data i_edidd like edidd occurs 0 with header line.
Internal table for ZMARA_01
data i_mara like zmara_01 occurs 0 with header line.
parameters : p_rcvprn type edoc_stat-rcvprn obligatory,"Partner Number of Receiver
p_rcvprt type edoc_stat-rcvprt obligatory."Partner Type of Receiver
start-of-selection.
Fill the Control Reord
wa_edidc-mandt = sy-mandt.
wa_edidc-mestyp = c_mestyp.
wa_edidc-idoctp = c_idoctp.
wa_edidc-cimtyp = c_imtyp.
wa_edidc-rcvprn = p_rcvprn.
wa_edidc-rcvprt = p_rcvprt.
wa_edidc-credat = sy-datum.
wa_edidc-cretim = sy-uzeit.
append wa_edidc to i_edidc.
select * from zmara_01 into table i_mara.
Fill the data record
loop at i_mara.
i_edidd-segnam = 'ZAJI_MSG'.
i_edidd-sdata = i_mara-matnr.
append i_edidd.
endloop.
Call the ALE Function Module
call function 'MASTER_IDOC_DISTRIBUTE'
exporting
master_idoc_control = wa_edidc
tables
communication_idoc_control = i_edidc
master_idoc_data = i_edidd
exceptions
error_in_idoc_control = 1
error_writing_idoc_status = 2
error_in_idoc_data = 3
sending_logical_system_unknown = 4
others = 5.
if sy-subrc eq 0.
loop at i_edidc.
write:/ 'Succesfully created Idoc', i_edidc-DOCNUM.
endloop.
else.
message i000(FC) with 'No idoc has been created'.
endif.
Reward Points if it is helpful
Thanks
Seshu
‎2007 Jun 03 7:34 AM
Check the following links, you will found a lot of information.
http://www.erpgenie.com/sapedi/index.htm
http://www.erpgenie.com/sap/ale/index.htm
‎2007 Jun 03 7:52 AM
Hi Jimmy,
Go through the link below :
http://www.sapbrain.com/TUTORIALS/TECHNICAL/IDOC_tutorial.html
This tutorial provides a comprehensive explanation of what an IDOC is.
How to create an IDOC has been explained in detail by Seshu. So I guess that would suffice.
Hope this helps.
Regards
Anil Madhavan
‎2007 Jun 03 8:38 AM
Hi
Creation of Custom IDOc type and message Type
First Create Partner Profile(WE20 Tcode) and Port Definition in WE19 Tcodes.
take the Basis help to create them.
1.First create segments in WE31 Tcode with the required dataelements
2.Create the Basic Idoc Type in WE30
release the Segments and IDOC type.
3.Create Message type in We81
4.Assign the message type to IDOC type in WE82 T code
5.Create the process code in We41 (for Outbound) WE42 (for Inbound)
6.Create A fun module in SE37 starting with ZIDOC_OUTPUT_.. by copying some Inbound (for Inbound) Outbound Fun module
7.Create Workflow setting if needed ..
8. Assign the fun module to Idoc Type, Message Type and WF object (if it is there0
9.Define setting for fun module in BD51
10.In BD51 Define the settings for Fun module..
10.Assign the Processs Code to Fun mod`ule
Check below link. It will give the step by step procedure for IDOC creation.
http://www.supinfo-projects.com/cn/2005/idocs_en/2/
Check these links.
http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
http://www.sapgenie.com/sapedi/index.htm
http://www.sappoint.com/abap/ale.pdf
http://www.sappoint.com/abap/ale2.pdf
http://www.sapgenie.com/sapedi/idoc_abap.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
http://www.allsaplinks.com/idoc_sample.html
http://www.sappoint.com/abap.html
http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
http://www.sapgenie.com/sapedi/index.htm
http://www.allsaplinks.com/idoc_sample.html
http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.docs
Please check this PDF documents for ALE and IDoc.
http://www.sappoint.com/abap/ale.pdf
http://www.sappoint.com/abap/ale2.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEIO/BCMIDALEIO.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEPRO/BCMIDALEPRO.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFAALEQS/CABFAALEQS.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDISC/CAEDISCAP_STC.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDI/CAEDI.pdf
Check below link. It will give the step by step procedure for IDOC creation.
http://www.supinfo-projects.com/cn/2005/idocs_en/2/
Check these links.
http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
http://www.sapgenie.com/sapedi/index.htm
http://www.sappoint.com/abap/ale.pdf
http://www.sappoint.com/abap/ale2.pdf
http://www.sapgenie.com/sapedi/idoc_abap.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
http://www.allsaplinks.com/idoc_sample.html
http://www.sappoint.com/abap.html
http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
http://www.sapgenie.com/sapedi/index.htm
http://www.allsaplinks.com/idoc_sample.html
http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.docs
Please check this PDF documents for ALE and IDoc.
http://www.sappoint.com/abap/ale.pdf
http://www.sappoint.com/abap/ale2.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEIO/BCMIDALEIO.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEPRO/BCMIDALEPRO.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFAALEQS/CABFAALEQS.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDISC/CAEDISCAP_STC.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDI/CAEDI.pdf
Reward points if useful
Regards
Anji