cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the fields from RFC model

Former Member
0 Kudos

Hi,

We have a function module called Z_HR_ESS_PA0003 in backend system which is used to grab the field called AccountTo from infotype 3. I tried to fetch this field to do some validation in ESS banking but failed. Could you suggest what I did wrong in the following steps.

1. I created a model to import Z_HR_ESS_PA0003 function module.

2. I added this model in Used Model

3. I did the comtext mapping of Z_HR_ESS_PA0003_Input between custom controllers and used model and between detailedView and custom controlllers

4. Date t = wdContext.nodeZ_Hr_Ess_Pa0003_Input().nodeOutput().currentOutputElement().getE_Abrdt(); to get the E_Abrdt();

But it got null without any values. Could sum1 shed a light on this please? Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I got the following code added

		Z_Hr_Ess_Banking_Pa0003_Input model= new Z_Hr_Ess_Banking_Pa0003_Input();
		wdContext.nodeZ_Hr_Ess_Banking_Pa0003_Input().bind(model);
		
		if(wdContext.nodeZ_Hr_Ess_Banking_Pa0003_Input().nodeOutput().currentOutputElement().getE_Abrdt() != null)
		{
		  Date t = wdContext.nodeZ_Hr_Ess_Banking_Pa0003_Input().nodeOutput().currentOutputElement().getE_Abrdt(); 
		}

and received the error

java.lang.NullPointerException

Sorry I am not good at JAVA.

former_member214651
Active Contributor
0 Kudos

Hi,

Insert the following statement after the bind statement:

Z_Hr_Ess_Banking_Pa0003_Input model= new Z_Hr_Ess_Banking_Pa0003_Input();
wdContext.nodeZ_Hr_Ess_Banking_Pa0003_Input().bind(model);

wdContext().currentZ_Hr_Ess_Banking_Pa0003_Input().modelObject().execute();

if(wdContext.nodeZ_Hr_Ess_Banking_Pa0003_Input().nodeOutput().currentOutputElement().getE_Abrdt() != null)
{
   Date t = wdContext.nodeZ_Hr_Ess_Banking_Pa0003_Input().nodeOutput().currentOutputElement().getE_Abrdt(); 
}

Also find out if the RFC expects any input parameters from the WDJ program. If yes, set the parameters using:

wdContext().currentZ_Hr_Ess_Banking_Pa0003_Input().set<attributeName>();

Regards,

Poojith MV

Former Member
0 Kudos

Yes It works fine now. Thank you very much.

There is one input parameter in this custom RFC. But there is another implementation problem poped up.

For this ess banking application, generally there are two projects involved. One is essaubanksapcom, the other is esspersapcom. We have implemented the code to validate the date period in esspersapcom/CvPersInfoDetailFooter, However we require the input parameter from another project which is essaubanksapcom/VcPerBankAuDetail. How am I supposed to pass this input parameter from one project to another? Is there an easy way to do? Thanks.

To be more specific, it is user id i need as input parameter

Edited by: Bai Li on Jun 15, 2010 9:01 AM

Answers (2)

Answers (2)

former_member214651
Active Contributor
0 Kudos

Hi,

try using this line:

if(wdContext.currentOutputElement().getE_Abrdt() != null)
{
  Date t = wdContext.currentOutputElement().getE_Abrdt(); 
}

This will avoid any errors if the output element is null

Before that, execute the RFC in ECC using transaction SE37 by providing the parameters if required?

Regards,

Poojith MV

Former Member
0 Kudos

hello

1) Open SE37 execute FM check whether you are getting Date value or not. If you are getting there means there is some issue with WDJ Code.

2) Take Instance of the node . Pass required input parameters to FM and execute FM.

Check above points.

Regards

Sridhar S

Former Member
0 Kudos

I ran SM37 and put the function module in either ABAP program name or job name. It didn't bring up any things but said no job matches the selection criteria. I am sure I typed the correct FM.

Edited by: Bai Li on Jun 15, 2010 7:43 AM