Application Development and Automation 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: 
Read only

IDOC

Former Member
0 Likes
354

hi,

i am peer.Can anybody tell how we can develope a program for idoc,

tell me with any example program.

Thanks in Advance.

Regards,

Peer mohamed.

2 REPLIES 2
Read only

Former Member
0 Likes
332

This message was moderated.

Read only

Former Member
0 Likes
332

Hi,

I am giving you simple sinario I hope you can understand by step bye step procedrue under this you have the program.

BD54 (Creating new logical system)

Change/Display (Crl+f4)New entries.

Log system Name

Zlogical SAPLER

(Save)

WE81 message type)

Change? Display (crl+f4) New entries.

Message type Short text

Zmegidoc (enter short text)

(save)

WE31 (Idoc segments )

Segment type: zsegidoc (create)(enter)

Short text (give short text)

Field Name Data element

(Enter whatever fields you want to transfer)

(Save go back (that is initial screen) goto Edit in menu bar items and set release and we can find release number generally it is 620)

(If you want change or modify the fields goto Edit  cancel release and modify and again go edit setrelease) if you want create some more segments create another segment in the same fation. But it is another name.

WE30 (idoc structure)

Obj.name: zbasicidoc (Create)

(Choose radio button basic type or extension type  (if the fields are already transfer in the destination side user extension type , if it is new fields means go to basic type)

Description: (enter short description)

Create  segment type : zbasicidoc

(Select mandatory fields in the check box)

Minimum number : 1

Maximum number : 9999999999

Enter and save

(Come back to initial screen go to menu bar edit u2013 set release  release basic data type (Yes)

 Back

WE82 (create between message type and idoc type )

(change/display(crl+f4) )New entries

Message type basic type release

Zmsgidoc zbasicidoc 620

(Save)

WE21 (port definition)

Select transaction RFC  create

Select own port name radio button

Description : give short description

Enter existing RFC destination

 save.

WE20 (Partner Profile)

a. Partner profiles

b. partner type LS

Select SAPLER

u2022 Create outbound parameters

enter

(Goto next screen)

Fill up message, receiver port and basic type.

Select transfer idoc immediately radio button.

Mention pocket size by default it is 1

 save

After formatting the layer you can write program for creating of Idoc number.

SOURCE CODE

tables : kna1.

select-options : s_kunnr for kna1-kunnr.

data : it_edidc like edidc occurs 0 with header line..

data : it_edidd like edidd occurs 0 with header line.

data : it_kna1 like kna1 occurs 0 with header line.

data : wa_edidc like edidc.

data : wa_zsegidoc like zsegidoc.

start-of-selection.

select * from kna1 into table it_kna1 where kunnr in s_kunnr.

*Control record

wa_edidc-rcvprn = u2018SAPLERu2019.

wa_edidc-rcvprt = u2018LSu2019.

wa_edidc-rcvpor = u2018SAPLERu2019.

wa_edidc-direct = 1.

wa_edidc-mestyp = u2018ZMSGIDOCu2019.

wa_edidc-idoctp = u2018ZBASICIDOCu2019.

*Data record

loop at it_kna1.

move : it_kna1-kunnr to wa_zsegidoc-kunnr,

it_kna1-name1 to wa_zsegidoc-name1,

it_kna1-land1 to wa_zsegidoc-land1.

move : wa_zsegidoc to it_edidd-sdata,

zsegidoc to it_edidd.

call function u2018master_idoc_distrubutionu2019

exprting

master_idoc = wa_edidc

tables

communication = it_edidc

master_idoc = it_edidd

(decomment all exceptions)

if sy-subrc <> 0.

else.

clear it_edidc.

read table it_edidc intex 1.

write : /1 it_edidc-docnum.

endif.

Execute this program you will get idoc number.

After this program you will run u2018RBDMOINDu2019 program you will find which idocs are not processd if your idoc will appear there your idoc is not processed/

You will check your idoc status in WE02 or WE05 T-Codes.

Thanks & Regards,

Murali