2/24/2016 7:11:30 PM
This blog will gives about IDoc inbound and IDoc outbound tips and tricks. Many consultants hard coding the values IDoc Type, Message Type and Partner Number of Receiver, during Outbound IDoc development. Function module MASTER_IDOC_DISTRIBUTE is the interface from the application to the ALE layer on the outbound side. The application can pass an IDoc, the so-called master IDoc, as an internal table using the parameters MASTER_IDOC_CONTROL and MASTER_IDOC_DATA.This IDoc is then converted into one or communication IDoc's and stored in the ALE layer. IDocs for which no errors occurred are passed to dispatch control. In the table parameter COMMUNICATION_IDOC_CONTROL the header records for the communication IDocs created are returned. You can tell whether processing was successful from the field STATUS. A COMMIT WORK must be dispatched in the calling program, otherwise the IDocs may not be dispatched.
Below the points will be useful while developing an IDoc :
1) Get dynamic Partner Number of Receiver during run-time.
Call the function module MMODEL_INT_VALID_GET to pass MESTYP(Message Type) to get relevant IDoc type and Partner Number of Receiver. Please find the sample piece of code.
gwa_edidc-idoctp = &1.
gwa_edidc-mestyp = &2.
gwa_edidc-rcvprn = &3.
gwa_edidc-rcvprt = 'LS'.
append gwa_edidc to git_edidc.
CALL FUNCTION 'MMODEL_INT_VALID_GET'
mestyp = 'ZOUTPO' "Message type
model = git_model.
LOOP AT git_model INTO gwa_model.
REFRESH : git_edidc.
idoc_ctrl : 'ZEDI_PO' gwa_model-mestyp gwa_model-rcvsystem.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
master_idoc_control = gwa_edidc
communication_idoc_control = git_edidc
master_idoc_data = git_edidd
error_in_idoc_control = 1
error_writing_idoc_status = 2
error_in_idoc_data = 3
sending_logical_system_unknown = 4
OTHERS = 5.
Note : FM MMODEL_INT_VALID_GET will be return the values against BD64 assignments.
Why do you need to call MMODEL_INT_VALID_GET?
After sometime you may add some additional receiver so that time code change is not required if you use this function module MMODEL_INT_VALID_GET
2) Can we transport Inbound / Outbound process codes?
Ans:Yes but Process codes are client-dependent. Make sure you maintain them in the correct client.
3) Where the partner profiles are stored?
Ans:The partner profiles are stored in the following tables:
Table EDPP1: General partner profile
Table EDP12: Partner profile outbound, additional data NAST
Table EDP13: Partner profile outbound
Table EDP21: Partner profile inbound
Table EDIPHONE: Connection to SAP telephony (optional)
4) Can we transport partner profiles?
Ans:Yes, you can use R3TR TABU to manually set the tables into a Customizing request (as of Release 46, into a SYST-type request) but again partner profiles are client dependent and its one time activity so try to maintain manually in all SAP systems.
5) I know Function module for outbound processing but how do I know Process code?
Ans:Use the table TEDE1 to pass ROUTID(Function module for outbound processing) to get process code.
6) I am getting the error "enter a permissible partner number" when creating partner profile using WE20.
Ans:Please see the link http://www.sappractical.com/home/blogd/enter-a-permissible-partner-number/
7) My Inbound posting function module not listed When I create Inbound Process code using the transaction WE42. Why?
Ans:Please register your function module with the transaction code BD51 and follow the transaction code WE42.
8) I have completed IDoc development which include Segments, IDoc type, Process codes, partner profiles and external system(BizTalk) throws an below error.
Microsoft.Adapters.SAP.RFCException: Details: ErrorCode=RFC_EXCEPTION. ErrorGroup=RFC_ERROR_APPLICATION_EXCEPTION. SapErrorMessage=EXCEPTION SEGMENT_UNKNOWN RAISED. AdapterErrorMessage=Error returned by RfcCallReceiveEx while calling RFC: IDOCTYPE_READ_COMPLETE
Ans: IDoc testing will be success within SAP system so possibly you might not released your IDoc type. Please check in WE30 and click Header Data. When ever you are changing the IDoc type immediately you have to release the IDoc type.
9) How do I know Receiver port in SAP System?
Ans: The receiving system is always an SAP System. The EDI subsystem must determine the system ID and write it to the field in the form SAP<SYS-ID> (e.g. SAPERI).
10) Posting Function module is empty when I click Inbound Function Module in WE19.
Ans:Please fill the control records like Port,Partner No,Part. Type in both sender and receiver system and click standard inbound now you will get Process code and Function name
11) How to Reprocess the IDoc Inbound and Outbound?
Ans: Please see the link http://www.sappractical.com/home/blogd/how-to-reprocess-the-idoc-inbound-and-outbound/
12) What are the methods to trigger outbound IDoc?
Ans: There are two ways to trigger outbound.
a) Link your process code and message type in message control(WE20)
b) You can call the Function module MASTER_IDOC_DISTRIBUTE from exit, BADI and so on.
13) My outbound IDocs remain in status 30. what will be the reason?
Ans: Please see the link http://www.sappractical.com/home/blogd/ale-idoc-outbound-idocs-remain-in-status-30/
14) My outbound IDoc not triggering from process code(message control) then how to find where the FM MASTER_IDOC_DISTRIBUTE?
Ans: You can search below the methods
a) Find where used list-MASTER_IDOC_DISTRIBUTE and check with help of program names
b) Get a mandatory segment name and use SE11->Data type then click where-used list. Now you can see the programs
c) Try to debug with system debugging and set break point at function module "MASTER_IDOC_DISTRIBUTE"
If it is a standard Outbound IDOC, there is a good chance that it would be generated by the FM IDOC_OUTPUT_<message_type>. E.g. IDOC_OUTPUT_ORDERS.
15) I am getting the error message "EDI Partner profile not available in SAP"
Ans: Please see the link http://www.sappractical.com/home/blogd/edi-partner-profile-not-available-in-sap/
16) I am getting the error message "EDI Field SEGNAM in data record is default"
Ans: Please see the link http://www.sappractical.com/home/blogd/edi-field-segnam-in-data-record-is-default/
17) Delays sending outbound IDocs status 30
Ans: Please see the link http://www.sappractical.com/home/blogd/delays-sending-outbound-idocs-status-30/
18) Outbound IDocs stuck with status 30
Ans: Please see the link http://www.sappractical.com/home/blogd/outbound-idocs-stuck-with-status-30/
Below the links will be useful
I will update the blog frequently and you may not get notification so check this blog frequently.
Thanks for reading this blog.
If you like this blog, please share (Facebook/LinkedIn/Google+) to click below links so it will reach to others.
Murugan -2/26/2016 12:47:37 PM
sdd -2/26/2016 12:51:01 PM