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

How to Create IDOCs for a Custom Basic IDOC Type

Former Member
0 Likes
1,290

Hi friends,

I Have a Custom Basic IDOC Type.

For that IDOC Type i need to Create an IDOC for every Header Item.

The Header Item may have variation (Different) number of Line Items.

in this case can i Use

MASTER_IDOC_DISTRIBUTE and create the Idoc for each Header Item.

or is there any way to create the IDOCs

Thanks in Advance.

Ganesh.

hi,

You can use MASTER_IDOC_DISTRIBUTE to create the IDOC.

It will work fine.

Regards,

Raghu

4 REPLIES 4
Read only

Former Member
0 Likes
834

hi,

to create custom idoc -

1. we31 to create segments with the fields.

2. we30 to create the idoc type using the segments.

3. create message type.

4. we41/we42 to create process code.

5. create custom function module to process idoc.

6. bd51 to register function module.

7. we57 assign function to message type and idoc type.

goto area menu wedi, look under development.

cheers.

...reward if useful.

Read only

Former Member
0 Likes
834

hi,

You can use MASTER_IDOC_DISTRIBUTE to create the IDOC.

It will work fine.

Regards,

Raghu

Read only

Former Member
0 Likes
834

Hi Raghu Thanks,

I am Working on an Outbound IDOC (i.e.; i need to send IDOCs from SAP to XI server)

Kindly find the Basic IDOC Type.

Here for each Route I need to generate an Outbound IDOC.

Each Route consists of multiple Customer records,

Each Customer Consists of Multiple Meter records,

Each Meter consists of Multiple Reading Records.

How can I generate an IDOC for each Route.

I am using MASTER_IDOC_DISTRIBUTE Function Module for generating IDOC's

here I am getting IDOC Status 26.

My Question is for each Route, Mutliple Customers are there.

How to Pass Multiple customers data into SDATA field.

Kindly sugget me.

Read only

0 Likes
834

Hi ,

If I am not wrong you need to pass data via fm "MASTER_IDOC_DISTRIBUTE".

So you can transfer row by row data into SDATA filed of structure type :EDID ,

by concatenating the data into one field of type sdata. and passing it into the fm.

I.e defining a internal table of type EDIDD.

Try this :

DATA : itab TYPE TABLE OF edid,

itab1 TYPE TABLE OF edidc.

LOOP AT itab2 INTO wa_itab2.

CONCATENATE wa_itab2-t1 wa_itab2-t2 wa_itab2-t3 wa_itab2-t4 wa_itab2-t5

INTO result.

itab-sdata = result.

APPEND itab.

all function 'MASTER_IDOC_DISTRIBUTE'

exporting

master_idoc_control =itab1

  • OBJ_TYPE = ''

  • CHNUM = ''

tables

communication_idoc_control =

master_idoc_data =itab.

  • 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.