Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ale & idocs

Former Member
0 Kudos

Hi friends ,

I want upgrade my skills in abap ,currently i am working on reports i want to develope an idoc program actually every one saying cofiguration settings and distribution model and so on..........but in general what is the actual work of an abaper in developing an idoc and please can any one give the solution how to learn

idoc developement process, if possible give me the reference code.

Thanks in advance,

sasi.

5 REPLIES 5

Former Member
0 Kudos

Arvind nagpal book is the good reference for IDocs.

former_member404244
Active Contributor
0 Kudos

Hi,

for understanding idocs go through the below links

http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm

http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc

http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419

http://www.netweaverguru.com/EDI/HTML/IDocBook.htm

http://www.sapgenie.com/sapedi/index.htm

http://www.sappoint.com/abap/ale.pdf

http://www.sappoint.com/abap/ale2.pdf

http://www.sapgenie.com/sapedi/idoc_abap.htm

http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm

http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm

http://www.allsaplinks.com/idoc_sample.html

http://www.sappoint.com/abap.html

http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm

http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc

http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419

http://www.netweaverguru.com/EDI/HTML/IDocBook.htm

http://www.sapgenie.com/sapedi/index.htm

http://www.allsaplinks.com/idoc_sample.html

also check the below sample code

&----


*& Report ZZ_Program_To_Create_Idoc

&----


report zz_program_to_create_idoc .

tables: ekko,ekpo.

selection-screen skip 3.

selection-screen begin of block b1 with frame title titl.

selection-screen skip.

select-options s_ebeln for ekko-ebeln.

selection-screen skip.

selection-screen end of block b1.

data: header_segment_name like edidd-segnam value 'Z1EKKO',

item_segment_name like edidd-segnam value 'Z1EKPO',

idoc_name like edidc-idoctp value 'Z19838IDOC1'.

data: header_segment_data like z1ekko,

item_segment_data like z1ekpo.

data: control_record like edidc.

data: messagetyp like edmsg-msgtyp value 'ZZ9838MESG1'.

data: i_communication like edidc occurs 0 with header line,

i_data like edidd occurs 0 with header line.

data: begin of i_ekko occurs 0,

ebeln like ekko-ebeln,

aedat like ekko-aedat,

bukrs like ekko-bukrs,

bsart like ekko-bsart,

lifnr like ekko-lifnr,

end of i_ekko.

data: begin of i_ekpo occurs 0,

ebelp like ekpo-ebelp,

matnr like ekpo-matnr,

menge like ekpo-menge,

meins like ekpo-meins,

netpr like ekpo-netpr,

end of i_ekpo.

start-of-selection.

select ebeln aedat bukrs bsart lifnr from ekko

into table i_ekko where ebeln in s_ebeln.

select ebelp

matnr

menge

meins

netpr

from ekpo

into table i_ekpo

where ebeln in s_ebeln.

control_record-mestyp = messagetyp.

control_record-rcvprt = 'LS'.

control_record-idoctp = idoc_name.

control_record-rcvprn = '0MART800'.

loop at i_ekko.

header_segment_data-ebeln = i_ekko-ebeln.

header_segment_data-aedat = i_ekko-aedat.

header_segment_data-bukrs = i_ekko-bukrs.

header_segment_data-bsart = i_ekko-bsart.

header_segment_data-lifnr = i_ekko-lifnr.

i_data-segnam = header_segment_name.

i_data-sdata = header_segment_data.

append i_data.

select ebelp

matnr

menge

meins

netpr

from ekpo

into table i_ekpo

where ebeln = i_ekko-ebeln.

loop at i_ekpo.

item_segment_data-ebelp = i_ekpo-ebelp.

item_segment_data-matnr = i_ekpo-matnr.

item_segment_data-menge = i_ekpo-menge.

item_segment_data-meins = i_ekpo-meins.

item_segment_data-netpr = i_ekpo-netpr.

i_data-segnam = item_segment_name.

i_data-sdata = item_segment_data.

append i_data.

endloop.

clear i_ekpo.

refresh i_ekpo.

endloop.

call function 'MASTER_IDOC_DISTRIBUTE'

exporting

master_idoc_control = control_record

  • OBJ_TYPE = ''

  • CHNUM = ''

tables

communication_idoc_control = i_communication

master_idoc_data = i_data

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.

loop at i_communication.

write: 'IDOC GENERATED', i_communication-docnum.

endloop.

commit work.

endif.

initialization.

titl = 'ENTER THE PURCHASE ORDER NUMBER'.

Reward if helpful.

Regards,

Nagaraj

Former Member
0 Kudos

Former Member
0 Kudos

Hi

see the doc

ALE IDOC

Sending System(Outbound ALE Process)

Tcode SALE - for

a) Define Logical System

b) Assign Client to Logical System

Tcode SM59-RFC Destination

Tcode BD64 - Create Model View

Tcode BD82 - Generate partner Profiles & Create Ports

Tcode BD64 - Distribute the Model view

Message Type MATMAS

Tcode BD10 - Send Material Data

Tcode WE05 - Idoc List for watching any Errors

Receiving System(Inbound ALE )

Tcode SALE - for

a) Define Logical System

b) Assign Client to Logical System

Tcode SM59-RFC Destination

Tcode BD64 - Check for Model view whether it has distributed or not

Tcode BD82 -- Generate partner Profiles & Create Ports

Tcode BD11 Getting Material Data

Tcode WE05 - Idoc List for inbound status codes

ALE IDOC Steps

Sending System(Outbound ALE Process)

Tcode SALE ?3 for

a) Define Logical System

b) Assign Client to Logical System

Tcode SM59-RFC Destination

Tcode BD64 - Create Model View

Tcode BD82 - Generate partner Profiles & Create Ports

Tcode BD64 - Distribute the Model view

This is Receiving system Settings

Receiving System(Inbound ALE )

Tcode SALE - for

a) Define Logical System

b) Assign Client to Logical System

Tcode SM59-RFC Destination

Tcode BD64 - Check for Model view whether it has distributed or not

Tcode BD82 -- Generate partner Profiles & Create Ports

Tcode BD11 Getting Material Data

Tcode WE05 - Idoc List for inbound status codes

Message Type MATMAS

Tcode BD10 - Send Material Data

Tcode WE05 - Idoc List for watching any Errors

1)a Goto Tcode SALE

Click on Sending & Receiving Systems-->Select Logical Systems

Here Define Logical Systems---> Click on Execute Button

go for new entries

1) System Name : ERP000

Description : Sending System

2) System Name : ERP800

Description : Receiving System

press Enter & Save

it will ask Request

if you want new request create new Request orpress continue for transfering the objects

B) goto Tcode SALE

Select Assign Client to Logical Systems-->Execute

000--> Double click on this

Give the following Information

Client : ERP 000

City :

Logical System

Currency

Client role

Save this Data

Step 2) For RFC Creation

Goto Tcode SM59-->Select R/3 Connects

Click on Create Button

RFC Destination Name should be same as partner's logical system name and case sensitive to create the ports automatically while generating the partner profiles

give the information for required fields

RFC Destination : ERP800

Connection type: 3

Description

Target Host : ERP000

System No:000

lan : EN

Client : 800

User : Login User Name

Password:

save this & Test it & RemortLogin

3)

Goto Tcode BD64 -- click on Change mode button

click on create moduleview

short text : xxxxxxxxxxxxxx

Technical Neme : MODEL_ALV

save this & Press ok

select your just created modelview Name :'MODEL_ALV'.

goto add message type

Model Name : MODEL_ALV

sender : ERP000

Receiver : ERP800

Message type :MATMAS

save & Press Enter

4) Goto Tcode BD82

Give Model View : MODEL_ALV

Partner system : ERP800

execute this by press F8 Button

it will gives you sending system port No :A000000015(Like)

5) Goto Tcode BD64

seelct the modelview

goto >edit>modelview-->distribute

press ok & Press enter

6)goto Tcode : BD10 for Material sending

Material : mat_001

Message Type : MATMAS

Logical System : ERP800

and Execute

7)goto Tcode : BD11 for Material Receiving

Material : mat_001

Message Type : MATMAS

and Execute --> 1 request idoc created for message type Matmas

press enter

Here Master Idoc set for Messge type MATMAS-->press Enter

1 Communication Idoc generated for Message Type

this is your IDOC

Change Pointers

I know how to change the description of a material using ALE Change Pointers.

I will give the following few steps

1) Tcode BD61---> check the change pointers activated check box

save and goback.

2) Tcode BD50---> check the MATMAS check box save and comeback.

3) Tcode BD51---> goto IDOC_INPUT_MATMAS01 select the checkbox save and comeback.

4) Tcode BD52---> give message type : matmas press ok button.

select all what ever you want and delete remaining fields.

save & come back.

5) 5) go to Tcode MM02 select one material and try to change the description and save it

it will effects the target systems material desciption will also changes

6) goto Tcode SE38 give program Name is : RBDMIDOC and Execute

give Message type : MATMAS and Executte

ALE/IDOC Status Codes/Messages

-


01 Error --> Idoc Added

30 Error --> Idoc ready for dispatch(ALE Service)

then goto SE38 --> Execute the Program RBDMIDOC

29 Error --> ALE Service Layer

then goto SE38 --> Execute the Program RSEOUT00

03 Error --> Data Passed to Port ok

then goto SE38 --> Execute the Program RBDMOIND

12 Error --> Dispatch ok

Inbound Status Codes

50 Error --> It will go for ALE Service Layer

56 Error --> Idoc with Errors added

51 Error --> Application Document not posted

65 Error --> Error in ALE Service Layer

for 51 or 56 Errors do the following steps

goto WE19 > give the IDOC Number and Execute>

Press on Inbound function Module

for 65 Error --> goto SE38 --> Execute the Program RBDAPP01 then your getting 51 Error

Application Linking and Enabling (ALE)

In this document you will learn the step-by-step procedure to setup the ALE system and go through a transaction between two clients

For our purpose we have two clients

namely Client 100 and Client 200.

System name is SAPKDC (FOR BOTH 100 AND 200 CLIENTS).

Distribution of Material Master Data Between two Systems

1) SETUP LOGICAL SYSTEM: (Note: Do Not Create This Step)

To do this follow the following steps

Execute SALE Transaction Code

On The Screen Click on Sending and Receiving Systems.

Then Click on Logical Systems.

Then Click Defining Logical Systems.

Click New Entries Button

(E.g. (LG100 sending system)

(LG200 receiving system))

Enter two logical system names and their description.

Save

Comeback to SALE Transaction Code screen.

2) Now you have to allocate the created logical systems to respective clients.( Note: Do Not Create This Step)

LG100 assign to client 100

LG200 assign to client 200

To do this, do the following.

Click Assigning Client to Logical System.

Ignore the message that comes up on the screen.

Select client 100

Click details button on the toolbar icon or press F2.

In the logical system box, enter LG100.

Click on the save Icon

Click the back button.

Now select client 200.

Click details icon or press f2.

In logical Systems box, enter LG200.

Save

Back.

Comeback to SALE Transaction Code screen.

3) Maintain RFC Destination: (TR.CODE:SM59)

(Note: Do Not Create This Step)

Click Create Button on the Screen

On the Screen Maintain RFC Destination i.e LG200.

Enter LG200 in RFC destination box.

Connection type is 3

Give a description for the RFC destination.

Maintain Technical Settings on Details on Technical Settings tab

Target Host as : SAPKDC (NOTE: Save it as a Host Name)

Maintain Logon Details on Logon/Security tab.

Language: EN.

User: MMUSER200 (This is the logon for dist.)

Client : 200

Password: MM1234.

Save.

Click on create to do the above process for Client 200 in

The client 200 system.

4) Maintain Distribution Model.(BD64). (ABAPer role starts here)

Execute Maintain distribution model directly for

creating the model.

Click on change mode button on App tool bar of the Screen.

Create Model View pushbutton on App tool bar of the Screen.

A pop screen will appear in which you specify

Short text as Distribution for MM Data.

Enter Technical Name as LGMODEL.

Select Model View and Click on Add Message Type Pushbutton on App toolbar of the Screen.

A popup screen will appear in which you specify

Model View as LGMODEL.

Sender as LG100.

Receiver as LG200.

Again Click on Add Message Type Pushbutton on App toolbar of the Screen.

A popup screen will appear in which you specify

Model View as LGMODEL.

Sender as LG200.

Receiver as LG100.

SAVE.

On the same screen goto Menubar and select Environment.

And then select Generate Partner Profiles , then execute it.

On the Screen specify the Logical System as LG200.

Then execute the screen.

Click back.

Again On the same screen goto Menubar and select EDIT.

Again select Model View and then select Distribute.

****LOGIN to client 200.

Execute Tr.code BD64 and again On the same screen goto Menubar and select Environment.

And then select Generate Partner Profiles , then execute it.

On the Screen specify the Model View as LGMODEL

And Specify the Logical System as LG100.

Then execute the screen.

Click back.

*******Switch back to client 100 Session.

5) Create Material using MM03 Tr.Code.

Enter the material name as LGMATERIAL

Industry sector as Mechanical Engineering

Material Type as Finished Products.

And then Click on Data Pushbutton on the App tool bar.

Select views.

In the select views box for materials check basic data 1 AND 2.

Click enter icon.

In the next screen that you get

Give the text of the material as NEW MATERIAL.

Base unit of measure as KG.

Gross Weight as 200.

Net Weight as 100.

Weight Unit as KG.

In the description area language (E) and material description.

Click Save.

Now I Created a Material in Client 100 , I want to transfer this data to Client 200.

6) Execute BD10 to transfer the material in which you specify

the material as LGMATERIAL and

message type as MATMAS (client100).

Then a Screen will be displayed in which it shows that

1 Master Idoc Generated .. Enter

1 Communication Idoc Generated..Enter.

*******LOGIN to Client 200.

7) Execute BD11 to get the material in which you specify

the material as LGMATERIAL and

message type as MATMAS (client200).

😎 Execute Tr.code MM03 and give the material as LGMATERIAL

and see that the material is displayed as it was in Client 100.

If not follow these steps.

9) Execute Tr.code WE19( for rectification of errors in client200).

Specify the Existing Idoc Number and Executes it .

A Screen is displayed in which you specify the corresponding Function Module as INPUT_IDOC_MATMAS01 and execute it.

10) Execute Tr.code MM03 and give the material as LGMATERIAL

and see that the material is displayed as it was in Client 100.

Now the Material is correctly displayed in Client 200.

11) Monitoring of IDOCS.

Transaction Codes:

IDOC Display of Status: WE 05.

IDOC Date and Time: WE07.

Outbound:

Step 1. Application document is created when transaction is saved.

2. Message control is invoked.

3. Messages are processed by system.

4. Messages are Edited (if desired).

5. Output (ALE / EDI) is checked

6. Validate against Message control record from Partner Profile

7. Application Document is saved.

8. Entry NAST table is created for every selected output program

along with Medium & Timing.

9. Check for Process Immediately .

If (yes)

Determine Processing Program from TNAPR Table.

ELSE

Execute RSNASTED Program.

10. Read Partner Profile to determine Process Code.

11. Process Code points to the Function Module & Invoked.

12. IDoc is generated.

13. Check for ALE Request.

if (Yes)

Perform Filters, Conversions, Version Changes etc.

Else.

IDoc is stored in DATABASE.

INBOUND:

Step 1. EDI Subsystem creates an IDoc file from EDI Messages

2. Subsystem calls Functional Module EDI_DATA_INCOMING from startRFC program.

3. Data in Control Record is validate against the Partner Profile.

4. IDoc is generated in Database and syntax check is carried out.

5. IDoc file is deleted once file read.

6. Event PROCESSSTATE REACHED is triggered in Idoc Object Workflow.

7. Check for Process Immediately.

If NO

Execute RBDAPP01 Program

Else

Read Process Code from Partner Profile

Process Code Points to Function Module

Application Document Posted.

further help:

check url

http://www.sappoint.com/abap/ale.pdf

http://www.sappoint.com/abap/ale2.pdf

http://www.sapgenie.com/ale/configuration.htm

http://www.sappoint.com/abap/ale.pdf

http://www.sappoint.com/abap/ale2.pdf

http://www.sapdevelopment.co.uk/training

And also u can get lots of inof from the below link.

http://www.sapgenie.com/ale/why_ale.htm

Regards

Anji

0 Kudos

Hi anji reddy,

Thank you so much for your lots of information but actually my problem is every one is giving in the theoritical manner ,in this case some body is telling we are not doing any configuration settings and also things we will simply develope the idoc code and will do some settings can you please tell me in the real time manner.

Thanks in advance,

sasi.