cancel
Showing results for 
Search instead for 
Did you mean: 

Numeric Input field - contains zeroes after initializing

Former Member
0 Kudos

Hello,

I have a input field for R/3 reservation number which is numeric. When the view is first displayed the input field is blank. If If leave this view and return I am clearing the field using the following

<b>wdContext.currentBapi_Reservation_Getdetail_InputElement().setReservation(null);</b>

The field is cleared as expected but is now filled with Zeros. How can I clear this field but avoid having it filled with zeros. Need to have the field empty as it the first time it is displayed.

Regards,

Keith L.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Baskaran,

I tried setting to "" instead of null and get the same results. What is strange is that If I try to set to "ABC" or any other character string it dumps with the following error.

If I try and set to numberic value "123" it is ok but once again it includes leading zeros.

Error stacktrace:

com.sap.aii.proxy.framework.core.DataAccessException: Type conversion error, field RESERVATION, complex type class XYZ.com.gm8.Bapi_Reservation_Getdetail_Input

<b>wdContext.currentBapi_Reservation_Getdetail_InputElement().setReservation("ABC");

wdContext.currentBapi_Reservation_Getdetail_InputElement().setReservation("123");</b>

Any ideas on where the enforcement of numneric is at? From what I see in the data dictionary entries created by Adaptive RFC it is defined as a string

Rgds,

Keith

Former Member
0 Kudos

Keith,

It seems to me that your application is RFC Webservice model.

See the following link and see if you implement it correct.

Former Member
0 Kudos

Hello Baskaran,

I looked at the thread not sure if this addresses the same problem. Can you explain?

Rgds

Keith

Former Member
0 Kudos

On the R/3 side reservation is

NUMC Character string with only digits

On the WD side reservation is defined as string

Former Member
0 Kudos

Hi Keith,

You can do the following then.

See normally when it is coming from RFC system it is initialized to zeroes.So your string is displaying zeroes.

You can check the Reservation attribute value and if it is zeroes then you can set it to spaces.

wdContext.currentBapi_Reservation_Getdetail_InputElement().setReservation("");

Message was edited by: Baskaran Senthivel

Former Member
0 Kudos

Hi,

what is the dataType of Reservation ??.