Hello Experts,
I have configured ALE on clients 812 (Sender) and 810 (Receiver).
Steps that I have followed.
-> I have created a LS.
-> Assigned LS to Client
-> Created RFC.
-> Defined Port
-> Defined Partner profile.
I have also wriitten a program for the outbound process.
tables : mara.
Selection screen
selection-screen begin of block b1 with frame title text-000.
select-options : s_matnr for mara-matnr.
selection-screen end of block b1.
Internal table and work area
data : begin of t_mm occurs 0,
matnr type matnr, " Material no
mtart type mtart, " Material type
mbrsh type mbrsh, " Industry sector
meins type meins, " Base measurement
end of t_mm.
data : t_edidc type edidc occurs 0 with header line,
w_edidc type edidc,
t_edidd type edidd occurs 0 with header line,
w_seg type z9seg1.
start-of-selection.
select matnr mtart mbrsh meins from mara into table t_mm
where matnr in s_matnr.
Filling Idoc control data
w_edidc-doctyp = 'Z9IDOC1'. " Idoc type
w_edidc-rcvprn = 'LS_SAP_812'. " Partner no receiver
w_edidc-rcvprt = 'LS'. " Partner type of receiver
w_edidc-mestyp = 'ZMSGTYP1'. " Message type
w_edidc-rcvpor = 'ZN_PORT812'. " Receiver port
w_edidc-direct = 1. " Direction of idoc
loop at t_mm.
Looping from internal table to Idco segment
move t_mm-matnr to w_seg-matnr.
move t_mm-mtart to w_seg-mtart.
move t_mm-mbrsh to w_seg-mbrsh.
move t_mm-meins to w_seg-meins.
Moving segment name to EDIDD structure.
move 'Z9SEG1' to t_edidd-segnam.
Moving segment information to EDIDD (data record)
move w_seg to t_edidd-sdata.
clear w_seg.
append t_edidd.
clear t_edidd.
endloop.
Distributing the Idoc to the partner system
call function 'MASTER_IDOC_DISTRIBUTE'
exporting
master_idoc_control = w_edidc
OBJ_TYPE = ''
CHNUM = ''
tables
communication_idoc_control = t_edidc
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
.
read table t_edidc index 1.
write:/2 ' Idoc no : ', t_edidc-docnum color 2.
Kindly help me with an sample program for inbound process for the same.
Regards,
Ranjith N