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

Problem in Data selection

Former Member
0 Likes
910

Hi,

I have the below code

*********

Select VBELN VKORG From LIKP into table IT_LIKP

where VKORG = VKORG

AND ERDAT = ERDAT

AND WADAT_IST NE ' '.

*******

I want to select all deliveries VBELN from LIKP as per criteria in where clause and as i mention WADAT_IST NE ' '. but still it is selecting data where WADAT_IST is blank I also try with using SPACE insted of ' ' not still it is selecting two records.

regards,

zafar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
711

I can see WADAT is a date field. The initial value for date will be 00000000 and not space. Try using NOT INITIAL or NE 00000000.

5 REPLIES 5
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
711

Hi,

Try

WADAT_IST IS NOT INITIAL.

Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
711

It should work if it is not working then delete the data from internal table.

Nabheet

Read only

Former Member
0 Likes
712

I can see WADAT is a date field. The initial value for date will be 00000000 and not space. Try using NOT INITIAL or NE 00000000.

Read only

Former Member
0 Likes
711

hi

No matters let it come like that ,

delete those unwanted spaced rows , from the internal table as.


loop at IT_LIKP into IT_LIKP.
    if it_likp-WADAT_IST =  ' '.
         delete it_likp.
    endif.
endloop.

Read only

Former Member
0 Likes
711

Try gs_date type sy-datum, then pass that gs_datum in select statement, as a date field we have given has 00000000 in it.