cancel
Showing results for 
Search instead for 
Did you mean: 

Please help..Issue on getting parameter from a backend fm

Former Member
0 Kudos

Dear Expert,

I have a requirement which is to edit the ess~cod for the employee communication. I have copy out the function group ZHRXSS_COD_INTERFACE. I created my own function module ZCOD_VALIDATE and attached to the function group. My funtion module are just returning an export parameter and a table without getting any import parameter.

I have create a ZCodModel (pointing to the ECC function group) and the model class is ZCod_Validate_Output. I have done all the reimporting of the model and context binding. My question is why i still not getting any value from the function module. I tested the fm in ecc and it works well.

I have added the following code in do init.

*************************************

ZCod_Validate_Input Input = new ZCod_Validate_Input();

wdContext.nodeZCod_Validate_Input().bind(Input);

try {

wdContext.currentZCod_Validate_InputElement().modelObject().execute();

wdContext.nodeCod_Validate_Output().invalidate();

} catch (Exception ex) {

fpm.getMessageManager().raiseException(wdThis.wdGetAPI ().getComponent(), ex);

}

************************

Anyone can tell me why i am not getting the parameter? Please help me.

Thanks.

Regards,

Bryan

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Dear all...found out the solution. Need to refresh the project and repair it

former_member197348
Active Contributor
0 Kudos

Hi Bryan,

The code seems to be alright for me.

Try these two options, if you have not done already:

1.Try to print resutls after execution

wdComponentAPI.getMessageManager().reportSuccess(size of the table or value of the parameter);

2.Try to debug if the RFC is called using external debugging in ABAP

If the RFC is callled and showing values null or 0

Just check once more your binding.

Regards,

Siva

Former Member
0 Kudos

Hi Siva,

Thanks for your reply.

I got this error when i execute it? Anyway my function module does also return a table but i have yet to define a context to store it. I am just trying to get the value of the export parameter. If it success, then i can proceed to bind the table. However now, it seem getting an export parameter also giving me problems.

********************************************************************************************************************

java.lang.ArrayIndexOutOfBoundsException: -1

at com.sap.mw.jco.JCO$Record.getString(JCO.java:12798)

at com.sap.aii.proxy.framework.core.JcoBaseTypeData.getElementValueAsString(JcoBaseTypeData.java:669)

at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClass.getAttributeValueAsString(DynamicRFCModelClass.java:427)

at com.sap.xss.hr.cod.model1.Zhrxss_Cod_Validate_Output.getNameofposition(Zhrxss_Cod_Validate_Output.java:164)

at com.sap.xss.hr.cod.wdp.IPublicFcCodBusinessLogicComp$IZhrxss_Cod_Validate_OutputElement.wdGetObject(IPublicFcCodBusinessLogicComp.java:6601)

********************************************************************************************************************

Thanks.

Regards,

Bryan

Former Member
0 Kudos

HI

provide the code at where you are getting the error .

Error may be due to the number of values its exceeding the range.

Former Member
0 Kudos

Hi Murali,

I am getting the error when i start the application and clikc on the change button. So which part of code do you need from me. Did u means that actually i manage to get the value from the model aready?

Thanks.

Regards,

Bryan

former_member197348
Active Contributor
0 Kudos

Hi Bryan,

Generally we get this java.lang.ArrayIndexOutOfBoundsException: -1

exception, when we don't have records in the node(table) and we are trying to access the records.

So, this means you are not getting values after executing the RFC.

Try with external debugging. Put a breakpoint in RFC and try executing the WD application. You can check where exactly you are missing

Regards,

Siva

Former Member
0 Kudos

Hi Siva,

My basis is having problem to turn the debugging option on for the j2ee engine. Do you mean i put a debug poing in the following line?

"wdContext.currentZCod_Validate_InputElement().modelObject().execute();"

If this is a stadard rfc call? How will it have things missing?

Thanks.

Regards,

Bryan