cancel
Showing results for 
Search instead for 
Did you mean: 

Graphical mapping question - need to create 2 nodes for each record

Former Member
0 Kudos

The mapping is from flat to nested, i.e. flat file to FIDCC2 idoc. Each record has to go to 2 repeated IDoc segments, each one with different posting key. Right now, I have it working for each record to a segment(for one segment) by using splitByValue (value change). How can I repeat the creation of another but with slightly different constant.

Also, how do I add line numbers? I remember seeing a posting on this a while ago - cannot locate it.

Will be Rewarded WELL.

Thanks,

Pam

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Can you post simple source strucrure and target structure to demonstrate your question ?

Thanks

Liang

Former Member
0 Kudos

Here's how the source data will look like -

DN001, PC1, 10,00, CHF, 138000, 138100

DN001, PC3, 20,00, CHF, 138000, 138100

each line will map to 2 posting keys, + and 1 or 2 segments in the IDoc.

Let me know if you need more info.

Thanks,

Pam

Former Member
0 Kudos

Each line will map to two segments of one IDOC ?

or all Lines map to one IDOC, each line map to two segments ?

Liang

Former Member
0 Kudos

Each line maps to 2 E1FISEG segments one with posting key 40 and other with 50.

Former Member
0 Kudos

In this way, you need to create one or two UDFs, which map one to two:

Choose Queue Option

One parameter: a

You will need loop all values in the queue:

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

{

result.addValue(a<i>);

result.addValue(a<i>);

}

I am just giving you idea, not exact code.

And the code need to be modified if the node is child level, need to add context change.

Liang

Former Member
0 Kudos

Hi Liang,

About 10 minutes, I ended up writing the same code...I'll give you points anyway.

I have another requirment in the same area.

So the target segment field gets 40 and 50 values.

ex: 40, 10.00, act1

50, -10.00, act2

Now based on this 40/50 value, I need to map account number. Since account number is another field, how can I tell if I'm working on 40 or 50. How do I store a global value...any idea.

Thanks, Pam

Former Member
0 Kudos

Hi Liang,

About 10 minutes, I ended up writing the same code...I'll give you points anyway.

I have another requirment in the same area.

So the target segment field gets 40 and 50 values.

ex: 40, 10.00, act1

50, -10.00, act2

Now based on this 40/50 value, I need to map account number. Since account number is another field, how can I tell if I'm working on 40 or 50. How do I store a global value...any idea.

Thanks, Pam

Former Member
0 Kudos

Hi, Pam

Using the following example to store it as global variable

SetParameter from GloabalContainer:

container.getGlobalContainer ().setParameter ("COUNTER", "0");

GetParameter from GloabalContainer:

String myCounter = (String) container.getGlobalContainer().getParameter ("COUNTER");

When you map to your constant, store it in global variable, then you map other field, get current global variable, check its value, based on the value, you do proper mapping.

Hope it helps

Liang

Former Member
0 Kudos

Here I'm a little confused.

I duplicated my node for a 40 posting key segment and a 50 posting key segment. If I have several, it becomes,

40

50

40

50

and it working fine.

Now I move on to mapping account number, 40 get a act1 and 50 act2.

My question should have been how would I store the array

40

50

40

50

?

right.

very confusing.

Thanks, Pam

Former Member
0 Kudos

Hi, Pam:

Does your 40, 50 value come from source side, or just get from constants ?

Liang

Former Member
0 Kudos

from constants.

Former Member
0 Kudos

Does your 40 and 50 always has one to one:

e.g: 40 always get a act1

and 50 always get act2 ?

Are other fieild value also based on 40 / 50 value ?

Liang

Former Member
0 Kudos

No. I'm solving this the same way I duplicated the node. My first one is always 40 followed by 50, and more if required in the same order. So I'm populating account numbers accordingly.

Thanks for your time and help. Points awards.

Former Member
0 Kudos

Good job Pam.

liang

Answers (0)