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.

Tags:
replied

Hi,

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.

eg:-

when

lv_date type dats,

lv_time type tims.

LV_date----->'00000000'

lv_time----->'000000'.

Dont worry it works.

Regards

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