cancel
Showing results for 
Search instead for 
Did you mean: 

Help on UDF

Former Member
0 Kudos

Hi all,

IDOC to CIDX4.0 XML message.

Below code I had write on the UDF. Here the problem,

The partner is passing "PARTNER_Q" from E1EDRM1 segment in ORDERS05. So I have chance to get multiple E1EDRM1 segments. If you see the below condition which is "ZF" and "RE", First I want check for "ZF" partner type, if it is found I have to create target node. If it is not I need to look for "RE" partner type. The problem is when E1EDRM1 comes multiple segments with partner types "ZF" and "RE" it is creating multiple target nodes which I don't want. Is there any chance to create global variable where I can set some flag come out code.

public void getOtherpartner(String[] frtTerm,String[]

Partner,ResultList result,Container

container){

//write your code here

if (frtTerm[0].equals("02") || frtTerm[0].equals("03") )

{

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

{

if (Partner<i>.equals( "OSO"))

{

result.addValue( "true");

}

}

}

//Check the ZF and RE Parters

if (frtTerm[0].equals("01") )

{

for (int j= 0; j < Partner.length; j++)

{

if(Partner[j].equals("ZF") || Partner[j].equals("RE"))

{

result.addValue( "true");

}

}

}

Accepted Solutions (1)

Accepted Solutions (1)

moorthy
Active Contributor
0 Kudos

Hi Murali,

You can create a global variable and go for this.

Some discussion on this-

Also You can think on Global COntainer for this-

http://help.sap.com/saphelp_nw2004s/helpdata/en/75/8e0f8f3b0c2e4ea5f8d8f9faa9461a/content.htm

For this-

/people/michal.krawczyk2/blog/2005/03/04/globalcontainer--in-graphical-mapping-xi

Hope this helps,

Regards,

Moorthy

Former Member
0 Kudos

Moorthy,

I clear the issue using Boolean and break statements..

Thanks

M

Answers (1)

Answers (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Another option would be to write an Advanced UDF and pass the entire Queue to the UDF so that all values are available in an array.

http://help.sap.com/saphelp_nw04/helpdata/en/f8/2857cbc374da48993c8eb7d3c8c87a/content.htm

Regards,

Bhavesh