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

Error while Filling custom extended idoc

Former Member
0 Likes
927

i have extended segment e1edpa1 with ZLOC segment in INVOIC01 idoc .now i'm filling this extended idoc from exit EXIT_SAPLIEDI_101 but it is giving me error like "EDI: Syntax error in IDoc (mandatory segment missing)" can anyone tell me what could be the reason?below is my code.

WHEN 'E1EDPA1'.

MOVE idoc_data-sdata TO e1edpa1.

IF e1edpa1-parvw = 'WE'.

SELECT SINGLE * FROM kna1 INTO w_kna1 WHERE kunnr = e1edpa1-partn.

IF sy-subrc = 0.

MOVE: w_kna1-locco TO zloc-locco,

w_kna1-bahne TO zloc-bahne.

MOVE 'ZLOC' TO idoc_data-segnam. " administrative section

MOVE zloc TO idoc_data-sdata. " data section

APPEND idoc_data.

thx

i have extended segment e1edpa1 with ZLOC segment in INVOIC01 idoc .now i'm filling this extended idoc from exit EXIT_SAPLIEDI_101 but it is giving me error like "EDI: Syntax error in IDoc (mandatory segment missing)" can anyone tell me what could be the reason?below is my code.

WHEN 'E1EDPA1'.

MOVE idoc_data-sdata TO e1edpa1.

IF e1edpa1-parvw = 'WE'.

SELECT SINGLE * FROM kna1 INTO w_kna1 WHERE kunnr = e1edpa1-partn.

IF sy-subrc = 0.

MOVE: w_kna1-locco TO zloc-locco,

w_kna1-bahne TO zloc-bahne.

MOVE 'ZLOC' TO idoc_data-segnam. " administrative section

MOVE zloc TO idoc_data-sdata. " data section

APPEND idoc_data.

thx

5 REPLIES 5
Read only

former_member194669
Active Contributor
0 Likes
863

Please use transaction code WE19 and fill the segment and check

Read only

0 Likes
863

i can fill from we19 manually and remove the error.but i want to fill extended idoc automatically once i issue the message from vf02.

as i already wrote code for filling this automatically in exit EXIT_SAPLIEDI_101,but why values are not populating?

is my code correct?or do i need to add more?

Read only

0 Likes
863

Your code found okay.

For testing this error you need to cross check data thru WE19 & VF02

Read only

0 Likes
863

thx ars.

actually i code in exit EXIT_SAPLIEDI_101 for FM IDOC_INPUT_INVOIC_FI,which is for idoc INVOIC01.

i put a hardcode break-point in my exit EXIT_SAPLIEDI_101 it is trigger only once i'm doing with we19.but once am issuing message from vf02 it is not getting trigger.

how can i fill directly once i issue from vf02?was i m using right exit?

Read only

0 Likes
863

Why do you need to add a segment via code in an inbound IDOC? we dont populate segments in inbound processing, rather you shoul dbe getting value from the source system in the IDOC, and reading the custom segment to process the values.

if source is not sending the values , and you need those then you are supposed to read and process the values to move those to corresponding structure for SAP program to process the data. Adding a segment in inbound is not going to get you anything.