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

SQL ( IS NULL )

Former Member
0 Likes
828

How Do Everyone.

I have in my ABAP code:

SELECT ....

FROM payr

WHERE .....

AND voidd IS NULL

AND bancd IS NULL

AND .....

Does anybody know how can I replicate the 'IS NULL' part in the select

options when I run the program?

Cheers

Andy

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
762

SELECT ....

FROM payr

WHERE .....

AND voidd IS INITIAL

AND bancd IS INITIAL

AND .....

OR YOU CAN USE

VOIDD = ''.

OR SPACE.

REGARDS

SHIBA DUTTA

7 REPLIES 7
Read only

Former Member
0 Likes
762

Hi,

Use voidd = space and bancd = space.

Regards

Subramanian

Read only

Former Member
0 Likes
762

try this

AND voidd eq '  '
AND bancd eq '  '
AND .....
or 
AND voidd is initial
AND bancd is initial
AND .....

regards,

vijay

Read only

Former Member
0 Likes
763

SELECT ....

FROM payr

WHERE .....

AND voidd IS INITIAL

AND bancd IS INITIAL

AND .....

OR YOU CAN USE

VOIDD = ''.

OR SPACE.

REGARDS

SHIBA DUTTA

Read only

Former Member
0 Likes
762

Hi Andy ,

Is your requirement to change the where clause of the select statement at run time and in palce of IS NULL use some other value.

Regards

Arun

Read only

Former Member
0 Likes
762

Please check if this what you are looking for:

tables: vbak.

select-options: s_vbeln for vbak-vbeln.

initialization.
  s_vbeln-sign = 'I'.
  s_vbeln-option = 'EQ'.
  s_vbeln-low = space.
  append s_vbeln.

Regards

Eswar

Read only

0 Likes
762

Many thanks for all your replies.

I think the answer may be :

AND ( voidd = ' ' OR voidd IS NULL )

AND ( bancd = ' ' OR bancd IS NULL )

Read only

0 Likes
762

I THINK THIS WILL SERVE UR PURPOSE - JUST COPY N PASTE THIS CODE AND TRY IT OUT.

tables payr.

data begin of itab occurs 0.

include structure payr.

data end of itab.

ranges r1 for payr-bancd.

RANGES R2 FOR PAYR-VOIDD.

r1-sign = 'I'.

r1-option = 'EQ'.

APPEND R1.

r2-sign = 'I'.

r2-option = 'EQ'.

APPEND R2.

select * from payr into table itab where bancd IN R1 AND VOIDD IN R2.

if sy-subrc = 0.

loop at itab.

write:/ itab-zbukr.

endloop.

endif.