cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to convert quantity field

Former Member
0 Kudos

Hello,

I am trying to use BAPI_PO_GETDETAIL and call it in an C# code. I am using the RFCTYPE however i am either getting a marshalling error or incompatible type for the quantity and currency fields like MENGE. Please anybody can help.

REgards,

Shekhar KUlakrni

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The .NET Connector maps ABAP type P and all P based user defined types like DEC or MENGE to CLR type Decimal (decimal in C#). Please make sure that those fields are set with valid decimal values with correct precision (width and number of digits after decimal point).

Can you please copy a piece of your code to show how you set values to those fields?

Guangwei

Former Member
0 Kudos

Hello,

I have tried almost all the rfctype that were present however none of them worked.

[RfcField(AbapName = "TARGET_QTY", RfcType = RFCTYPE.RFCTYPE_BCD , Decimals=3, Length = 17, Length2 = 34, Offset = 164, Offset2 = 328)]

[XmlElement("TARGET_QTY")]

public decimal TARGET_QTY

{

get

{

return Convert.ToDecimal(_TARGET_QTY);

}

set

{

TARGETQTY = value;

}

}

private decimal TARGETQTY;

Regards,

Shekhar Kulkarni

Former Member
0 Kudos

It looks like that you are handcrafting the structure without using our proxy generator or are manually modifying the generated code. Please do not do that because the chance that you do it wrong is too good. Can you tell why you need do that?

Guangwei

Answers (0)