Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Why many zero are returned when a field is empty

Former Member
0 Likes
553

Hi,

I am using sapjco 2.1.8 in my Java code to call a BAPI function (rsz_x_component_get).

When executing this bapi function in SAP GUI, I can see one field is empty, and it's defined as as 70 characters. However, in Java code what I received is "000000000", while I should receive an empty string, "".

Does anyone know why the empty string is transferred into a string containing many zero?

Thanks,

Ray

Hi,

I am using sapjco 2.1.8 in my Java code to call a BAPI function (rsz_x_component_get).

When executing this bapi function in SAP GUI, I can see one field is empty, and it's defined as as 70 characters. However, in Java code what I received is "000000000", while I should receive an empty string, "".

Does anyone know why the empty string is transferred into a string containing many zero?

Thanks,

Ray

3 REPLIES 3
Read only

Former Member
0 Likes
518

Hi Ray,

if the field defined is of type NUMC then its initial value is the no. of zeros equal to the size of the field.

Regards,

Atish

Read only

0 Likes
518

Hi Atish,

Thanks for reply.

The field is defined as CHARACTER and its length is 70. In Java code I use super.getTable().getString(20);

Thanks,

Ray

Read only

0 Likes
518

Problem solved. The cause is that the offsets and lengths of the input/output/table are inconsistent between function definition and java class.