Skip to Content
Former Member
Jan 12, 2009 at 03:27 PM

Strange RFC model field behavior


Hi all

I'm working with an RFC that have a table structure Foo_Item that contains the field Postion. This field has ABAP component type BUZEI and data type NUMC.

This is represented in Java as a String. My problem is that it displays as "000" when the value of the field is null. I would like it to display "" (the empty string).

Consider this code (in the component controller):

Foo_Item oldItem = <some instance of Foo_Item>
if (Foo_Item != null) {
    Foo_Item newItem = new Foo_Item();
    // Here, newItem.getPostion() -> null
    WDCopyService.copyCorresponding(oldItem, newItem);
    // Now, newItem.getPostion() -> "000"
    // Mindblowingly, newItem.getPostion() -> "000" still!

Now, something strange is going on behind the scenes here. Can anyone point me in the right direction?