cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Table to an RFC

Former Member
0 Kudos

Hi all,

I am facing a pretty odd problem.

I have to pass a table as input to an rfc.

I have done all the steps mentioned in the following thread...

Link [;

But still the RFC is returning an error that the table is initlal.

Please help.

Regards,

Sattam

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sattam,

Try this code


                                                               	Zcab_Submit_Notif_Values_Init_Input   objZcab_Submit_Notif_Values_Init_Input =
				new Zcab_Submit_Notif_Values_Init_Input();

				for (int count = 0;
				vectLongText != null && count < vectLongText.size();
				count++) {
				objZcab_Submit_Notif_Values_Init_Input.addZcab_Longtexts(
					(Zcab_Longtexts) (vectLongText.get(count)));
			}

			

			

			wdContext.nodeZcab_Submit_Notif_Values_Init_Input().bind(
				objZcab_Submit_Notif_Values_Init_Input);

			objZcab_Submit_Notif_Values_Init_Input.execute();

			wdContext.nodeOutputSubmit_Notif_Values_Init().invalidate(); 

In this code vectLongtext is the node which contains all the attributes of the table in the view and Zcab_Longtexts is the table within the rfc Zcab_Submit_Notif_Values_Init.

I hope this code will give you some idea.

Regards,

Vivek

former_member185879
Active Contributor
0 Kudos

Hello Sattam,

Is the RFC working fine in R/3?

is the mapping between the model nodes are correct?

Check the above and let us confirm.

Regards

Nizamudeen SM

Former Member
0 Kudos

Hi Nizamudeen SM ,

Thanks for such quick response.

Yes i have checked the rfc in r/3 and its working fine there.

And i have also checked mapping between the model nodes, they seem to be fine.

Regards,

Sattam

former_member185879
Active Contributor
0 Kudos

Hello Sattam,

Can you debug the RFC by placing external breakpoint? In debugging mode check the size of the table parameter? and check whether all the values are getting passed to RFC?

if the value is not passed, then in webdynpro, like after setting the value to the table node, print the size of the table node or keep breakpoint and check the same in webdynpro.

Regards

Nizamudeen SM

Former Member
0 Kudos

Hi,

Please ensure the table used as input is not empty by checking the size of the node.

Kind regards

Saravanan K

Former Member
0 Kudos

Hi all,

Thanks for ur responses.

Debugging was not working , so we put error messages and it showed that the table being passed is empty.

But I am printing the structure that is being used to populate the table, and THAT is NOT empty.

M totally at a loss

Regards,

Sattam

former_member185879
Active Contributor
0 Kudos

Hello Sattam,

Can you post your code?

Regards

Nizamudeen SM

Former Member
0 Kudos

Hi,

M pasting my code

[code}

Z_Rfc_Submit_Exemption_Input submitExemptionInput = new Z_Rfc_Submit_Exemption_Input();

for( int i = 0 ; i < wdContext.nodeSelectedLines().size(); i++)

{

IPublicExemption.IClaim_Tab_OElement tabElement = wdContext.nodeClaim_Tab_O().getClaim_Tab_OElementAt(i);

Zts_Reimbursement submitLineItems = new Zts_Reimbursement();

submitLineItems.setApamt(tabElement.getApamt());

submitLineItems.setApdat(tabElement.getApdat());

submitLineItems.setClaim(tabElement.getClaim());

submitLineItems.setClamt(tabElement.getClamt());

submitLineItems.setCtype(tabElement.getCtype());

submitLineItems.setDiamt(tabElement.getDiamt());

submitLineItems.setExnum(tabElement.getExnum());

submitLineItems.setExstatu(tabElement.getExstatu());

submitLineItems.setMandt(tabElement.getMandt());

submitLineItems.setLta(tabElement.getLta());

submitLineItems.setPernr(tabElement.getPernr());

submitLineItems.setStatu(tabElement.getStatu());

submitLineItems.setSudat(tabElement.getSudat());

submitExemptionInput.addXdetails(submitLineItems);

}

submitExemptionInput.setClaimamt(wdContext.currentContextElement().getClApDiAmnt());

submitExemptionInput.setExempamt(wdContext.currentContextElement().getExAmnt());

submitExemptionInput.setJbegda(wdContext.currentContextElement().getJourneyStartDate());

submitExemptionInput.setJendda(wdContext.currentContextElement().getJourneyEndDate());

wdContext.nodeZemami_Rfc_Submit_Exemption_Input().bind(submitExemptionInput);

try

{

wdContext.currentZemami_Rfc_Submit_Exemption_InputElement().modelObject().execute();

}

[code}

Former Member
0 Kudos

Hi,

What is the value you are getting for this?

wdContext.nodeSelectedLines().size()

Also are you getting any exception upon executing the function module?

Regards

Saravanan K

Former Member
0 Kudos

Hi Saravanan K,

The RFC is working fine when I execute it from RFC.

I have printed a few fileds from submitLineItems and they are populated correctly.

this is a pretty tricky situation, and i dont know what to do !!

Regards,

Sattam

Former Member
0 Kudos

Any Exceptions you are getting?

Regards

Saravanan K

Former Member
0 Kudos

yes, the RFc returns that the table isa empty

Regards,

Sattam

former_member185879
Active Contributor
0 Kudos

Hello Satam,

After setting the values to the table, try

1. print the size of the table.

2. Place Try & Catch for the whole method, not only where you are executing teh RFC.

May be somewhere it is throwing null Pointer eXception.

Regards

Nizamudeen SM

Former Member
0 Kudos

hi Nizamudeen SM,

Its calling the rfc and the error is returned from there that the table is empty.

pls help !

regards

Sattam

former_member185879
Active Contributor
0 Kudos

Hello Satam,

I came to know that it is the error from RFC from your previous post. Have you tried the things suggested by me? Also Please go through my post regarding debugging(RFC & WDJ) and tell us what is happening.

Regards

Nizamudeen SM

Former Member
0 Kudos

Hi all,

Thanks for ur help...but the problem could not be solved

As we were running out of time we decided to change the logic of the RFC and are sending the table rows' identifier concatenated in a string !

Regards,

Sattam