converting entity identifier to integer

converting entity identifier to integer

Hi All,

I have an input widget and the variable i am setting to this input is from a Entity column which is a foreign key as shown below where Zpnr is table and HTL_ITEM_ID is a column with foreign key.I am getting an error as Integet,decimal,text datatype required instead of ITEM_ID identifier where ITEM_ID is a primary key column of main table.How to convert this identifier to integer or how to resolve this type conversion.

Just use the build-in function EntityRefIntegerToInteger()

Like this:

Why do you need to change the identifier directly in the user interface? Is it an internal test screen? Normally, you would want to use a combobox or autocomplete pattern in that scenario, instead of an input widget.
But if you really need it, you can bind the input to a local or session variable (integer or text). Then, before saving the data, just assign (to the record that you are about to save), the end value, using a built-in conversion function:
The function to use depends on the underlying data type for your HTL_ITEM identifier (int/text).