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

Return Null For ABAP Program

Former Member
0 Likes
1,167

Hi experts,

I have a requirement to return a null value from my BAPI program to a Java system interfacing with SAP. When the null value is received at the Java system end, the value turns up as ' ' (space) instead.

I would like to clarify whether it is possible for the BAPI programs to return null value instead of a space to the interfacing system.

Regards,

Lionel

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
853

Hello Friend,

In SAP whenenver a variable (type C) is not assigned with any value or any object is not instantiated those are holding space by default. So when it is getting transferred to Java system it is converting into space.

So, I can suggest you should try to do something in Java system itself.

Regards

Krishnendu

5 REPLIES 5
Read only

Former Member
0 Likes
853

Hi,

You can convert space into null value by coding. Because different systems will treat null as differently but we need to use them accordingly.

Read only

Former Member
0 Likes
854

Hello Friend,

In SAP whenenver a variable (type C) is not assigned with any value or any object is not instantiated those are holding space by default. So when it is getting transferred to Java system it is converting into space.

So, I can suggest you should try to do something in Java system itself.

Regards

Krishnendu

Read only

Former Member
0 Likes
853

Hi:

It return space in table in the case of successful processing so u can do by coding like

if lt_return is initial.

<variable> = ' '

endif.

Regards

Shashi

Read only

Former Member
0 Likes
853

In the ABAP programming language or on other development platforms you cannot assign the value "null" to all data types in order to mark fields and thus indicate that the remaining fields contain update values. Conditionally , null values can be used , which can be specified within,

Read only

Former Member
0 Likes
853

Hi Experts,

While I am aware of the constraints you have raised, that null value being generally unavailable in SAP and ' ' (space) is used to represent a null, I was wondering by trying to ask around if there was any way in which this can be overcome.

I am also aware that data transformation can be carried out at the Java layer, but I'm trying to explore if it is possible that this logic can be constrained to the SAP layer without changing the Java end.

Thanks for all your replies.

Regards,

Lionel