cancel
Showing results for 
Search instead for 
Did you mean: 

ifS issue - output null

masjo
Explorer
0 Kudos

Hi,

I have a graphical mapping in PI 731 which I have simplified in the attached screenshot.

If 'billing' field exists then

     variable field 'test' = RFCLookup

else

     variable field 'test' = blank value

When I do a display queue on the ifS, the output looks exactly as I want. see screenshot.

However, when it is assigned to the variable field. It is all null.  Screenshot below of the display queue for the variable field:

As you can see all the values are now null, even though the output of the ifS looks exactly like I want.

has anyone experienced this before?  am I doing something wrong? 

Thanks in Advance for your help.

Regards

JM

Accepted Solutions (0)

Answers (2)

Answers (2)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

What happens when you run the mapping in test tab instead of just display queue? Generally, do not pass queues or contexts in graphical variables since it does not give consistent results

Hope this helps,

Mark

masjo
Explorer
0 Kudos

Hi

Mark and Sreeni:  Even when I use a field in my message type, and not a graphical variable, the result is the same both in display queue and running in test tab.  When running in test tab, the target field either does not display or has 'CONSTANT'.

Nabendu: No errors in comm channel monitor or sap logs.  When I remove the RFCLookup step, I do not get nulls in the test tab or display queue.

nabendu_sen
Active Contributor
0 Kudos

Hi JM,

Then it concludes that RFC Lookup part is the reason of this 'null' issue. We can ignore all other parts of this mapping for time being. You have mentioned that RFC Channel is working fine and there is no error/issue.

1. Now just open Channel Monitoring and check the last time of polling of this RFC Channel (Channel Log).

2. Then perform Display Queue step in your message mapping and check whether you can see a new entry in the Channel Monitoring (it should show a new message with a latest time because you have just performed Display Queue action).

3. Now perform Message Test in Test tab and again check whether you can see a new entry in the Channel Monitoring (it should show a new message with a latest time because you have just performed Message Test action).

Please let us know the findings in your Communication Channel monitoring Log.

masjo
Explorer
0 Kudos

Hi Nabendu

Both tests show success in the comm channel monitor.

If i use the plain IF (not ifS), the results come through to the target field.  However, my issue is that I do not want the RFCLookup being executed for all records because of performance so that's why I'm trying to get ifS working but it produces completely different results.

If anyone else has any other suggestions I can achieve this, I'm happy to hear it.  i.e. only perform the RFCLookup on certain conditions only.

nabendu_sen
Active Contributor
0 Kudos

Hi JM,

Please use the below UDF taking input the Billing field (Take all the values of the Queue):

  1. public void validBilling(String[] billing,ResultList result,Container container) throws StreamTransformationException {       
  2.      for(int i=0;i<billing.length;i++) 
  3.      { 
  4.        if billing[i].length() > 0
  5.        {
  6.           String output = (billing[i].concat("KUNNR= '")).concat("'");       
  7.           result.addValue(output); 
  8.        }
  9.       else
  10.           result.addValue(billing[i]); 
  11.     } 

You need to do 3 things:

1. After Billing field, add 'removeContext' and point to UDF [When Billing field does not exist it will come as 'null' for which Lookup will not be performed]

2. After RFC Lookup add 'mapWithDefault' with "CONSTANT" as default value. It will transfer all the 'nulls' to "CONSTANT"

3. No need of "ifS", directly map to <*test>.

Message was edited by: Nabendu Sen

masjo
Explorer
0 Kudos

Thanks Nabendu.  I will give this a try and report back

masjo
Explorer
0 Kudos

nabendu,

I tried your solution and ran a test through test tab with test data with one record for which the rfclookup should NOT be performed.  I can see from the comm channel monitor that an rfclookup is performed even with the null coming through to rfclookup.  the null is confirmed via display queue on the udf.

nabendu_sen
Active Contributor
0 Kudos

Hi JM,

is 'test' is added by you in Message Mapping or already present in Message Type? Are you seeing 'null' in Test tab also?

masjo
Explorer
0 Kudos

Hi Nabendu

Thanks for your reply.  'test' is a variable I created in the message mapping, therefore it is not part of message type.  The field that I end up assigning the variable to in the mapping, is null when I run the message mapping.

nabendu_sen
Active Contributor
0 Kudos

Hi JM,

It seems the RFC Lookup is not returning any value when you are testing from Message Tab. At that time actually it gets executed. In Display Queue the values are coming from Source fields, but I dont think RFC gets executed when you run Display Queue. The very next UDF (named 'arrangeLoc...' is generating 'null' as its not getting proper value back from RFC)

At condition you are getting all 'true', which means every time RFC value will be passed to Target 'test', never the Constant value.

Also check your RFC Lookup Communication Channel in RWB, whether thats throwing any error (assuming SAP side BAPI/Function Module has correct value for your test data and it should return back correct values).

masjo
Explorer
0 Kudos

HI Nabendu

I'm a bit confused from your response.  From the screenshot of my ifS queue, I can see that the RFCLookup and my UDF is passing values ie. not null .  Also when I display queue on ifS, there are some conditions that are 'false'.  My screenshot is only a snapshot but if I scroll down, I definitely get 'false'.  Also, if I scroll down, i also see some 'Constant' values.  So it looks like everything is working fine from the ifS step based on the display queue, but the variable 'test' doesn't reflect this at the final result.

nabendu_sen
Active Contributor
0 Kudos

Hi JM,

Please confirm that you are getting 'null' in your test field from UDF (through RFC) as well as from Constant, means for both 'true' and 'false' in your ifS. For 'true' condition we can conclude that RFC is having some issue, but more interesting part is for 'false' why its not showing the constant value.

masjo
Explorer
0 Kudos

Hi Nabendu

The UDF is not the issue.  I have removed it from my mapping and my issue remains the same.

I have done a display queue on the RFClookup and I'm not getting null.

I'm also attaching the screenshot of the ifS statement again but further down the queue.  You can see that the CONSTANT is coming through.

So again, my issue is that the ifS statement appears to be working correctly based on display queue.  but when i display queue on the 'test' variable, it is 'null' for all RFClookups.  CONSTANT is coming through to the 'test' variable but not the rfclookup.

nabendu_sen
Active Contributor
0 Kudos

Hi JM,

'CONSTANT is coming through to the 'test' variable but not the rfclookup'. I got the point, Constant is working but not the other part.

1.Can you please check if you are seeing any error in your RFC Channel in RWB?

2. If you remove the RFC Lookup function in your mapping and directly map to test, are you still getting 'null' in Message Test tab?

former_member201264
Active Contributor
0 Kudos

Hi J M,

If  it is Graphical variable, you can not get the value during testing.

You try and execute end to end  test and check the result.

Regards,

Sreeni.