cancel
Showing results for 
Search instead for 
Did you mean: 

Content conversion for multilevel varying structure File to Idoc

Former Member
0 Kudos

Hi All,

I have following file structure.

VO

C1

S1 1 to unbounded

H1 1 to unbounded

D1 0 to unbounded

D2 0 to unbounded

U2 0 to unbounded

UC 0 to unbounded

My Idoc structure.

ISU_EL34

IDOC 0 to unbounded

E1ISU34 1 to unbounded

ZSEGMENT 0 to 1

I have applied the content conversion for the length specific file as follows.

Recordset structure: VO,1,C1,1,S1,1,H1,1,D1,,D2,,U2,,UC,

Do I need to do any changes over here to satisfy the above file structure.

V0 and C1 occurs only once in a file.

for S1 I should have H1 compulsory and others are optional, but i need to create Idoc when D1 data is available only.

I'm able to read the total file with the above content conversion.

MY requirements:

1) I need to create the Idoc based on the occurance of D1 node. I'm using H1 data also in the idoc not S1.

2) My doubt is whether the content conversion I have provide is applicable to the structure I have prepared.

3) When I'm trying useOneAsMany function for the above ie H1 data should repeat in Idoc as and when D1 repeats.I'm failing the error is both queues are not contain same number of data..

Could anyone suggest how I should approach for the above scenario.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

>>><i>1) I need to create the Idoc based on the occurance of D1 node. I'm using H1 data also in the idoc not S1.</i>

Try mapping the IDOC segment in the target to D1 segment of the source structure.

<i>3) When I'm trying useOneAsMany function for the above ie H1 data should repeat in Idoc as and when D1 repeats.I'm failing the error is both queues are not contain same number of data..</i>

useOneAsMany function should have an imput with an occurence of 1..1. The source H1 field has an occurance of 1 to unbounded, so I dont think you can use this function here.

The queue error you are getting here is because of the occurance.

Regards,

Smitha.

Former Member
0 Kudos

Hi Smitha,

Thank u very much.

But i have used like that only..problem is I should not cretae any Idoc for H1 which is not having relevent D1, but it is creating Idoc .

Because of this reason only I tried useOneAsmany function on H1 to correlate D1s.

Thanks,

venu.

Former Member
0 Kudos

Hi,

Have you tried this?

D1 --> exists --> If

H1--> then --> IDOC

(If D1 exists, then map H1 to IDOC)

Regards,

Smitha.

Former Member
0 Kudos

Hi Smitha,

I have tried this option also..

Even in this case also, the values of H1 are considered and created the Idoc. which I don't want.

Do i need to change anything in Content conversion according this structure.If anything is wrong pls could u suugest me.

Thanks,

venu.

Former Member
0 Kudos

Hi,

In the above mentioned solution, the idoc is created only if the D1 exists for a corresponding H1 segment.

<i>Even in this case also, the values of H1 are considered and created the Idoc. which I don't want.</i>

The values of H1 are considered only if corresponding D1 exists.

Is this not the solution you wanted?

If no, could you please be a little more clear.

Regards,

Smitha.

Answers (1)

Answers (1)

STALANKI
Active Contributor
0 Kudos

Hi Venu,

First map directly D1 TO Idoc.

then map the h1 fields to idoc fields in the following way

say h1 has field 1 and u want to map to idoc field1 under equavlent d1 node in idoc..

1.set the context of d1 and h1 to the root.

2.write a advanced user defined function copyHeader which will take header 1(a[]) and node D1 as input(b[])

for (int i=0;i<b.length();i++)

{

result.addValue(a<i>);

result.addValue(Result.CC);

}If I understood right it will solve ur problem 100%!

Former Member
0 Kudos

Hi Sravya,

It is really helpfull answer , Thanks for sharing my problem .

It worked for this purpose, but I'm facing following problems

MY scenario

The file contains records V0,C1,S1,H1,D1,D2,U2 and Uc

In which I’m using the data of H1,D1,D2,U2 and UC for creating target Idoc.

Every H1 contains at least 1 D1 record, If D1 exists D2 ,U2 and UC may or may not exist.If exists those are in a sequence and should consider the data of them to create Idoc.

Idoc should be created for every D1.

Problem facing:

Do we have any mechanism to group the D1 records to the relevant header.since I’m unable do this with content conversion.

I think bcz of above problem; some records (D2 & U2 & UC) data is populating in Idoc even there is no D2,U2 and Ucs.

Thanks,

venu.