10-08-2007 7:29 AM
Hi experts,
I am very new to Idoc concepts. I have to fill idoc( Custom idoc already created in the system ) with the data from infotype and have to send it to different system. How to do it programatically? Means I have to create one report which will fill idoc and send it.
Please give me solution.
Points will be rewarded...
10-08-2007 7:39 AM
REPORT z_idoc_training_cfriquin.
DATA: i_edidc TYPE STANDARD TABLE OF edidc,
i_edidd TYPE STANDARD TABLE OF edidd,
wa_edidc LIKE edidc,
wa_edidd LIKE edidd,
wa_header LIKE zheader_tr,
wa_item LIKE zitem_tr.
MOVE: '54321' TO wa_header-po_number,
'RU02' TO wa_header-plant,
'08092007' TO wa_header-date.
MOVE: '12345' TO wa_item-sr_no,
'000000000043887412' TO wa_item-material,
'0014' TO wa_item-quantity.
wa_edidd-segnam = 'ZHEADER_TR'.
wa_edidd-sdata = wa_header.
APPEND wa_edidd TO i_edidd.
wa_edidd-segnam = 'ZITEM_TR'.
wa_edidd-sdata = wa_item.
APPEND wa_edidd TO i_edidd.
wa_edidc-doctyp = 'ZIDOC_TR'.
wa_edidc-mestyp = 'ZSHPCD'.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
master_idoc_control = wa_edidc
OBJ_TYPE = ''
CHNUM = ''
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 <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
10-09-2007 8:27 AM
Hi Madan Gopal Sharma,
I have tried out as per you have suggested. When I checked for IDOC status using tcode WE02 it shows "IDoc sent to R/3 System or external program" but when i checked into receiving system it shows "No IDocs Selected" i.e. no idoc recieved. So please suggest me any solution for this
Thanks & regards,
Sameer Dhuke
10-08-2007 11:19 AM
hi,
<b>This will help you to understand the creation of Custom idoc.</b>
First try to create a Module pool program.
Assign the tcode to the IDOC.
or else get the data into IDOC segment and try to transfer it.
Creation of IDoc
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.
Create IDOC Type
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
u can also check all these links related to idocs
http://www.allsaplinks.com/idoc_sample.html
http://www.sappoint.com/abap.html
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
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://sap.ittoolbox.com/documents/popular-q-and-a/extending-a-basic-idoc-type-2358
http://help.sap.com/saphelp_47x200/helpdata/en/dc/6b7eee43d711d1893e0000e8323c4f/frameset.htm
/thread/199996 [original link is broken]
Rewards points if you find these helpful.
Regards,
Sivakumar.p