Packed decimal fields in Call: I can't succeed in calling the SAP function module  "MD_CONVERT_MATERIAL_UNIT" via Call / RFC. The problem is that it requires a packed input. I use the "-pack" option

Set V[AMOUNT] "1000" -pack

but still the Call aborts with an error message "Incorrect field length". Can you please help?

The "-pack" option requires an explicit length for the destination field. You need to specify the exact internal length of the packed field, otherwise the RFC interface doesn't accept it. In your case the function interface refers to the SAP data element BSTMG which is defined as a packed field with up to 13 digits. Internally this means 7 bytes, since each byte contains two digits and one half byte is reserved for the sign. So you need

Set V[amount] ""    // clear field

Set V[amount](1-7)  "1000" -pack // packed decimal 7 bytes

Call "MD_CONVERT_MATERIAL_UNIT" ...  in.I_MENGE= "&V[amount]" ...