‎2007 Aug 14 2:59 PM
Hi!
Can any one pls tell me the use of programming in IDOCS.
If possible pls give one example.
Thank u all looking for your reply.
‎2007 Aug 14 3:26 PM
hi
<b>Check out this Links for working on Idoc's.</b>
http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60e2507d11d18ee90000e8366fc2/frameset.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/frameset.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/d5/edf163dcdc11d1890c0000e8216438/frameset.htm
go thru this prog that is done to populate idoc on the outbound side
REPORT ZALE_USR.
CONSTANTS: C_DOCTYP TYPE EDIDC-IDOCTP VALUE 'ZUSRDET01', idoc type
C_SEGNAM TYPE EDIDD-SEGNAM VALUE 'Z1USRDET01', segment type
C_MESTYP TYPE EDIDC-MESTYP VALUE 'ZUSRDET'. message type
DATA: IT_ZUSR02 TYPE USR02 OCCURS 10,
IT_EDIDC TYPE EDIDC OCCURS 0,
IT_EDIDD TYPE EDIDD OCCURS 0,
WA_ZUSR02 TYPE USR02,
WA_EDIDC TYPE EDIDC,
WA_EDIDD TYPE EDIDD,
WA_Z1USRDET01 TYPE Z1USRDET01,
V_OCCMAX TYPE IDOCSYN-OCCMAX,
V_NBSEG TYPE I.
CLEAR WA_ZUSR02.
CLEAR WA_EDIDC.
Save the message type and the basic IDoc type in the control segment.
MOVE C_MESTYP TO WA_EDIDC-MESTYP.
MOVE C_DOCTYP TO WA_EDIDC-IDOCTP.
Retrieve the maximum number of segments in the basic IDoc type.
SELECT MIN( OCCMAX ) FROM IDOCSYN INTO V_OCCMAX WHERE IDOCTYP EQ C_DOCTYP AND SEGTYP EQ C_SEGNAM.
Save the whole USR02 table content in the IT_ZUSR02 internal table.
SELECT * FROM USR02 INTO CORRESPONDING FIELDS OF TABLE IT_ZUSR02.
Create a data segment for each line of IT_ZUSR02.
LOOP AT IT_ZUSR02 INTO WA_ZUSR02 .
MOVE-CORRESPONDING WA_ZUSR02 TO WA_Z1USRDET01.
CLEAR WA_EDIDD.
MOVE C_SEGNAM TO WA_EDIDD-SEGNAM.
MOVE WA_Z1USRDET01 TO WA_EDIDD-SDATA.
APPEND WA_EDIDD TO IT_EDIDD.
CLEAR WA_ZUSR02.
CLEAR WA_Z1USRDET01.
ENDLOOP.
Count the number of data segments.
DESCRIBE TABLE IT_EDIDD LINES V_NBSEG.
If the number of data segments exceeds the maximum allowed number,then display an error message.
IF V_NBSEG GT V_OCCMAX.
WRITE:/ 'ERROR'.
ENDIF.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
master_idoc_control = WA_EDIDC
OBJ_TYPE = ''
CHNUM = ''
tables
communication_idoc_control = IT_EDIDC
master_idoc_data = IT_EDIDD
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.
ENDIF.
<b>reward points for useful ans</b>
Regards
Gaurav
‎2007 Aug 14 3:28 PM
Hi Rahul,
Idocs are nothing but the data containers,ie they carry data from one system to another system with the help of a medium,
The 2 mediums that are avialable are 1. ALE
2.EDI
With the help of these two mediums we exchange the data form on e system and another system.
Regards
Rajesh.
‎2007 Sep 11 5:20 AM
please send step by step method to write the exit for extended idoc orders05
i have added to fields under the segment e1edp01.