cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with If Statement on Infotype 0006.

Former Member
0 Kudos

Now I've played with this UDF stuff, I've been on a bit of a roll and simplyfing some mapping!

I have hit a problem... I have three fields on a header record of an HR infotype (E1PITYP-OTYPE= a, E1PITYP-INFTY= b, E1PITYP-SUBTY= c) and depending on satisfying all three of these parameters, to display or hide the whole infotype and header record for infotype.

imports java.*;
 
public String InfoType0006(String a,String b,String c,Container container){
if (a.equals("P") && b.equals("0006") && c.equals("1"))
return "FALSE";
else
return "TRUE";
}

This is then run through a boolean statement (if without else) to either display infotype 0006 or hide it (hence true/false). I have tried sending P, 0005, Z1 and it fails.

Hopefully that may make sense, but when I manipulate the xml data, it always hides all infotypes, after passing through the above statement!

I had this working on E1P0006, but the Idoc fails as there is header data for 0006 but no item data.

Am I asking the impossible?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Barry;

It seems that the UDF condition is not getting satisfied.

Check the output queue from the UDF and see that what it is returning.

Try trimming the incomming values to the UDF.

Mudit

Award points if it helps

Former Member
0 Kudos

Hi Barry,

>>>>but when I manipulate the xml data, it always hides all infotypes, after passing through the above statement!

I think all 3 datas are not satisfying with the condition of your code.It might have a's value is "p".

Try with a.equalsIgnoreCase("P") instead of a.equals("P").

Cheers!

Samarjit

Former Member
0 Kudos

Thanks for your response, however, I have double checked the XML and it appears as:

<INFTY>0006</INFTY><SUBTY>Z4</SUBTY><OTYPE>P</OTYPE>

Former Member
0 Kudos

Hi;

This seems to be the fail condition as SUBTY is Z4 and in teh code we are matching it with 1.

Mudit

Former Member
0 Kudos

I have logged an OSS Note about this, SAP have responded and said this is a known issue with NW04s PI7.0 SP10. They are hoping to release a fix tommorrow!

bhavesh_kantilal
Active Contributor
0 Kudos

Barry,

can you update the Note number once it is published?

Regards

Bhavesh

Former Member
0 Kudos

> Barry,

>

> can you update the Note number once it is published?

>

> Regards

> Bhavesh

No problem Bhavesh!

I thought I was losing my mind [and my colleagues were questioning my sanity! ]

The logic was sound, the Display queues said it would work, but execute and get nothing! I can rest easy tonight!

This is the note number, when SAP release it!

https://service.sap.com/sap/support/notes/1053706

bhavesh_kantilal
Active Contributor
0 Kudos

I can absolutely understand.

The only good news out of this is the quick response you got for your OSS.

Maybe you should add your comments to this thread on the Coffee Corner,

Regards

Bhavesh