Sunday, December 9, 2007

IDOC

What is IDOC

• IDOC = Intermediate Document

• IDOC is simply a data container used to exchange information between any two processes that can understand the syntax and semantics of the data.

• When we execute an outbound ALE or EDI Process, an IDOC is created

• In an inbound ALE or EDI process, an IDOC serves as input to create an application document.

• In the SAP System, IDOCs are stored in database.

• Every IDOC has an unique number(within a client).

• IDOCs are independent of the sending and receiving systems.(SAP-to-SAP as well as Non-SAP)

• IDOCs are based on EDI standards, ANSI ASC X12 and EDIFACT. In case of any conflict in data size, it adopts one with greater length

• IDOCs are independent of the direction of data exchange e.g. ORDERS01: Purchasing module : Inbound and Outbound

• IDOCs can be viewed in a text editor. Data is stored in character format instead of binary format.

IDOC Components

Basic IDOC Type (we30)

• Basic IDOC Type defines the structure and format of the business document that is to be exchanged.

• IDOC Type has a

– specific name

– list of permitted segments

– hierarchy of segments

– mandatory/optional segments

– minimum/maximum range of each segment.

Segments

• Segment defines the format and structure of a data record. Segments are reusable components.

• For each segment SAP creates

– Segment Type (version independent)

– Segment Definition (version dependent)

– Segment Documentation

• The last 3 characters is the version of the segment

• Definitions keep changing as per the version but the segment type remains the same

IDOC Run-Time Components

• An IDOC is an instance of an IDOC Type

• At run time the following events occur

– A unique IDOC no. is allocated by SAP

– One control record is attached to the IDOC

– Segments translate into data records

– Status records are attached

– Syntax rules are checked.

• Each IDOC has 3 parts

– Control Record

– Data Record

– Status Record

• We02 or We05

Control Record

• All control record data is stored in EDIDC table. The key to this table is the IDOC Number

• It contains information like IDOC number, sender, recipient information, channel it is using, which port it is using etc.

Data Record

• Data record contains application data like employee header info, weekly details, client details etc

• All data record data is stored in EDI_DD40 table and EDI_DD

Status Record

• Status record are attached to an IDOC at every milestone or when it encounter errors.

• All status record data is stored in EDID8 table.

Where and How IDOC is created

Where and How an IDOC is created?

• Lets take an example to understand this:

• Whenever a Purchase Order (PO) is created we want to send the IDOC to a vendor.

• The PO is sent in the form of an IDOC to the vendor (partner). That partner has to be EDI enabled in that system.. SAP should realize that it could send doc to this vendor electronically. (Creating a vendor is not sufficient). Partner Profile should be EDI enabled i.e. A partner profile should exist in the sap system.

• Quotation, RFQ, PO, SO, Invoice, delivery challan etc are some of the commonly exchanged documents through IDOCs

• We create only one profile for both inbound and outbound IDOCs.

• Partner profile should contain message type……to be able to exchange the IDOC.

• We define partner type, partner function and message type (it distinguish if an IDOC is being sent to same person in same function for different reason e.g. SO)

Process Code

Creating Outbound Process Code (WE41)

• What is Process Code?

Process of filling the IDOC with application data is done by Function Module. But, function module is not assigned to a Partner. It is encapsulated by a Process Code and this Process Code is assigned to a Partner in Partner Profile.

• Assigning Function Module to Process Code

- Go to Transaction WE41.

- Switch to “Change” Mode and click “New Entries”.

- Enter Process Code Name and assign the Function Module created.

Partner Profile

Creating Partner Profile (WE20)

• What is Partner Profile?

We must maintain the business partners with whom we communicate via IDocs, in Partner Profiles.

• Steps to create Partner Profile

- Goto Transaction WE20.

- Click on Create Button.

- Enter the Number of Vendor Created in Partner No. and ‘LI’ in Partner Type fields.

- Save the Data.

- For Outbound Partner Profile we have to create Outbound Parameters

- Specify Partner Function, Message type created, Port (create a port in WE21),Basic Type and Output Mode.

- Goto “Message Control” Tab and link the Message Type and Process Code created.

- Save.

Change Application Data to be transmitted

• Change Purchase Order Created using transaction ME22n for the Vendor to which partner profile has been created.

• Go to “Messages” , add the new “Message Type” to the list and Save the Purchase Order.

• An IDOC will be created for the purchase order and will be dispatched to PORT mentioned.

Check the status of IDOC (WE02)

• The IDOC status can be checked using transaction WE02

• If the status is ’03’, it implies that IDOC is passed to Port.

Summary: IDOC Workflow

The sequence:

1. Checks whether Partner profile exists or not

2. Whether that PP has a outbound parameter

3. Whether NEU message type is there or not (message control)

4. Checks the process code (gives the name of Function module)

5. Checks immediate transfer or batch transfer

6. Based on that it checks the receiver port

7. Then it will trigger the RFC destination

8. Then it triggers the event on subsystem/customer system

9. Transfer the IDOC to a port and transfer the Idoc in terms of file and it triggers the customer system

10. Customer knows from where it should pick up the file ….it picks up the file.

Extending an Existing IDOC Type

• Used in cases where some additional information is required in addition to that supplied by the Standard IDOC Type.

• In Transaction WE30 we create the IDOC as an Extension and specify the basic type for which it is an extension.

• We add the segments needed as children to existing ones.

• None of the Reference Segments can be deleted or changed.

Extension Child Segs

Basic Type (ORDERS01)

F1

F2

F3

F4

F5

Cannot be modified

IDOC Views

• An IDOC type can be used for more than one message type, which results in IDOCs containing more fields than required for a particular message type.

• IDOC views are used to improve performance in generating IDOCs to ensure only the relevant segments are filled with data.

• IDOC Views are important only for Outbound Processing.

IDOC Type

F1

F2

F3

F4

F5

Processing Logic

• The processing logic associated with the IDOC is the function module that is written to handle the inbound/outbound IDOC.

• Its written just like any function module but has to follow a standard interface (i.e. Import, Export, Changing & Tables) parameters and it is should be RFC enabled.

• In this function module we are effectively building up a table of type EDID4 (IDOC Data table) and change the control record.

41 comments:

傷口很殺 said...

君子如水,隨方就圓,無處不自在。..................................................

8501 said...

來問個安,誰不支持這個部落格,我咬他........................................

馨裕 said...

dvd 日本色情片新做愛色情片做愛色情影片免費色情論壇色情網小說尋夢中部聊天尋夢中部聊天室尋夢元聊天是尋夢園大學生尋夢園聊天館尋夢園遊戲尋夢聯盟廁所盜攝免費看援交中壢援交平台援高雄晴色小說無碼日本女優甜心寶貝貼影片區情色大全情色a影片情色人成情色小文學情色小說上看情色小說成人學情色小說圖貼情色小舖情色文張情色文章sex情色文學頁gogogirl視訊美女 網路小說 情色論壇聊天室ut

劉承合 said...

人自幼就應該通過完美的教育,去建立一種好的習慣。 ..................................................

宗弘 said...

I do like ur article~!!!...................................................

PorshaCoghlan梁子珠 said...

nice to know you ~........................................

Ko212ryS_Dahle0 said...

性愛教學taiwan sex大奶子台灣情色論壇台灣av女優一夜情留言板女生裸體色情電話a網情色片美女裸照成人笑話巨乳學院裸體寫真av寫真走光照巨奶做愛技巧a圖片淫亂撫摸情色聊天少婦自拍淫娃一夜情聊天av情色本土av女生高潮色情av成人情色貼圖一夜情留言成人圖庫亞洲成人口交技巧性經驗成人18三點全露蕩婦情色自拍貼圖性愛論壇色情貼圖
色情貼圖

銘雅婷木 said...

All roads lead to Rome. 堅持自己所選! ....................................................

玄雨 said...

Well done!........................................

韋于倫成 said...

來逛逛blog~~跟您打聲招呼........................................

韋于倫成 said...

來幫推 你個blog影d相真係好靚,係我至愛~ .........................

水慧 said...

blog的用心,看得出來~~請加油..................................................

紫倫妍勳 said...

Well done!............................................................

紫倫妍勳 said...

Well done!............................................................

QuinnJ怡潔 said...

Make hay while the sun shines.............................................................

BryannaR22369 said...

人不能像動物一樣活著,而應該追求知識和美德..................................................

冠慧 said...

好棒的地方 我一定要常來~~~^^~. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

江婷 said...

生存乃是不斷地在內心與靈魂交戰;寫作是坐著審判自己。......................................................................

黃怡 said...

河水永遠是相同的,可是每一剎那又都是新的。......................................................................

靜宸靜宸靜宸 said...

人不能像動物一樣活著,而應該追求知識和美德............................................................

吳婷婷 said...

It takes all kinds to make a world.............................................................

佩璇佩璇 said...

在你一無所有的時候 是誰在陪伴你 他便是你最重要的人............................................................

吳婷婷 said...

困難的不在於新概念,而在於逃避舊有的概念。............................................................

慧杰慧杰 said...

All good things come to an end...................................................................

李志杰 said...

加油!充實內函最重要!Beauty is but skin- deep...................................................................

明儒 said...

留言支持好作品~來打聲招呼-大家好!!! ............................................................

青卉 said...

愛情不是慈善事業,不能隨便施捨。............................................................

王美妹 said...

良言一句三冬暖,惡語傷人六月寒。............................................................

陳v柯凡蕭珈火豐晏雄 said...

外表往往與事實不符,世人卻容易被外表的裝飾所欺騙。.......................................................

ToryO_Vis建銘 said...

不要去想沒拿到的東西,多想想自己手裡所擁有的..................................................

冠賴伶冠賴伶冠賴伶 said...

感謝分享~希望有更多的好文章分享給大家.................................[/url]...............

周志v豪 said...

良言一句三冬暖,惡語傷人六月寒。......................................................................

承王蓁 said...

Lets cross the bridge when we come to it............................................................

446 said...

快樂,是享受工作過程的結果......................................................................

智柏林婉林亞 said...

在莫非定律中有項笨蛋定律:「一個組織中的笨蛋,恆大於等於三分之二。」............................................................

佳張張張張燕張張張張張 said...

喜歡自己的另一層意義是「接納自己」。..................................................

316 said...

~~天天開心~~祝您快樂~~..................................................................

王郭亮珠郭亮珠郭亮珠建人 said...

多謝美味的心靈雞湯......................................................

司冯欣 said...

與人相處不妨多用眼睛說話,多用嘴巴思考,............................................................

RAJ said...

good post . iam also creating blog for helping SAP learners http://sapmmhelp.blogspot.com

Ghanem said...

Hi,

Check out SAP MM Certification! It is way better than this blog!

Ghanem