Skip to Content
0
Former Member
Jul 29, 2009 at 02:19 PM

IDOC: How to create child segment with abap code.

247 Views

Hi,

I'am trying to write an abap code to create segments for an Idoc which structure is the following:

{{

ZLE_00060_DLVY

-


> E1EDL20

-


> Z1DEL_CONS

-


>Z1DEL_MAT_HEADER

-


> Z1DEL_MAT

-


> E1EDL20RET2

-


> E1EDL22

-


> E1EDL21

-


> E1EDL23

-


> E1EDL51

}}

I receive a sintax error: Error in IDoc with status 26 .

Checking the result I note all segment at the same level and an error about the segment E1EDL22

EDI: Syntax error in IDoc (segment cannot be identified)

Message no. E0078

Diagnosis

The segment E1EDL22 does not occur at the current level of the basic

type DELVRY05 (extension ZLE_00060_DLVY).

This error can have several reasons:

o The segment E1EDL22 is assigned to a group whose header segment does

not occur.

o The segment E1EDL22 does not exist in the syntax description of the

basic type DELVRY05 (extension ZLE_00060_DLVY).

o The sequence of segments in the group in which the segment appears

is incorrect.

Previous errors ('mandatory' segment or group missing) may be due to

this error.

Procedure

Please check the IDoc or the syntax description of the basic type

DELVRY05 (extension ZLE_00060_DLVY).

After the error I have:

data records

E1EDL20

Z1DEL_CONS

Z1DEL_MAT_HEADER

Z1DEL_MAT

Z1DEL_MAT

Z1DEL_MAT

Z1DEL_MAT

Z1DEL_MAT

Z1DEL_MAT

Z1DEL_MAT

Z1DEL_MAT

Z1DEL_MAT

Z1DEL_MAT

Z1DEL_MAT

Z1DEL_MAT

Z1DEL_MAT

Z1DEL_MAT

E1EDL20RET2

E1EDL22

E1EDL21

Abap code:

.....

{{

idoc_data-segnam = 'Z1DEL_CONS'.

idoc_data-sdata = s_z1del_cons.

append idoc_data.

idoc_data-segnam = 'Z1DEL_MAT_HEADER'.

s_z1del_mat_header-tsegment = 'MATERIAL'.

idoc_data-sdata = s_z1del_mat_header.

append idoc_data.

clear idoc_data-sdata. <<<<<<<<<<< how to indent the structure because this is a child.

idoc_data-sdata = s_Z1DEL_MAT.

idoc_data-segnam = 'Z1DEL_MAT'.

append idoc_data.

idoc_data-segnam = 'E1EDL20RET2'.

idoc_data-sdata = s_E1EDL20RET2.

append idoc_data.

clear idoc_data.

idoc_data-segnam = 'E1EDL22'.

idoc_data-sdata = s_e1edl22.

append idoc_data.

clear idoc_data.

idoc_data-segnam = 'E1EDL21'.

idoc_data-sdata = s_e1edl21.

append idoc_data.

}}

Any help will be well appreciated.

Thanks in advance.

Regards,

Giovanni