How to Set SAP RFC Parameters

I’m using the function module ‘ME_INFORECORD_MAINTAIN’. I can successfully use some of the other RFC’s documented in the forums, where it is simple ping to SAP and get back info, so I know the RFC works. The trouble I’m having is when I go to import more than one parameter that isn’t string. For example, the ‘I_EINA’ parameter, like such.

I can successfully go into t-code SE37 and put in the correct info into the parameter and it works.

image

The issue I’m having is how to make SAP accept my parameter from UiPath. I’m setting up I_EINA_TABLE in UiPath and trying to feed it into SAP, however, when the invoke code runs I get the following error:

“PARAMETER I_EINA of FUNCTION ME_INFORECORD_MAINTAIN (SETTER): cannot convert DataTable into STRUCTURE MEWIEINA”

I’ve tried converting to string and other variables but still without luck. This is a screenshot of the invoke code where im trying to set the “I_EINA” parameter with the system.data.datatable variable.

image

How can I get multiple values into the I_EINA parameter using an invoke code? There is not an out of the box SAP BAPI or else I would use the activities.

Any tips @StefanSchnell?

@bradsterling

Hello Brad,
I_EINA is a structure, not a table. If you open it from TAC SE37 via forwarding you can see that.

image

Here a snippet how to handle a structure with NCo and VBdotNET

rfcFunction = destination.Repository.CreateFunction("ME_INFORECORD_MAINTAIN")

I_EINA = rfcFunction.GetStructure("I_EINA")
I_EINA.SetValue("INFO_REC", "4711")
I_EINA.SetValue("MATERIAL", "4712")
I_EINA.SetValue("CREATED_AT", "20201007")

rfcFunction.Invoke(destination)

It is not possible to call the RFM ME_INFORECORD_MAINTAIN via the UiPath BAPI activity, because it is not part of the BOR. The only way to handle this kind of function modules is via Invoke Code activity.

Best regards
Stefan

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.