‎2008 Jun 30 7:39 AM
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.
‎2008 Jun 30 7:40 AM
‎2008 Jun 30 7:51 AM
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