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
426

Hi All,

How to send custom IDOC(custom message type).

Thanks&regds,

srinivas.

2 REPLIES 2
Read only

Former Member
0 Likes
402

first of all u have to create custom message type, idoc type. u have to write the program to populate in data record, status record, control record, and u check partner profiles, port settings then u can send it, but in recieving side they should have different program to post custom msg type

Read only

Former Member
0 Likes
402

hi,

First try to create a Module pool program.

Assign the tcode to the IDOC.

or else get the data into IDOC segment and try to transfer it.

Creation of IDoc

To Create Idoc we need to follow these steps:

Create Segment ( WE31)

Create Idoc Type ( WE30)

Create Message Type ( WE81)

Assign Idoc Type to Message Type ( WE82)

Creating a Segment

Go to transaction code WE31

Enter the name for your segment type and click on the Create icon

Type the short text

Enter the variable names and data elements

Save it and go back

Go to Edit -> Set Release

Follow steps to create more number of segments

Create IDOC Type

Go to transaction code WE30

Enter the Object Name, select Basic type and click Create icon

Select the create new option and enter a description for your basic IDOC type and press enter

Select the IDOC Name and click Create icon

The system prompts us to enter a segment type and its attributes

Choose the appropriate values and press Enter

The system transfers the name of the segment type to the IDOC editor.

Create IDOC Type

Follow these steps to add more number of segments to Parent or as Parent-child relation

Save it and go back

Go to Edit -> Set release

Create Message Type

Go to transaction code WE81

Change the details from Display mode to Change mode

After selection, the system will give this message “The table is cross-client (see Help for further info)”. Press Enter

Click New Entries to create new Message Type

Fill details

Save it and go back

Assign Message Type to IDoc Type

Go to transaction code WE82

Change the details from Display mode to Change mode

After selection, the system will give this message “The table is cross-client (see Help for further info)”. Press Enter.

Click New Entries to create new Message Type.

Fill details

Save it and go back

u can also check all these links related to idocs

http://www.allsaplinks.com/idoc_sample.html

http://www.allsaplinks.com/

http://www.sap-img.com/

http://www.sappoint.com/abap.html

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEIO/BCMIDALEIO.pdf

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDALEPRO/BCMIDALEPRO.pdf

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFAALEQS/CABFAALEQS.pdf

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDISC/CAEDISCAP_STC.pdf

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVEDI/CAEDI.pdf

http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm

http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc

http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419

http://www.netweaverguru.com/EDI/HTML/IDocBook.htm

http://www.sapgenie.com/sapedi/index.htm

http://expertanswercenter.techtarget.com/eac/knowledgebaseCategory/0,295197,sid63_tax296858_idx0_off...

http://sap.ittoolbox.com/documents/popular-q-and-a/extending-a-basic-idoc-type-2358

http://help.sap.com/saphelp_47x200/helpdata/en/dc/6b7eee43d711d1893e0000e8323c4f/frameset.htm

/thread/199996 [original link is broken]

Check this program.

REPORT Z243IDOC_PROGRAM.

DATA: Begin of imara occurs 0,

matnr like mara-matnr,

mtart like mara-mtart,

mbrsh like mara-mbrsh,

meins(3) type c,

end of imara.

data: begin of imakt occurs 0,

maktx like makt-maktx,

end of imakt.

DATA: wamas_con LIKE edidc,

imas_data LIKE edidd OCCURS 0 WITH HEADER LINE,

icom_con LIKE edidc OCCURS 0 WITH HEADER LINE.

PARAMETERS: e_matnr LIKE mara-matnr,

e_msgtyp LIKE edidc-mestyp,

e_rcvprn LIKE edidc-rcvprn.

  • retrive app. data from DB

SELECT matnr mtart mbrsh meins FROM mara INTO TABLE imara WHERE

matnr = e_matnr.

SELECT maktx FROM makt INTO TABLE imakt WHERE

matnr = e_matnr and SPRAS = 'E'.

*Master idoc control record

wamas_con-rcvprt = 'LS'.

wamas_con-rcvprn = e_rcvprn.

wamas_con-idoctp = 'YMATMAS1'.

wamas_con-mestyp = e_msgtyp.

  • master idoc data records

LOOP AT imakt.

imas_data-segnam = 'YMAKT1'.

move imakt to imas_data-sdata .

APPEND imas_data.

ENDLOOP.

LOOP AT imara.

imas_data-segnam = 'YMARA1'.

move imara to imas_data-sdata .

APPEND imas_data.

ENDLOOP.

CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'

EXPORTING

master_idoc_control = wamas_con

  • OBJ_TYPE = ''

  • CHNUM = ''

TABLES

communication_idoc_control = icom_con

master_idoc_data = imas_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.

ENDIF.

COMMIT WORK.

<b>Reward points if this helps you</b>

Regards

SIva

Message was edited by:

SivaKumar