cancel
Showing results for 
Search instead for 
Did you mean: 

Multipe Nodes Problem

sridharreddy_kondam
Active Contributor
0 Kudos

Hi All,

Multiple ARTMAS05 IDOCs sent from SAP to PI and to be sent to a flat file (All idocs data in one flat file) (EHP1 for PI 7.0 is applied)

output should be 3 target nodes

but I am getting 4 target nodes as there are 4 plants

I mapped like this PLANT collapse contexts  Fixvalues(MM31 or MM32 = true) EQUALS Constant(true)

If

Then

IDOC.

e.g-->

Source

ARTMAS05

IDOC

E1BPE1MARCRT (0u2026..Unbounded)

PLANT = MM31

E1BPE1MARCRT

PLANT = MM32

E1BPE1MARCRT

PLANT = MM35

E1BPE1MARCRT

PLANT = MM38

IDOC

E1BPE1MARCRT (0u2026..Unbounded)

PLANT = MM30

E1BPE1MARCRT

PLANT = MM39

E1BPE1MARCRT

PLANT = MM40

E1BPE1MARCRT

PLANT = MM42

IDOC

E1BPE1MARCRT (0u2026..Unbounded)

PLANT = MM21

E1BPE1MARCRT

PLANT = MM31

E1BPE1MARCRT

PLANT = MM32

E1BPE1MARCRT

PLANT = MM38

Source

E1BPE1MARCRT (0u2026..Unbounded)

Target

node (not field) say FDETAIL (0u2026Unbounded)

Please help me how to correct it.

For Each IDOC just check the Plant (MM31 & MM32), If any one of it is found then one IDOC for the target node should be created.

But my case I am getting the target node for each occurrence of the plant which I should notu2026

Please Suggest meu2026

Regars

Sridhar

Accepted Solutions (0)

Answers (7)

Answers (7)

sridharreddy_kondam
Active Contributor
0 Kudos

Hi the problem is solved,

I have used UDF and applied the following code, by passing the input1 as plant (count (context IDOC)), and plant vlaue (context IDOC)....

String strVal="false";

int j = Integer.parseInt(a[0]);

for (int number = 0; number < j; number++)

{

if ( plant[number].equals("MM31") || plant[number].equals("MM32") )

{

strVal="true";

break;

}

}

result.addValue(strVal);

Thanks and Regards,

sridhar

Former Member
0 Kudos

Hi Sridhar,

U are getting 4 'PLANTS' . Based upon four PLANTS u need to update the two PLANTS( When trigger (MM31 or MM32).

As my suggestion u need to maintain the CONDITION in CONDITION EDITOR in Receiver Determination.

IF PLANT = MM31 it trigger to receiver.

IF PLANT = MM32 it trigger to same receiver.

Regards,

Sateesh N

Former Member
0 Kudos

Hi,

I thought you expecting two nodes in the target for each MM31 and MM32.

Use below one.

PLANT(Change the context to IDOC)Fixvalues(MM31 or MM32 = true)EQUALS--Constant(true) sortcollapsecontextcreateIfTarget.

in Sort function you should select--type of comparision:Case Insensitive

Order: descending

Regards,

Prakasu.M

prasannakrishna_mynam
Contributor
0 Kudos

Hi,

Use the following UDF type Value.

String strVal="false";
if(a.equals("MM31") || a.equals("MM32"){
       strVal="true";
}

return strVal;

and use this UDF in the follwoing mapping

plant->UDF->removecontext->IF(true) Then IDOC(source) -> IDOC(target)

Regards,

Prasanna

Former Member
0 Kudos

HI,

You need to write a UDF as you have many plants in one IDOC.

Write an UDF to check the all the plats in an IDOC and at the first occurence of MM31 or MM31 return TRUE.

And do the mapping as follow:

Plant (Context to IDOC)-> UDF(Select context) to check the plant and return true/false-> CreateIF-> Target node.

Regards,

Shweta.

sridharreddy_kondam
Active Contributor
0 Kudos

Hi Shweta,

THanks for the reply, I justed started to write an UDF, and once done will let you know...

But If any one can suggest me if any i can go without UDF?

I treid in many ways but could not ... so now using UDF ...

WIll update...

Regards,

sridhar

former_member581827
Participant
0 Kudos

Hi,

You can do like this in mapping

For each idoc just check

plant equals to M31

OR>IF>Then mapPlant->createif>target

plant equals to M32

Regards,

Chandra.

Edited by: Chandra on Apr 30, 2009 10:25 AM

Former Member
0 Kudos

Hi,

Map like below.

PLANTFixvalues(MM31 or MM32 = true)EQUALSRemovecontextCreateif--target

Constant(true)----


regards,

Prakasu.M