Parent Child segment relationship error in IDOC

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
vcsasikala
Participant
Posts: 26
Joined: Wed Jun 20, 2007 1:13 am
Location: Chennai

Parent Child segment relationship error in IDOC

Post 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
Regards,

Sasikala V C
atul9806
Participant
Posts: 96
Joined: Tue Mar 06, 2012 6:12 am
Location: Pune
Contact:

Post 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.
~Atul Singh
<a href=http://www.datagenx.net>DataGenX</a> | <a href=https://www.linkedin.com/in/atulsinghds>LinkedIn</a>
vcsasikala
Participant
Posts: 26
Joined: Wed Jun 20, 2007 1:13 am
Location: Chennai

Post 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?
Regards,

Sasikala V C
atul9806
Participant
Posts: 96
Joined: Tue Mar 06, 2012 6:12 am
Location: Pune
Contact:

Post 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.
~Atul Singh
<a href=http://www.datagenx.net>DataGenX</a> | <a href=https://www.linkedin.com/in/atulsinghds>LinkedIn</a>
vcsasikala
Participant
Posts: 26
Joined: Wed Jun 20, 2007 1:13 am
Location: Chennai

Post 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
Regards,

Sasikala V C
Post Reply