print this page
Latest Post
Showing posts with label IDOC. Show all posts
Showing posts with label IDOC. Show all posts

Major Steps Involved in IDoc Processing - For SAP Basis Admins

Major Steps Involved in IDoc Processing
  1.  Creation of Logical Systems
  2.  Assignment of logical System to processing Client
  3.  Creation of RFC Destinations
  4.  Checking the RFC Destinations
  5.  Creation of tRFC Port
  6.  Creation of Partner Profiles
  7.  Creation of Distribution Model
  8.  Sending Materials
  9.  Checking the Success/Errors


4 Things about SAP IDocs

What Basis Admins should know about IDocs ?

Most IDoc scenarios using SAP systems are similar: create an IDoc message in your ERP system and deliver it to any other system, sometimes with some custom code (like user exits) included. But it is worth knowing that you can achieve much more with IDocs. Read the examples below for just a few capabilities connected with IDoc processing that you might have been dreaming of and now you have them at your fingertips. I hope you will find them useful and they will help you develop your integration scenarios better than ever before.

1. Updating IDoc status based on the success or failure of RFC connection

It happens many times that although your IDoc monitoring tools say "IDoc sent to SAP system or external program" and the IDoc message has a green traffic light, you cannot see it in receiver system. If you take a closer look at it, you will find that IDoc status says precisely: "Data passed to port OK", which only means that IDoc has been set to be despatched, but not necessarily reached the receiver system. You have to check transaction sm58 (Transactional RFC log) to make sure your message was delivered successfully. Unfortunately, even if you locate an error in sm58, you will not find IDoc number there. Of course you can always copy the "Transaction ID" from sm58, go to General Table Display (se16n), and search entries in EDIDS database table based on the field TID equal to your Transaction ID. You will find the IDoc number there. But haven't you ever been wondering if there is no nicer way to do it?
Of course there is. You can schedule the ABAP Report RBDMOIND (Status Conversion with Successful tRFC Execution) to have your IDoc statuses changed from 03 "Data passed to port OK" to 12 "Dispatch OK". Now you can finally be sure your IDoc message reached the receiver system even while looking at it in IDoc monitoring transactions. For example, before executing the RBDMOIND report, the IDoc monitor in my system has shown:
While after I executed it, it has been confirmed that one of my IDocs for sure has already reached receiver system:

2. Delivering IDocs to HTTP receiver

In one of my previous blogs you might have read that it is possible to send IDocs from any application to your SAP system over HTTP. For further details, see here: Post IDoc to SAP ERP over HTTP from any application
You might now be thinking: for sure this has to be possible also the opposite way. It has to be possible to send IDocs out from SAP to HTTP receiver. And you are right. Moreover, this is equally simple as standard IDoc scenarios over RFC or flat files, and does not go beyond standard system configuration.
So, the trick here is to create an RFC Destination of type "HTTP Connection to External Server" (G) in sm59. For instance, it might look like that:
Remember to provide logon credentials on the "Logon & Security" tab page if required. The next steps are similar to ordinary RFC processing: create a Port in IDoc processing (we21) of type "XML HTTP" and a partner profile entry, using your IDoc port created earlier. And this is it, you are ready to test your scenario!
You will also be glad to notice that IDoc status is set properly, according to the status of HTTP call (automatically, with no further configuration). Here is an example of an IDoc that was passed successfully:
And an erroneous one:

3. Delivering IDocs to a function module (IDoc port of type ABAP-Programming Interface)
For sure you already know that you can send IDoc to an RFC Destination or create an IDoc flat file out of it. After reading the previous hint you also know that you can pass an IDoc to a HTTP server that will process it further. But in some cases, you might require some additional processing inside your SAP system after an IDoc has been created, even instead of sending the IDoc out from your system. In my case, I wanted to pass some data to an ABAP Proxy based on IDoc creation (as a data replication trigger) for some reason, but you may find hundred more applications for this capability.
The steps to follow are again really simple here. First of all, go to transaction we21 (Ports in IDoc processing) and have a closer look at ABAP-PI type. The "PI" there stands for Programming Interface, which is just what we want to do. Now simply create a new IDoc port of this type, giving it a name, description and the function module that you will use for processing the message, for instance:
Now use your port in the partner profile configuration of any outbound message and you're done. And what is really important, you have a total control over what is happening: you can set any IDoc status after your processing, or do whatever else you need. The important thing here is that your function module can use an input (TABLES) parameter I_EDIDC to get the control record of the IDoc that was passed to it. Based on it, you can use EDI_SEGMENTS_GET_ALL standard FM to get you message contents (remember to precede it with EDI_DOCUMENT_OPEN_FOR_PROCESS and conclude with EDI_DOCUMENT_CLOSE_PROCESS).

4. Unknown capabilities of IDoc status segments

Whenever developing a custom IDoc scenario or enhancing a standard one, for sure you have been thinking about error handling procedures. And now you can help your users and administrators more than ever before, using two additional features of IDoc status segments.
The first option is marking a particular segment or even a particular field as erroneous. As a result, you will see the IDoc as follows:
Thanks to this, even in bigger IDocs you can easily locate the segments that caused an error, becaused they are using a red font. You can even hide all correct segments and only display those that were marked as incorrect (in an IDoc monitor like we02, when displaying a single IDoc message):
You might be surprised that this is extremaly simple to achieve. All you need to do is to put the IDoc segment (sequential) number in the SEGNUM field of your IDoc status to mark a segment, or put field name in the given segment to SEGFLD field to mark a particular field. Really helpful, isn't it?
The second capability to put IDoc monitoring into a higher level is writing IDoc processing details to standard Application Log (transaction slg1) and then inserting the log object number in the APPL_LOG field IDoc status. For instance your IDoc status could look like that:
Now, when you double click the status record, you will find an additional button that is not visible normally:
This button navigates you to processing details in Application Log, directly from IDoc monitors. And of course, some processing details should have been written there already by your IDoc processing routine.



Tags: About SAP IDocs, What are IDOC s, SAP IDOCs what are they, 4 things you should know about IDOCS

How to track IDOC in SAP PI


Tracking IDocs from ECC to PI,
we can use IDoc number as reference number. Go to transaction IDX5 in PI, to view XML message in IDoc adapter . On providing IDoc number as the input parameter and executing, we can see the message details likeMessage ID, time of message creation, Direction, Sender System ID, Client, IDoc Type, Transaction ID etc. By clicking on the message, we can display the corresponding xml message and check out the details.


Tracking IDocs from PI to ECC
we can track message in ECC using PI Message ID. All the IDocs created by PI in ECC will have "EE" + Message ID , concatenated with space as Identification number.To check this, we can open the IDoc using WE02, go to control data, click on the last tab on right hand side called "Details". Here we can see the identification number.

Message Status in PI

Message Status in ECC 



TAGS: Message Tracking in PI , IDOC Tracking in ECC, Tracking IDocs from ECC to PI,, How to track IDOC in SAP PI

Checklist to find IDOCs for BW Load Succesful

Check the following 

1.Connections from BW to ECC and ECC to BW in SM59
2.Check Port,Partner Profiles,and Message Types in WE20 in ECC & BW.
3.Check Dumps in ST22, and SM21.
4.If Idocs are stuck i.e see the OLTP Idoc numbers in RSMO Screen in (BW) detials tab see in bottom, you can see OLTP Idoc number and take the Idoc numbers and then goto to ECC see the status in WE05 or WE02, if error then check the log else goto to BD87 in ECC and give the Idoc numbers and execute manually and see in RSMO and refresh.
5.Check the LUWs struck in SM58,User Name = * (star) and run it and see Strucked LUWs and select our LUW and execute manually and see in RSMO in BW.










Tags:  How to find Idocs for SAP BI Load, BW data  loads were stuck up,  Idoc Number of particular load/data source, IDOC getting struck at TRFC (SM58)

How to Find ECC IDOC Number in PI

Method 1

How to Find ECC IDOC Number using PI Message?
Use TCODE IDX5 in PI and enter the message ID and you will able to see the corresponding IDOC number in PI. Click on that IDOC number and you will able to find the IDOC corresponding IDOC number from ECC.

Method 2

Find IDOC Number with T-code SXI_MONITOR IN SAP PI

In sxi_monitor go to Call Adapter -> SOAP Header -> RunTime and get the value of the <SAP:EOReferenceOutbound type="TID"> attribute. This one is called the Transaction ID or TID for short. Make sure to use the EOReference Outbound because there are two more nodes with similar name.
Then go to your ECC system and search the IDoc number in EDIDS table, typing the TID found in XI into EDIDS-TID field. You can also call the INBOUND_IDOCS_FOR_TID function module instead of searching EDIDS. Unfortunately, I'm afraid there is no standard transaction to search IDocs by TID.



Note: 
IDOC number assigned in PI is not the same as generated in SAP ERP 
There is no direct T-Code to search IDOCS in ECC you may however create your custom one.





Tags:  Find IDOC Number in ECC , Find IDOC Number in PI, T-code to find IDOCS in ECC, IDOCS, PI IDOCS,

 
Copyright © 2011. SAP BASIS ANSWERS | SAP BASIS ADMIN BLOG - All Rights Reserved
T C P M
Proudly powered by Blogger