Ale Document
Ale Document
ALE IDOCS
Click on create.
If your Segment type name consists of more than 7 characters A popup will come prompting like
Assigned name is longer than 7 characters, but you can ignore this and proceed by clicking
Enter button..
Give the Fields of ZEMPLOYEE_TABLE structure and respective data elements for the fields.
Click on Save.
In the above window segment type was saved with the Transport request Number.
Click on create.
Click on enter.
Minimum Number = 1.
Click on enter.
Go back
Click on yes.
Click on enter.
Click on Save .
Click on enter.
Release as 700 (Generated when clicking on set relese in the segment type).
Save it.
Now we have to Create Logical System for the Sender (800) and Receiver(810).
Expand the Basic settings and next Logical systems like below.
Here the pop-up will come like The Table is Cross-Client , means changes done in one client
will reflect to other client.
Enter logical systems Names for sender , Under LOG SYS Give AUS and sender system for
Name.
And for Receiver system also , LOG SYS is ASIA and Name is receiver system.
Click on Enter.
Go back (F3).
Save it.
Execute SM59.
Language EN.
Client 810.
User SAP*
Password 06071992.
Click on Enter.
Creating Port(WE21):
Execute WE21.
Click on Enter.
Save it.
Go to change mode.
Click on Enter.
Click on Save.
Click on Execute(F8).
Click on Enter.
Execute WE20.
REPORT ZMASTER_IDOC_OUTBOUND.
data : wa_cntl TYPE EDIDC.
ControalRecord
data : it_cntl TYPE STANDARD TABLE OF EDIDC,
it_data TYPE STANDARD TABLE OF EDIDd,
wa_data TYPE edidd.
DATA : IT_EMP TYPE STANDARD TABLE OF ZEMPLOYEE_TABLE,
WA_EMP TYPE ZEMPLOYEE_TABLE.
START-OF-SELECTION.
PERFORM GET_DATA.
PERFORM PROCESS_DATA.
PERFORM TRIGGER_IDOC.
*&---------------------------------------------------------------------*
*&
Form GET_DATA
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
* --> p1
text
* <-- p2
text
*----------------------------------------------------------------------*
FORM GET_DATA .
SELECT * FROM ZEMPLOYEE_TABLE INTO TABLE IT_EMP.
ENDFORM.
" GET_DATA
*----------------------------------------------------------------------*
FORM PROCESS_DATA .
DATA : EMP_SEG TYPE ZE1EMPSEG.
LOOP AT IT_EMP INTO WA_EMP .
EMP_SEG-EMPNO = WA_EMP-EMPNO.
EMP_SEG-EMPNAME = WA_EMP-EMPNAME.
EMP_SEG-EMPADD = WA_EMP-EMPADD.
EMP_SEG-EPH
= WA_EMP-EPH.
EMP_SEG-JOIN_DATE = WA_EMP-JOIN_DATE.
WA_DATA-SEGNAM = 'ZE1EMPSEG'.
WA_DATA-SDATA = EMP_SEG.
APPEND WA_DATA TO IT_DATA.
CLEAR : WA_EMP,WA_DATA,EMP_SEG.
ENDLOOP.
ENDFORM.
" PROCESS_DATA
*&---------------------------------------------------------------------*
*&
Form TRIGGER_IDOC
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
* --> p1
text
* <-- p2
text
*----------------------------------------------------------------------*
FORM TRIGGER_IDOC .
wa_cntl-RCVPRT = 'LS'.
wa_cntl-RCVPRN
= 'ASIA'.
wa_cntl-MESTYP
= 'ZEMPDAT'.
wa_cntl-IDOCTP = 'ZEMPLOYEEIDOC.'.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
MASTER_IDOC_CONTROL
= wa_cntl
*
OBJ_TYPE
= ''
*
CHNUM
= ''
TABLES
COMMUNICATION_IDOC_CONTROL
= it_cntl
MASTER_IDOC_DATA
= it_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.
commit WORK.
ENDIF.
ENDFORM.
" TRIGGER_IDOC
Inbound Configuration:
But In 810 Client we have no Acces to change or Create the objects or Configurations.
Thats why we are going for 800 Client . There we will create all configurations for Inbound and
Transport those to 810 Client by using the Client Copy method.
Execute SE37.
Execute WE42 Tcode . There you found the Function Modules under Inbound Process Code.
Double Click on the any of the Process code Under Inbound Process Code Column .
Copy the all Parameter Interface into your Function Module ZINBOUND_FUNCTION_EMP.
Click on Create.
ENDLOOP.
MODIFY ZEMPLOYEE_TABLE FROM TABLE IT_EMP .
IF SY-SUBRC EQ 0.
IDOC_STATUS-STATUS = '53'.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-MSGTY = 'S'.
IDOC_STATUS-MSGID = 'ZMM'.
IDOC_STATUS-MSGNO = '004'.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
ELSE.
IDOC_STATUS-STATUS = '51'.
IDOC_STATUS-DOCNUM = IDOC_CONTRL-DOCNUM.
IDOC_STATUS-MSGTY = 'E'.
IDOC_STATUS-MSGID = 'ZMM'.
IDOC_STATUS-MSGNO = '005'.
APPEND IDOC_STATUS.
CLEAR IDOC_STATUS.
ENDIF.
Save it.
Execute WE57.
Go to change Mode.
Save it.
Execute BD51.
Input Type 0.
Save it.
Execute WE42.
Go to Change Mode.
Give Description.
Click on Enter , And save the Request Number for Client Copy .
Go Back.
Click on Enter.
Save it.
Give The Transport Request Number generated while Saving the Program in Package.
Click on Yes.
Otherwise we have to do Client copy for all Transport Request Numbers generated while doing
all above configurations.
Execute WE20.
Click On Create.
Save it.
Now we have to Execute the outbound program to generate IDOC in Sender System.
After Execution of program we have to Check or monitor whether the Idoc is Delivered
successfully or not.
Execute WE02.
Give direction as 1 .
Give direction as 2.
Thank You,