Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

select statement question...

Hello experts,

I need to get records from table anlc that is not deactivated so I joined it with table anla because that is where the field deakt is located. I need to get records where its deakt is initial but how can I declare it to my select statement since the word INITIAL cannot be included in a select statement. So here's what I did:

So, is the word NULL the same as initial?

SELECT SINGLE abukrs aanln1 agjahr aafabe a~knafa

akansw aanswl akaafa anafal

aaafav aaafag

nafap aafap nafav nafag

FROM anlc as a

inner join anla as b

on aanln1 = banln1

INTO (it_anlc-bukrs, it_anlc-anln1, it_anlc-gjahr,

it_anlc-afabe, it_anlc-knafa, it_anlc-kansw,

it_anlc-answl, it_anlc-kaafa, it_anlc-nafal,

it_anlc-aafav, it_anlc-aafag, it_anlc-nafap,

it_anlc-aafap, it_anlc-nafav, it_anlc-nafag)

WHERE a~anln1 EQ it_finaltab-asset

AND a~bukrs IN r_iwerk

AND a~gjahr EQ gv_year

AND a~afabe EQ '01'

and b~deakt is null.

Former Member
Former Member replied


Use b~deakt EQ lv_deakt.

data type of lv_deakt should besame has b~deakt.

whenever u declare the variable of any type.

ABAP automatically gives its initial value to the field.



lv_date type dats,

lv_time type tims.



Dont worry it works.


0 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question