‎2007 Jun 07 10:47 AM
Hi Experts ,
Im having one doubt in Internal tables .
i.e. 1. what is the diff between inital & not initial ..
2. wat are all the advantages ?
3. need an example ?
Regards ,
Narayana Murthy
‎2007 Jun 07 10:49 AM
Hi,
initial means no records in the internal table
not initial
means atleast one record is there
use...
if not initial
then display the records
else.
give a message ' no data found'.
endif.
reward points if helpful
regards
venkatesh
‎2007 Jun 07 10:49 AM
Hi,
initial means no records in the internal table
not initial
means atleast one record is there
use...
if not initial
then display the records
else.
give a message ' no data found'.
endif.
reward points if helpful
regards
venkatesh
‎2007 Jun 07 10:49 AM
Initial means the table doesnt have any recrods, if not initial the table have some records.
‎2007 Jun 07 10:52 AM
Internal table is initial when there are not entries in the table.
IF NOT i_tab[] IS INITIAL.
SELECT a b c
FROM X
FOR ALL ENTRIES IN i_tab.
ENDIF.
In this example you check internal table. You only do the select if exists any entry.
‎2007 Jun 07 10:53 AM
Hi,
I am selecting entreis from table
for ex:
SELECT EMPNO EMPNAME from ZEMP into table t_EMP
Where DEPT = ''SAP'.
In this casethe selected entries will be there in T_EMP.
If t_EMP[] is initial.
Write 'No entreids found'.
endif.
if not t_emp[] is initial.
Select * from DEPT into table t_dept
for all entreis in t_emp
where empno = t_empno..
endif.
In this case if no entreis in t_emp uit will not process this select statement.
To avoid performance issues and dump we have to check this.
‎2007 Jun 07 10:57 AM
Hi,
Initial value is the value any variable takes based on the type.
If u declare a char variable of type c the initial value is ' ' (space)
So if u check if the variable is initial u can check if the value of the variable is space. Thus u ll know if it has been changed after it has been declared.
Similarly var NOT INITIAL will check if the variable has been assigned any value after it has been declared or not.
For example see help.sap link below:
http://help.sap.com/saphelp_webas620/helpdata/en/fc/eb353d358411d1829f0000e829fbfe/frameset.htm
Regards,
Aparna