11-03-2008 8:50 AM
Hi.
please tell me what is the significance of " if not itab is initial."
and where it is to be placed in any code and please explain with example.
11-03-2008 8:51 AM
Hi,
It is used for all entries selection.....it checks whether there is any values is there any value or not.
if it_equz is not initial.
SELECT iloan
tplnr
msgrp
INTO CORRESPONDING FIELDS OF TABLE it_iloa
FROM iloa
FOR ALL ENTRIES IN it_equz
WHERE iloan = it_equz-iloan.
endif.
Regards
Debarshi
11-03-2008 8:52 AM
it checks whether itab is filled, where itab probably an internal table is.
regards,
Hans
11-03-2008 8:52 AM
if not itab is initial...
this is a very silly question.... try using debugger......
answer it yourself....
11-03-2008 8:52 AM
Hello,
I think u r new to ABAP
The statement
IF itab[] is not inital statement is used to check the values existing in the itab[] i.e. internal table or not.
if the itab[] contains the values then it will result is true.
IF itab[] is not inital.
resule: True.
else.
result: False.
endif.
11-03-2008 8:54 AM
Hi....
It is that if your internal table does not contain any values ... then do the proceed with the actions or else if internal table has the value the condition wont do anything.....
Regards
Raja
11-03-2008 8:55 AM
Hi Tanisha,
" if not itab is initial."
is used to check wheather the contnent of an internal table named itab is empty or not. Generaly, we use it after an operation to fill the itab and before working with the internal table.
In case of SELECT statement if we use FOR ALL ENTRIES, this checking is a must. Otherwise, if the internal table is entry the all the data of the data table/s in the SELECT query will be fetched.
Regards,
Anirban
11-03-2008 8:56 AM
It mean "if itab does not contains any row" for examppl
if not it_mara[] is initial.
endif.
regards
rajesh
11-03-2008 8:58 AM
hi
For example
tables kna1.
types : begin of ty_itab ,
kunnr type kna1-kunnr,
name1 type kna1-name1,
ort01 type kna1-ort01,
land1 type kna1-land1,
end of ty_itab.
data : it_itab type table of ty_itab,
wa_itab type ty_itab.
select-options : S_kunnr for kna1-kunnr.
select kunnr
name1
ort01
land1 from kna1 into table it_itab where kunnr in s_kunnr.
" to check whether it_itab has records
if IT_itab is not initial.
loop at it_itab into wA_itab.
write statemetns
'
'
'
'
endloop
else.
message ' no records exists for the particular selection criteria' type 'S'.
endif
Thanks & Regards
11-03-2008 9:00 AM
If not Itab is initial.......
It indiactes go to further process if the Internal table contains records.
it will reduce the process time and increases the performance of the program.
Thanks and Regards
Ganesh Reddy
11-03-2008 9:00 AM
Checking "If not Itab is initial' gains most importance if subsequently you are using the same table in 'For all entries'.
Else all records are fetched !! Hope it helps.
11-03-2008 9:04 AM
Hi,
'if not itab is initial' checks weather the itab filled with data or not.
For Example.
if not itab is initial.
Message 'Itab contains data' type 'S'.
else.
Message 'No data found' type 'E'.
endif.
Regards
11-03-2008 9:05 AM
Hi,
'if not itab is initial' checks weather the itab filled with data or not.
For Example.
if not itab is initial.
Message 'Itab contains data' type 'S'.
else.
Message 'No data found' type 'E'.
endif.
Regards