0% found this document useful (0 votes)
76 views10 pages

Custom Idoc Outbound

This document provides step-by-step instructions for configuring an outbound IDOC process in SAP. It describes creating logical system names, RFC destinations, IDOC segments, basic IDOC types, message types, distribution models, partner profiles, and a report program to generate IDOC control records and transfer them to the destination system. The process is demonstrated between two SAP systems with different clients but the same server.

Uploaded by

Ram Praneeth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views10 pages

Custom Idoc Outbound

This document provides step-by-step instructions for configuring an outbound IDOC process in SAP. It describes creating logical system names, RFC destinations, IDOC segments, basic IDOC types, message types, distribution models, partner profiles, and a report program to generate IDOC control records and transfer them to the destination system. The process is demonstrated between two SAP systems with different clients but the same server.

Uploaded by

Ram Praneeth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

6/30/2019 SAP Sample Programs: IDOC Step-by-Step.

OUTBOUND process

More Create Blog Sign In

SAP Sample Programs


Tuesday, June 28, 2011 Translate

IDOC Step-by-Step. OUTBOUND process Select Language

Powered by Translate
TO Process IDOCS the following TCODES will be used.

On both sides: Blog Archive

►► 2013 (3)
Logical System Names SALE
►► 2012 (15)
Setup RFC destinations SM59 ▼▼ 2011 (36)
►► October (4)
Port Destinations WE21
►► September (2)
In Source system:
►► July (7)
Segment Creation WE31 ▼▼ June (10)
IDOC Step-by-Step. INBOUND
Basic IDOC Type Creation WE30 process

Message Type Creation WE81 IDOC Step-by-Step.


OUTBOUND process
Assign Message Type To Basic IDOC Type WE82 READ_TEXT function module

Distribution Model BD64 Finding Enhancement Implicit


and Explicit Spot
Writing Report Program SE38 Find BADI's in Different ways
Find Enhancement for
Partner Profile WE20
Particular Tcode.
Message control NACE BADIs (Bussiness Add-Ins)
Screen Exits
Check IDOCs WE02, WE05
Menu Exits
In Destination System: Function Exits

Creating FM SE37 ►► May (13)

Assign FM to Logical Message WE57

Define I/P method for Inbound FM BD51 Popular Posts

Create Process Code WE42 IDOC Step-by-Step. OUTBOUND


process
Generate Partner Profile BD64.
SAP Scripts Sample Program
--------------------------------------------------------------------------------
IDOC Step-by-Step. INBOUND
process
Note:Different clients but same server.
save_text sample program
Creating the Logical System Names and Assigning to Clients:
BDC using Call Transaction
created on client 800. method.

Followers

sapsamplepro.blogspot.com/2011/06/idoc-step-by-step-outbound-process.html 1/10
6/30/2019 SAP Sample Programs: IDOC Step-by-Step. OUTBOUND process
Followers (28) Next

sanju

created on client 812.


Follow

Creating the RFC Connection Names:

create RFC in SM59 for both clients 800 and 812.

sapsamplepro.blogspot.com/2011/06/idoc-step-by-step-outbound-process.html 2/10
6/30/2019 SAP Sample Programs: IDOC Step-by-Step. OUTBOUND process

Creating RFC ports:

Go to TCODE WE21.

create in 800 and RFC destination which was created in 812...EC3812

create in 812 and RFC destination which was created in 800...EC3

Creating table structure:

ð Go to TCODE SE11.

ð Specify table name as zdemo_material.( in client 800 EC3)

Creating IDOC Segments:

Go to TCODE WE31.

Specify a name and Click on Create Button.

sapsamplepro.blogspot.com/2011/06/idoc-step-by-step-outbound-process.html 3/10
6/30/2019 SAP Sample Programs: IDOC Step-by-Step. OUTBOUND process

Creating Basic IDOC Type:

Go to TCODE WE30

Specify a name to your IDOC and click on create button.

after creating NOTE: Go to menu EDIT->Click Set Release

Creating Message Type:

Go to TCODE WE81.

Click on Display / Change button.

sapsamplepro.blogspot.com/2011/06/idoc-step-by-step-outbound-process.html 4/10
6/30/2019 SAP Sample Programs: IDOC Step-by-Step. OUTBOUND process

Assign Message Type to Basic IDOC Type:

Go to TCODE WE82

Click on Display / Change Button

Creating Model View and Distributing and Generating Partner profile:

Go to TCODE BD64

Click on Display/ Change button

Click on Edit menu -> Model View -> Create

Specify description of model view and technical name in dialog box and press continue.

Select your model view and click on Edit menu -> Add Message type

In dialog box specify the sender, receiver, message type and click on continue.

Click on Environment Menu -> Generate Partner profile

It will show the following screen, click on execute.

sapsamplepro.blogspot.com/2011/06/idoc-step-by-step-outbound-process.html 5/10
6/30/2019 SAP Sample Programs: IDOC Step-by-Step. OUTBOUND process

Note: Dont create in client 812, because we are using the same
server. It will be automatically created in the client 812. check
bd64 in client 812.

Click on Back button 2 times, it will take back to Distribution Model screen.

Click on Edit Menu -> Model View -> Distribute.

MODEL VIEW Created.

check partner profile

Go to TCODE WE20

In displayed screen select the partner system in left side tree under Partner Type LS.

Write a Report Program in SE38

To create IDOC control records and transfer it to destination partner system.

sapsamplepro.blogspot.com/2011/06/idoc-step-by-step-outbound-process.html 6/10
6/30/2019 SAP Sample Programs: IDOC Step-by-Step. OUTBOUND process

==================================================
==

REPORT ZDEMO_IDOCSEND.

TABLES: zdemo_material.

DATA : S_CTRL_REC LIKE EDIDC, "Idoc Control Record


S_ZSEGMENT LIKE ZSEGMENT. "CUSTOMER Header Data

DATA : T_zdemo_material LIKE zdemo_material OCCURS 0 WITH HEADER


LINE.

DATA : T_EDIDD LIKE EDIDD OCCURS 0 WITH HEADER LINE. "Data


Records
DATA : T_COMM_IDOC LIKE EDIDC OCCURS 0 WITH HEADER LINE.
"Generated Communication IDOc

CONSTANTS :C_ZSHSTUSEG LIKE EDIDD-SEGNAM VALUE 'ZSEGMENT'.


CONSTANTS: C_IDOCTP LIKE EDIDC-IDOCTP VALUE 'ZSTUDENTIDOC'.
*** Selection Screen
SELECT-OPTIONS : S_BUKRS FOR zdemo_material-BUKRS OBLIGATORY.
PARAMETERS : C_MESTYP LIKE EDIDC-MESTYP DEFAULT 'ZCLIENTMSG',
"Message Type
C_RCVPRT LIKE EDIDC-RCVPRT DEFAULT 'LS', "Partner type of
receiver
C_LOGSYS LIKE EDIDC-RCVPRN DEFAULT 'EC3812'.
* C_RCVPOR LIKE EDIDC-RCVPOR DEFAULT 'A000000018',
* C_SNDPRN LIKE EDIDC-SNDPRN DEFAULT 'EC3',
* C_SNDPRT LIKE EDIDC-SNDPRT DEFAULT 'LS'. "Destination System
DATA ZSEGMENT.

***START-OF-SELECTION
START-OF-SELECTION.
PERFORM GENERATE_DATA_RECORDS.
PERFORM GENERATE_CONTROL_RECORD.
PERFORM SEND_IDOC.
*&---------------------------------------------------------------
------*
*& Form GENERATE_DATA_RECORDS
*&---------------------------------------------------------------
------*
* text
*----------------------------------------------------------------
------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------
------*
FORM GENERATE_DATA_RECORDS .
SELECT * FROM zdemo_material
INTO TABLE T_zdemo_material
WHERE BUKRS IN S_BUKRS.
IF SY-SUBRC NE 0.
MESSAGE E398(00) WITH 'No Company code Found'.
ENDIF.
PERFORM ARRANGE_DATA_RECORDS.
ENDFORM. " GENERATE_DATA_RECORDS
*&---------------------------------------------------------------
------*
*& Form GENERATE_CONTROL_RECORD
*&---------------------------------------------------------------
------*
* text
*----------------------------------------------------------------

sapsamplepro.blogspot.com/2011/06/idoc-step-by-step-outbound-process.html 7/10
6/30/2019 SAP Sample Programs: IDOC Step-by-Step. OUTBOUND process
------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------
------*
FORM GENERATE_CONTROL_RECORD .
* S_CTRL_REC-RCVPOR = C_RCVPOR. "Receiver Port
S_CTRL_REC-MESTYP = C_MESTYP. "Message type
S_CTRL_REC-IDOCTP = C_IDOCTP. "Basic IDOC type
S_CTRL_REC-RCVPRT = C_RCVPRT. "Partner type of receiver
S_CTRL_REC-RCVPRN = C_LOGSYS. "Partner number of receiver
* S_CTRL_REC-SNDPRT = C_SNDPRT. "Sender Partner type
* S_CTRL_REC-SNDPRN = C_SNDPRN. "Sender Partner Number
ENDFORM. " GENERATE_CONTROL_RECORD
*&---------------------------------------------------------------
------*
*& Form SEND_IDOC
*&---------------------------------------------------------------
------*
* text
*----------------------------------------------------------------
------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------
------*
FORM SEND_IDOC .
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
MASTER_IDOC_CONTROL = S_CTRL_REC
* OBJ_TYPE = ''
* CHNUM = ''
TABLES
COMMUNICATION_IDOC_CONTROL = T_COMM_IDOC
MASTER_IDOC_DATA = T_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.
ELSE.
COMMIT WORK.
LOOP AT T_COMM_IDOC.
WRITE:/ 'IDoc Generated - ', T_COMM_IDOC-DOCNUM.
ENDLOOP.
ENDIF.
ENDFORM. " SEND_IDOC
*&---------------------------------------------------------------
------*
*& Form ARRANGE_DATA_RECORDS
*&---------------------------------------------------------------
------*
* text
*----------------------------------------------------------------
------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------
------*
FORM ARRANGE_DATA_RECORDS .

sapsamplepro.blogspot.com/2011/06/idoc-step-by-step-outbound-process.html 8/10
6/30/2019 SAP Sample Programs: IDOC Step-by-Step. OUTBOUND process

SORT T_zdemo_material BY BUKRS.

LOOP AT T_zdemo_material.
S_ZSEGMENT-MANDT = T_zdemo_material-MANDT.
S_ZSEGMENT-BUKRS = T_zdemo_material-BUKRS.
S_ZSEGMENT-BUTXT = T_zdemo_material-BUTXT.
S_ZSEGMENT-ORT01 = T_zdemo_material-ORT01.
s_ZSEGMENT-ADRNR = T_zdemo_material-ADRNR.
T_EDIDD-SEGNAM = C_ZSHSTUSEG.
T_EDIDD-SDATA = S_ZSEGMENT.
APPEND T_EDIDD.
CLEAR T_EDIDD.
ENDLOOP.
ENDFORM. " ARRANGE_DATA_RECORDS

====================================================

Now execute the program, and specify the range of records to transfer

Idoc generated id you will get.

Go to TCODE WE02 to check the generated IDOC control records.

Click on Execute or Refersh

If u find the Status Yellow.

Then Go se38.. Program name: RSEOUT00...Execute

Go to TCODE WE02 to check the generated IDOC control records.

sapsamplepro.blogspot.com/2011/06/idoc-step-by-step-outbound-process.html 9/10
6/30/2019 SAP Sample Programs: IDOC Step-by-Step. OUTBOUND process

====================================================

Took Reference from the link given below:


http://www.saptechnical.com/Tutorials/ALE/Guide/Index.htm

Posted by Ravindrakvs at 9:36 AM

No comments:

Post a Comment
Note: Only a member of this blog may post a comment.

Enter your comment...

Comment as: Google Accoun

Publish Preview

Newer Post Home Older Post

Subscribe to: Post Comments (Atom)

Simple theme. Theme images by merrymoonmary. Powered by Blogger.

sapsamplepro.blogspot.com/2011/06/idoc-step-by-step-outbound-process.html 10/10

You might also like