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: 

How to fill standard segments in IDOC?

Former Member
0 Kudos

Hi all,

I am working with PO change with IDOC - ORDERS05.

My requirement is that i need to fill some of the segments which i didnt find during change of the PO.

So, i have used the User exit and trying to append the segment what i need.

But it was giving me an error as "EDI: Syntax error in IDoc (segment cannot be identified)" in we05 transaction.

Please help me out regarding.

The Segment i need to fill is - E1EDPT1 and E1EDPT2.

Thanks and Regards,

Gopi.

3 REPLIES 3

Former Member
0 Kudos

please send code i ll check if you are missing something

0 Kudos

Hi Madan,

Please find the code which i am writing in the exit - EXIT_SAPLEINM_011

READ TABLE DINT_EDIDD WITH KEY SEGNAM = 'E1EDP01'.

IF SY-SUBRC EQ 0.

L_COUNT = SY-TABIX.

L_FLAG = 'X'.

ENDIF.

IF L_FLAG EQ 'X'.

CLEAR DINT_EDIDD.

READ TABLE DINT_EDIDD WITH KEY SEGNAM = 'E1EDPT1'

SDATA+0(3) = 'F01'.

IF SY-SUBRC NE 0.

CLEAR DINT_EDIDD.

L_COUNT = L_COUNT + 1.

DINT_EDIDD-SEGNAM = 'E1EDPT1'.

DINT_EDIDD-SDATA+0(4) = 'F01'.

DINT_EDIDD-SDATA4(3) = SY-LANGU0(1).

DINT_EDIDD-SDATA+7(2) = SY-LANGU.

INSERT DINT_EDIDD INDEX L_COUNT.

CLEAR DINT_EDIDD.

DINT_EDIDD-SEGNAM = 'E1EDPT2'.

LOOP AT DEKPO.

CLEAR: L_OBJNAM,

L_TLINE.

CONCATENATE DEKPO-EBELN DEKPO-EBELP INTO L_OBJNAM.

CALL FUNCTION 'READ_TEXT'

EXPORTING

ID = 'F01'

LANGUAGE = SY-LANGU

NAME = L_OBJNAM

OBJECT = 'EKPO'

TABLES

LINES = L_TLINE

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

NOT_FOUND = 4

OBJECT = 5

REFERENCE_CHECK = 6

WRONG_ACCESS_TO_ARCHIVE = 7

OTHERS = 8.

IF SY-SUBRC EQ 0.

IF NOT L_TLINE[] IS INITIAL.

L_COUNT = L_COUNT + 1.

READ TABLE L_TLINE INDEX 1.

IF SY-SUBRC EQ 0.

DINT_EDIDD-SDATA = L_TLINE-TDLINE .

DINT_EDIDD-SDATA+70(2) = L_TLINE-TDFORMAT.

INSERT DINT_EDIDD INDEX L_COUNT.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

ENDIF.

Thanks and Regards,

Gopi.

0 Kudos

Hi ,

If you want to add the data for some more fields you need to read the particular record in the DINT_EDIDD and modify that particulat record dont insert new record. This is happened due the IDOC stucture like mandatory segment and maximum number of times repeated for a chlid segment.

Regards,

Rajesh.