Application Development 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: 

IDOC: How to create child segment with abap code.

Former Member
0 Kudos

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

3 REPLIES 3

manubhutani
Active Contributor
0 Kudos

Hi

I think you are sendind data in a segment which is not there in the receiving system.

Firstly check that from we30(idoc type) and we30 (segment).

It may be the case you are using extension of an idoc type but you have not mentioned that in the partner profile(we20)

Kindly let me know if there's any doubt !!

Regards

Manu

alex_m
Active Contributor
0 Kudos

If you post your question as readable then you will get quick answer..

Former Member
0 Kudos

Hi,

following in debugging mode the abap code of the INCLUDE ZXTRKU02 where is defined the TABLES IDOC_DATA STRUCTURE EDIDD, I find that all field of the table IDOC_DATA are not set. More exactly my expectation is to find values for SEGNUM, HLEVEL, PSGNUM.

In a few words I need to execute an enhancement, via abap code, of the struscure of the idoc before sending it out since I have a requirement to test this enhancement in my XI environment, receiving as input this ideoc modified.

Then, I need to add a new segment and one child.

Any suggestion will be well appreciated.

Thanks in advance.

Regards,

Giovanni