cancel
Showing results for 
Search instead for 
Did you mean: 

Output not displayed

Former Member
0 Kudos

I am working on an app where users enter some hours. I then fire a plug to another page, for my own testing purposes to verify that the data is being entered and saved correctly. So input is taken from Bapi_Ptmgrattabas_Mngcreation_Input->Att_Abs_Hours

and then I'm using the output of the same type:

Bapi_Ptmgrattabas_Mngcreation_Input->Output->Att_Abs_Hours

The hours are not being displayed on the next page, and no matter what is entered, 0 is displayed (I assume this was the default). Everything is mapped and bound correctly, so I'm not really sure where the problem might be. Suggestions? Thank you!

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182372
Active Contributor
0 Kudos

Hi Kathleen,

Try to display Bapi_Ptmgrattabas_Mngcreation_Input->Output->Att_Abs_Hours without navigation. If it doesn`t work check did you invalidate output after RFC execution.

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

I don't understand exactly what you are saying to do.

But in my excecuteBapi_etc

I have the line:

wdContext.nodeOutput().invalidate();

Former Member
0 Kudos

Kathleen,

Make sure that:

1. "supplyingRelationRole" is set correctly for "Output" node.

2. You call node.invalidate() after query.execute(), not before!!!

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Former Member
0 Kudos

Yep, I am calling it after execution, of course. And I get nothing! And I have checked and checked again and the supplying rleation role is set correctly for my output. No results!

Former Member
0 Kudos

Kathleen,

Try to debug in the following way:

if (null == query.getOutput() || query.getOutput().get<TableName>() == null)
  wdComponentAPI.getMessageManager().reportWarning("NULL result");
else
  wdComponentAPI.getMessageManager().reportWarning("SIZE: " + query.getOutput().get<TableName>().size());

What size is reported?

VS

Former Member
0 Kudos

Valery-

I should do this in the try of the executeBapi method? When I try to do so, I can't do a "get Anything ()"

It says query can not be resolved, and nothing pops up when I try to "get"

Former Member
0 Kudos

Kathleen,

Does not take my code explicitly -- I didn't see your code, so query is something like:


Bapi_Ptmgrattabas_Mngcreation_Input query = wdContext.current<NameOfInputNode>Element().modelObject();

Former Member
0 Kudos

I get "the method size() is undefined for the type Bapihrabsatt_Out"

Former Member
0 Kudos

Kathleen,

If so, then Bapihrabsatt_Out is not a table. Are you sure you are using correct output parameter? Is it just structure?

VS

Former Member
0 Kudos

In original question you mentioned Att_Abs_Hours as table, so it should be query.getOutput().getAtt_Abs_Hours().size()...

Former Member
0 Kudos

I thought so too, that it should be Att_Abs_Hours, but thats not a choice. The closest thing is the one I used.

Former Member
0 Kudos

Bapi_Ptmgrattabs_Mngcreation_Input query = wdContext.currentBapi_Ptmgrattabs_Mngcreation_Input1Element().modelObject();

if (null == query.getOutput() || query.getOutput().getHrabsatt_Out().getAbs_Att_Hours() == null)

wdComponentAPI.getMessageManager().reportWarning("NULL result");

else

wdComponentAPI.getMessageManager().reportWarning("SIZE: " + query.getOutput().getHrabsatt_Out().getAbs_Att_Hours().size());

Thats what I have at the moment, and now it says size is undefined for type BigDecimal. I added the .getOuput.getAtt_Abs_Hours()

Former Member
0 Kudos

Kathleen,

At last some light!

My (wrong) guess was that you are trying to output table, but this is just sole value!

Try:


if (null == query.getOutput() || query.getOutput().getHrabsatt_Out() == null)
wdComponentAPI.getMessageManager().reportWarning("NULL result");
else
wdComponentAPI.getMessageManager().reportWarning("HOURS:" + query.getOutput().getHrabsatt_Out().getAbs_Att_Hours());

VS

Message was edited by: Valery Silaev

Former Member
0 Kudos

Ohhh ok I see, now we are getting somewhere, sorry for the miscommunication!

This returns the warning Null Result when I run it.

Former Member
0 Kudos

Ok,

Let us narrow possible reason:


if (null == query.getOutput() )
wdComponentAPI.getMessageManager().reportWarning("NULL result, query not executed");
else if (query.getOutput().getHrabsatt_Out() == null)
wdComponentAPI.getMessageManager().reportWarning("NULL result, output structure is null");

What this debug code reports?

VS

Former Member
0 Kudos

You are good at debugging, I have to learn from you!

After running, my result (sadly) is "Null Result, query not executed"

Former Member
0 Kudos

Kathleen,

Let me do my latest guess -- you are "eating" exception.

Your code looks like (not exactly, but kind of):


try {
  ...
  query.execute();
  ...
  node.invalidate();
}
catch (Exception ex {
}

Rewrite it as following (the important part is catch block):


try {
  ...
  query.execute();
  ...
  node.invalidate();
}
catch (Exception ex {
  wdComponentAPI.getMessageManager().reportException(
    new WDNonFatalRuntimeException(ex), false
  );
}

There are should be an error reported. And this error musty explain the reason.

VS

Former Member
0 Kudos

I re-wrote as you suggested, but I still get the same thing I got before: Null Result, Query not executed...and thats it. Aghhh!

Former Member
0 Kudos

Kathleen,

This is simply impossible. To prove other please post complete code of controller method that invokes query.execute().

VS

Former Member
0 Kudos

public void executeBapi_Ptmgrattabs_Mngcreation_Input1( )

{

//@@begin executeBapi_Ptmgrattabs_Mngcreation_Input1()

try

{

// Calls remote function module BAPI_FLIGHT_GETLIST

Bapi_Ptmgrattabs_Mngcreation_Input query = wdContext.currentBapi_Ptmgrattabs_Mngcreation_Input1Element().modelObject();

if (null == query.getOutput() || query.getOutput().getHrabsatt_Out() == null)

{

wdComponentAPI.getMessageManager().reportWarning("NULL result");

}

else

{

wdComponentAPI.getMessageManager().reportWarning("HOURS query.getOutput().getHrabsatt_Out().getAbs_Att_Hours().size()");

}

if (null == query.getOutput() )

{

wdComponentAPI.getMessageManager().reportWarning("NULL result, query not executed");

}

else if (query.getOutput().getHrabsatt_Out() == null)

{

wdComponentAPI.getMessageManager().reportWarning("NULL result, output structure is null");

}

wdContext.currentBapi_Ptmgrattabs_Mngcreation_Input1Element().modelObject().setEmployeenumber("650617");

wdContext.currentBapi_Ptmgrattabs_Mngcreation_Input1Element().modelObject().setAbs_Att_Type("105");

wdContext.currentBapi_Ptmgrattabs_Mngcreation_Input1Element().modelObject().execute();

wdContext.nodeOutput().invalidate();

}

catch (Exception ex)

{

// If an exception is thrown, then the stack trace will be printed

wdComponentAPI.getMessageManager().reportException(new WDNonFatalRuntimeException(ex), false);

ex.printStackTrace();

Object[] errMsg = new String[2];

errMsg[0] = ex.getMessage();

errMsg[1] = "" + wdContext.currentBapi_Ptmgrattabs_Mngcreation_Input1Element().modelObject().getHrabsatt_In().getAbs_Att_Hours();

MessageManager msgMgr = (MessageManager) wdThis.wdGetAPI().getComponent().getMessageManager();

msgMgr.reportMessage(IMessageEnterTime.SAP_ERROR, errMsg, true);

wdComponentAPI.getMessageManager().reportException(new WDNonFatalRuntimeException(ex), false);

}

// Synchronise the data in the context with the data in the model

// wdContext.nodeOutput().invalidate();

//@@end

}

Former Member
0 Kudos

Kathleen,

LOL!

My debug code must be placed after execute() within try block, not before! Sorry for confusing you -- I guessed it was obvious that we checking result.

So re-try first debug code but after execute(), then if you get "NULL output" message try second.

VS

Former Member
0 Kudos

I think I see...here

Message was edited by: Kathleen Reilly

Former Member
0 Kudos

Ok i Get the warning that says:

HOURS query.getOutput().getHrabsatt_Out().getAbs_Att_Hours().size()

Former Member
0 Kudos

Check your debug code:

there is a IWDMessageManagerParameter

"HOURS query.getOutput().getHrabsatt_Out().getAbs_Att_Hours().size()"

it should be expression

"HOURS " + query.getOutput().getHrabsatt_Out().getAbs_Att_Hours()

Check it

Former Member
0 Kudos

this is the line:

else

{

wdComponentAPI.getMessageManager().reportWarning("HOURS" + query.getOutput().getHrabsatt_Out().getAbs_Att_Hours().size());

}

except that now I have the problem again where it says method size() is undefined for type BigDecimal

Former Member
0 Kudos

Read my previous post -- there are no size() invocation.

So it is just

else

{

wdComponentAPI.getMessageManager().reportWarning("HOURS" + query.getOutput().getHrabsatt_Out().getAbs_Att_Hours());

}

Former Member
0 Kudos

Alright, so now I get: Hours 0

even though I entered a non-zero value.

Former Member
0 Kudos

Kathleen,

Did you check ABAP side, say with SE37 transaction. Seems that there is no errors in Java...

VS

Former Member
0 Kudos

When I run it through the front end, it seems to work. At least, it says posting transaction without errors.

Former Member
0 Kudos

Kathleen,

I cannot understand you now.

First you say that some filed in output is zero while you expecting non-zero value.

Test we used shows that BAPI is executed without Java errors. If it uses standard BAPI mechanism for errors, check something like BAPI_RETURN structure in SE37

Does this hours attribute is non-zero when you test your function in SE37?

VS

Former Member
0 Kudos

yes, when i test in se37, it returns non zero value

Former Member
0 Kudos

Kathleen,

Then there are could be 2 reasons:

1. You are using different users with SAP GUI and for Adaptive RFC connection. Sometimes (but rare) this may cause different behavior.

2. The most realistic reason is that input is in fact different between 2 cases:

a) Some parameters has default values. When you running RFM with SAP GUI default values are always supplied, when you are using JCo or Adaptive RFC Model default values are never supplied. Check RFM input parameters and set default values.

b) Something wrong with conversion exits for input parameters. In your code you have:


wdContext.currentBapi_Ptmgrattabs_Mngcreation_Input1Element().modelObject().setEmployeenumber("650617");
wdContext.currentBapi_Ptmgrattabs_Mngcreation_Input1Element().modelObject().setAbs_Att_Type("105"); 

Say, first type requires numeric string of 18 characters, second is numeric string of 10 characters. Normally, when you invoke Adaptive RFC Query conversion exit routine is executed and backend get EmployeeNumber prepended with 12 zeroes and Abs_Att_Type prepended with 7 zeroes. Probably something went wrong with this. Try to check corresponding type in ABAP, and if it is numeric string of fixed length try to pad your values with leading zeroes.

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com