Skip to Content
0

Personas 3.0 passing parameters to a table

Apr 05 at 12:00 AM

35

avatar image

Hello I am trying to this BAPI_MATERIAL_SAVEDATA to create a material master record. I used the RFC tool in Personas 3 to generate the code to pass parameters and read the return structure. I am getting a runtime error when i try to pass parameters in the table "MATERIALDESCRIPTION" The full code below

oRFC.setParameter("MATERIALDESCRIPTION", [{"LANGU":"EN","LANGU_ISO":"E","MATL_DESC":"TEST","DEL_FLAG":""}]); oRFC.setParameter("UNITSOFMEASURE", [{"ALT_UNIT":"EA","ALT_UNIT_ISO":"EA","NUMERATOR": 1,"DENOMINATR": 1,"EAN_UPC":"","EAN_CAT":"","LENGTH":0,"WIDTH":0,"HEIGHT":0,"UNIT_DIM":"","UNIT_DIM_ISO":"","VOLUME":0,"VOLUMEUNIT":"","VOLUMEUNIT_ISO":"","GROSS_WT":0,"UNIT_OF_WT":"","UNIT_OF_WT_ISO":"","DEL_FLAG":"","SUB_UOM":"","SUB_UOM_ISO":"","GTIN_VARIANT":"","NESTING_FACTOR":0,"MAXIMUM_STACKING":0,"CAPACITY_USAGE":0,"EWM_CW_UOM_TYPE":""}]); oRFC.setParameter("UNITSOFMEASUREX", [{"ALT_UNIT":"EA","ALT_UNIT_ISO":"EA","NUMERATOR":"X","DENOMINATR":"X","EAN_UPC":"","EAN_CAT":"","LENGTH":"","WIDTH":"","HEIGHT":"","UNIT_DIM":"","UNIT_DIM_ISO":"","VOLUME":"","VOLUMEUNIT":"","VOLUMEUNIT_ISO":"","GROSS_WT":"","UNIT_OF_WT":"","UNIT_OF_WT_ISO":"","SUB_UOM":"","SUB_UOM_ISO":"","GTIN_VARIANT":"","NESTING_FACTOR":"","MAXIMUM_STACKING":"","CAPACITY_USAGE":"","EWM_CW_UOM_TYPE":""}]); oRFC.requestResults(["RETURN"]); oRFC.send(); var _RETURN = oRFC.getResultObject("RETURN");

The Runtime error

Error during script execution:
GuiRFC.getResult(): The RFC call ended with this exception: Function module BAPI_MATERIAL_SAVEDATA execution failed during processing of parameter MATERIALDESCRIPTION
Therefore, cannot return parameter 'RETURN'.

I cannot see what is wrong with the above code can someone help me with this please note I could not paste the entire code due to char limit

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Cristiano Hansen
Apr 06 at 12:19 PM
0

Hi Dwarak,

I would recommend first trying out the FM over SE37.
Can you get the values you need?

Check also this Wiki for the syntax on calling RFCs.

If you still face issues, then let us know.

Regards,
Cris

Share
10 |10000 characters needed characters left characters exceeded
Steve Rumsby
Apr 06 at 02:51 PM
0

It looks like you have the values for fields "LANGU" and "LANGU_ISO" the wrong way around. "LANGU" is a 1 char field, so it should hav the value "E" and "LANGU_ISO" should be "EN". Does that make sense?

The rest looks OK to me.

Share
10 |10000 characters needed characters left characters exceeded