Page 1 of 1

Parent Child segment relationship error in IDOC

Posted: Tue Apr 05, 2016 3:33 am
by vcsasikala
I'm transmitting an IDOC with below segments in IDOC Type using IDOC Load Connector stage

CONTROLREC -- Control Record
HDRSEG -- Header
DATASEG1 -- Parent Data Segment
EXTDATASEG1 -- Child Segment
DATASEG2 -- Data Segment


ADM_SEGNUM is generated in Connector stage (It is not populated with data moved from datastage)

ADM_PSGNUM -- For parent segment '0' and For child segment it is passed with SEGNUM of its parent segment record as below

SAP_segment ADM_SEGNUM ADM_PSGNUM
HDRSEG ---------------1--------- 0
DATASEG1-------------2--------- 0
EXTDATASEG1--------3--------- 2
DATASEG2-------------4--------- 0
DATASEG1 -------------5--------- 0
EXTDATASEG1---------6--------- 5
DATASEG2--------------7--------- 0
DATASEG1 -------------8--------- 0
EXTDATASEG1---------9--------- 8
DATASEG2 -------------10--------- 0


Data Populated as below in IDOC

SAP_segment ADM_SEGNUM ADM_PSGNUM HLEVEL
HDRSEG------------1------------------------------1
DATASEG1---------2-------------------------------2
EXTDATASEG1-----3--------------2---------------3
DATASEG2----------4------------------------------2
DATASEG1----------5
EXTDATASEG1------6
DATASEG2----------7
DATASEG1----------8
EXTDATASEG1------9
DATASEG2----------10

IDOC Error: E0078 - EDI: Syntax error in IDoc (segment cannot be identified)

PSGNUM (moved from datastage) and HLEVEL (not moved from datastage) are populated from first record alone. So the Parent Child relationship is established for first record only. This needs to be populated for all the records. Please help me in getting the expected output

Posted: Wed Apr 06, 2016 6:41 am
by atul9806
AFAIK, You need to map the Input column to all IDOC Mandatory column and to another (optional) if any.

Control Record and Header Record is compulsory and there should be a link for these 2 records mapping.
Remaining are Data Segment, so import the IDOC definition in Datastage to check what is mandatory and map those.

Posted: Thu Apr 07, 2016 6:50 am
by vcsasikala
Thanks for the reply Atul,

All the Data segments are Optional in my IDOC Type. I had an last segment (LastOPTINALSEG), that I didn't process/ send any data.

I tried sending data for all defined segments in IDOC including header and control and LastOPTINALSEG. But still getting same syntax error"E0078 - EDI: Syntax error in IDoc (segment cannot be identified)"

There were few IDOCs loaded for the same IDOC type by different interfaces using Java adaptors, they were fine in the below order

HDRSEG
DATASEG1
EXTDATASEG1
DATASEG1
EXTDATASEG1
DATASEG1
EXTDATASEG1
DATASEG2
DATASEG2
DATASEG2


I tried sending data in the same order above but the data in intermediate file present in <IBM/InformationServer/Server/DSSAPConnections/SAPCONNECTION/IDocLoadData> path is rearranging in below order before posting..


CONTROLREC
HDRSEG
DATASEG1 EXTDATASEG1
DATASEG2 LastOPTINALSEG
DATASEG1 EXTDATASEG1
DATASEG2 LastOPTINALSEG
DATASEG1 EXTDATASEG1
DATASEG2 LastOPTINALSEG


Is this creating the issue?

Posted: Fri Apr 08, 2016 6:13 am
by atul9806
Ask your SAP team, how the parent and child segment are linked with each other. It should be same as Parent Child table relation ship and accordingly you need to map the data.

such as -
Parent segment --
ID1
ID2

child segment
ID2
some other column

then IDOC identify the records as a child segment of respective parent.

Discuss the IDOC schema with SAP team.

Posted: Wed Apr 13, 2016 12:43 am
by vcsasikala
Parent child relationship is established based on the Hierarchy level populated in IDoc. HLEVEL column value is generated by the connector stage itself(Lat column in my example), this is not taking the value generated and passed from input link. below is the order expected and created properly by other interfaces using Java adapters

HDRSEG
DATASEG1
EXTDATASEG1
DATASEG1
EXTDATASEG1
DATASEG1
EXTDATASEG1
DATASEG2
DATASEG2
DATASEG2