Saturday 16 November 2013

Extending standard IDoc

Transferring of  Material Master From One SAP Server to another SAP server by extending standard IDoc
Business Scenario: Suppose we need to transfer the Material from one system to another system but we need some extra information about the material to be captured before sending it. To achieve this the standard material Idoc: MATMAS05 is extended.
Sender System : DEV, Client-200
Receiving System : QAS, Client-200

Step1. Go to Tcode- SE11 in the sender system.










Step2. Provide the table Name: MARA and click on Display button.



















Step3. Click on Append structure to enhance the table fields so that we can capture some extra information.

















Step4. Click on the Create Button .


















Step5. Create the append structure and activate the same.

















Step6. Activate the table.



















Step7. The same thing needs to be repeated in the receiver system. Go to Tcode- SE11 in the receiver system.











Step8. Provide the table name and click on Display button.



















Step9. Click on the Append Structure button.


















Step10. Click on the Create button.


















Step11. Create the append structure with fields and activate the same.














Step12. Activate the table.




















Step13. In order to capture the enhanced field information, necessary fields can be added in the MM01 transaction or a simple report can be created to capture the extra field details. So Go to Tcode- SE38 and create a report program in the sender system.









Step14. Provide the report name and click on create button.











Step15. Provide the below code and activate it.

























Step16. To create a custom segment, go to Tcode- WE31 in the sender system.










Step17.  Provide the segment name as : ZMARA_EXT & click on Create button.















Step18. Provide the description, two fields and Save it and at last go Back.























Step19. The Segment is created in the sender system. Repeat the same step in the receiver system.

















Step20.  To create a custom segment, go to Tcode- WE31 in the receiver system.










Step21. Provide the segment name as : ZMARA_EXT & click on Create button.















Step22.Provide the description, two fields and Save it and at last go Back.



















Step23. The Segment is created in the receiver system.














Step24. Create an extended Idoc in the sender system. Go to Tcode- WE30.










Step25. Provide the name and select the Extension Radio Button and click on Create Button.
















Step26. Provide the Basic Idoc name to be extended, provide the short description and click on continue button.


















Step27. Select the Segment 'E1MARAM' and click on create button.



















Step28. Provide the Segment Name and click on Continue button.



















Step29. The Segment is properly added. Save it and Go Back.

















Step30. Release the Extended Idoc.


















Step31. Click on Save button.














Step32. Create an extended Idoc in the receiver  system. Go to Tcode- WE30.










Step33. Provide Name, select the Extension Radio Button and click on Create Button.














Step34. Provide the Basic IDoc name, Provide the short text and click on continue button.


















Step35. Select the Segment 'E1MARAM' and click on create button.















Step36. Provide the Segment Name and click on Continue button.















Step37.  The Segment is properly added. Save it and Go Back.















Step38. Release the Extended Idoc.

















Step39. Confirm it by clicking on the Yes Button.















Step40. To assign the extended IDoc to the message type. Go to Tcode- WE82 in the sender system.










Step41. Click on the Change button.



Step42. Click on the New Entries Button.














Step43. Provide the Message type, Basic Idoc, Extended Idoc and the Release . Save it and go back.













Step44. Now go to Tcode WE20 to edit the partner profile to add the Extended IDoc in the Sender System.









Step45. Select the Partner Profile 'CNT_QAS200' under Partner Type LS and double clcik on Message type 'MATMAS' under Outbound Parameters section.




















Step46. Provide the above created Extended Idoc Type as highlighted and Save it.





















Step47. Now we have to find out a Exit so that we can add the material extra information. Go to Tcode- SMOD in the Sender System.











Step48. The enhancement 'ALE00001' is available for the material IDoc extension. Clisk on the Display  button.

















Step49. The function module is available.

















Step50. Now go to Tcode- CMOD to create a project in the sender system.









Step51. Provide a project name and click on Create button.















Step52. Provide the description and click on Enhc. Assignment button.



















Step53. Provide the enhancement name and click on Components.












Step54. Now double click on the Function Module name.













Step55. Double click on  the Include to implement it.














Step56. Provide the below code so that the IDoc will carry the Extra information.

























Step57. In the receiver system, To assign the Basic Idoc, Extended Idoc to the message type, Go to Tcode- WE82.









Step58. Click on the Edit button.


















Step59. Click on the New Entries Button.





















Step60. Provide the message type name, Basic Idoc, Extended Idoc and release. Save it and go Back.
















Step61. Go to WE57  in the receiver system to assign the IDoc to the Inbound Function module.










Step62. Click on the Edit button
















Step63. Click on the New Entries Buton
















Step64. Provide the function module name 'IDOC_INPUT_MATMAS01', basic Idoc tpe, Extended Idoc type, Message type and direction as 2 (Inbound) and save it. We need to add some extra code to add the extra Information to the MARA table.


















Step65. Go to Tcode- SE37 in the receiver system.









Step66. Provide te inbound function module name 'IDOC_INPUT_MATMAS01' and click on Display button














Step67. one user exit is available as highlighted below.













Step68. The same is also called in the FM: IDOC_INPUT_MATMAS01.


















Step69. From the Attributes tab get the package name.



















Step70. Go to SMOD transaction in the receiver system .










Step71. Click on F4 button.

















Step72. Provide the package Name and click on continue button




















Step73. The enhancement 'MGV00001' is available. Select the first one.

























Step74. Click on the Display Button.

















Step75. Now Click on the Components .

















Step76. The FM 'EXIT_SAPLMV02_002'  is available to Post the IDoc with additional information.

















Step77. Go to Tcode- CMOD in the receiver system.










Step78. Provide a project Name and click on Create Button.

















Step79. Provide the description and clcik on Enhc. Assignment button.


















Step80. Provide the Enhancement Name and click on Components button












Step81. Now docub;le clcik on Fm 'EXIT_SAPLMV02_002' to implement it.














Step82. Double click on the Include to implement it.















Step83. Provide teh below code and activate the project.



















Step84. Now Go to TCode- MM01 in the sender system to create a material.









Step85. Select the line and click on continue Button.


























Step86. The material '4150' is created successfully in the sender system.















Step87. To add the extra material information,go to Tcode- SE38 in the sender system to run the previous created report.









Step88. Provide the report Name and Execute it.














Step89. Provide the previously created Material Name and provide the Additional Information and execute it.













Step90. The material '4150' is updated with additional information in the  Sender System.













Step91. Go to Tcode- MM03 in the receiver system to check in the material is available or not.









Step92. Provide the material number- 4150 and hit enter button. The material is not available in the Receiver System.















Step93. Now go to Tcode- BD10 in the sender system to generate the Idoc.










Step94. Provide the material number, message type and the Logical system and Execute it.















Step95. One master Idoc is generated.















Step96. One Communication Idoc is generated.















Step97. Now Go to Tcode- WE02 in the sender system to get to know about the Generated IDoc.









Step98. Provide the details and Execute it.



















Step99. The  IDoc contains the material '4150' in the sender system.






















Step100. The Segment 'ZMARA_EXT' contains the extra additional Information as highlighted below.




















Step101. Now go to Tcode- WE02 in the receiver system to track the Inbound Idoc.








Step102. Provide the details and click on execute button.



















Step103. The Inbound IDoc contains the Material '4150' in the receiver system.




















Step104. The segment 'ZMARA_EXT' contains the additional information in the receiver system.


















Step105. Now go to Tcode- MM03 in the receiver system.








Step106. provide teh material number 4150 and hit enter button.










Step107. The material is created in the receiver system..



















Step108. To check the additional field details available in the table or not go to tcode- SE11 in the receiver system.










Step109. Provide the table name and click on Display button.















Step110. Click on the Show Contents Button.
















Step111. Provide the material number 4150 and Execute it.













Step112. The additional fields values are available in the table.











_______________________________________________________________________________

3 comments:

ankit said...

I’m not that much of an internet reader to be honest but your blogs really nice, keep it up! I’ll go ahead and bookmark your website to come back down the road sap training hyderabad

Jatin Singhal said...

Great Blog :)

Unknown said...

I'm not good at IDOC, but this blog gives me overall understanding about extension idoc with screenshots is awesome. Very useful for many of us. Thanks a lot.

Comments system

Disqus Shortname