‎2007 Dec 21 9:20 AM
hi all,
can any send me the tutorials and materials on custom idoc programming
thanks & regards
sareen
‎2007 Dec 21 9:59 AM
Hi sareen,
There is lot of links available for idoc programming.
just search the forum before posting.....
WE30 - you can create a IDOC type.
An IDOC with data, will have to be triggered by the application that is trying to send out the data.
FOr testing you can use WE19.
How to create idoc?
*WE30 - you can create a IDOC type
For more information in details on the same along with the examples can be viewed on:
http://www.netweaverguru.com/EDI/HTML/IDocBook.htm#_Toc8400404
http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a6620507d11d18ee90000e8366fc2/frameset.htm
http://www.sappoint.com/presentation.html
http://www.allsaplinks.com/idoc_search.html
http://www.sapgenie.com/sapedi/idoc_abap.htm
http://www.erpgenie.com/sapedi/idoc_abap.htm
To Create Idoc we need to follow these steps:
Create Segment ( WE31)
Create Idoc Type ( WE30 )
Create Message Type ( WE81 )
Assign Idoc Type to Message Type ( WE82 )
Creating a Segment
Go to transaction code WE31
Enter the name for your segment type and click on the Create icon
Type the short text
Enter the variable names and data elements
Save it and go back
Go to Edit -> Set Release
Follow steps to create more number of segments
Create IDOC Type
Go to transaction code WE30
Enter the Object Name, select Basic type and click Create icon
Select the create new option and enter a description for your basic IDOC type and press enter
Select the IDOC Name and click Create icon
The system prompts us to enter a segment type and its attributes
Choose the appropriate values and press Enter
The system transfers the name of the segment type to the IDOC editor.
Follow these steps to add more number of segments to Parent or as Parent-child relation
Save it and go back
Go to Edit -> Set release
Create Message Type
Go to transaction code WE81
Change the details from Display mode to Change mode
After selection, the system will give this message The table is cross-client (see Help for further info). Press Enter
Click New Entries to create new Message Type
Fill details
Save it and go back
Assign Message Type to IDoc Type
Go to transaction code WE82
Change the details from Display mode to Change mode
After selection, the system will give this message The table is cross-client (see Help for further info). Press Enter.
Click New Entries to create new Message Type.
Fill details
Save it and go back
Check these out..
Check below link. It will give the step by step procedure for IDOC creation.
http://www.supinfo-projects.com/cn/2005/idocs_en/2/
IDOC Type : Defines the Structure(Hierarchy of Segments) based on which the IDOC(Data records) will be generated.
IDOC Type Can be
1. Basic Type : These are IDOC types delivered by SAP like MATMAS03
Customers can also create Basic idoc types
2. IDOC Extension: These are Created only by customers to Extend the Existing IDOC Types by adding Additional Segments.
For more information about ALE / IDOC check these links
ALE/ IDOC
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
ALE/ IDOC/ XML
http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
http://www.thespot4sap.com/Articles/SAP_XML_Business_Integration.asp
http://help.sap.com/saphelp_srm30/helpdata/en/72/0fe1385bed2815e10000000a114084/content.htm
Regards,
Arun.
‎2007 Dec 21 9:59 AM
Hi,
In order to create an outbound IDOC we need to follow the below steps.
WE31 - Create Segment (then release it)
WE30 - Create Idoc (then release it)
WE81 - Create Message class
WE82 - Assign the message type with basic IDOC type
WE21 - Define Ports (If not already defined)
WE20 - Partner Profiles (Assign Message Type in the outbound parameters of receiving partner)
Now the program for sending IDoc.
REPORT zdemo_idoc.
**********************Data Declaration**********************
DATA: i_vbak TYPE TABLE OF Segment Name
w_vbak TYPE Segment Name,
w_edidc TYPE edidc, Workarea for Control Records
w_edidd TYPE edidd, Workarea for Data Records
i_edidd TYPE TABLE OF edidd, Internal table for Data Records
t_idoc_comm_control TYPE edidc OCCURS 0 WITH HEADER LINE.
**********************Select Statements**********************
SELECT vbeln
ernam
kunnr
FROM vbak
INTO CORRESPONDING FIELDS OF TABLE i_vbak
WHERE vbeln = '0000000012'.
**********************Control Records************************
w_edidc-rcvprt = 'LS'. Partner Type of Receiver
w_edidc-rcvpor = Receiver port (SAP System, EDI subsystem)
w_edidc-rcvprn = Partner Number of Recipient
w_edidc-mestyp = Message Type
w_edidc-doctyp = IDoc Type
***********************Data Records***************************
Move data records from internal table to the edidd structure.
LOOP AT i_vbak INTO w_vbak.
w_edidd-segnam = Segment Name.
w_edidd-segnum = 1.
w_edidd-sdata = w_vbak.
w_edidd-hlevel = 1.
APPEND w_edidd TO i_edidd.
CLEAR w_edidd.
ENDLOOP.
**********************Send the IDOC***************************
Function Module to send the IDOC to the receiving port.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
master_idoc_control = w_edidc
TABLES
communication_idoc_control = t_idoc_comm_control
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.
COMMIT WORK. http://Important statement for outbound IDOC.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
WRITE 😕 'Operation Unsuccessful'.
ELSE.
WRITE 😕 'operation successful'.
ENDIF.
Now about triggering the IDoc from VT02N or VL02N, you need to do the NACE settings which will a output type assigned to your program which will trigger the IDoc when you save it.
Reward if helpful
Regards,
Ram.
Edited by: posimsetty ramamurthy on Dec 21, 2007 3:29 PM
‎2008 Mar 05 6:11 AM
Hi Ramamurthy,
I have seen your reply for this post.I want to generate an idoc when we delete the shipping doc in VT02n. I have seen that u have mentioned something abt NACE. Can you elaborate more on the process. How do i start ??
thanks
sankar
‎2008 Mar 05 6:15 AM
http://www.saptechnical.com/Tutorials/ALE/DataDistributeCustomIDOC/page1.htm
REWARD IF USEFUL
Regards.
santhosh reddy
‎2011 May 29 11:47 AM