08-07-2008 8:26 AM
Hello together,
i use the following Code:
......
data: no_lines type n.
describe table dp24_tmc70_comp lines no_lines.
if no_lines > 0.
......
This statement has problem if the line-number of my table is 1160.
Then no_lines gets a value of 0.
This is very strange to me and I have no explanation why this statement normally works
and only gets problem with this linenumber.
Has anybody an idea to solve the problem?
Kind regards
Udo
08-07-2008 9:48 AM
Hello,
the Code of the internal table is:
TYPES: BEGIN OF ws_dp24_tmc70,
cyrmont(6),
bukrs TYPE bukrs,
ww001(2),
ru(3),
BY5T62-SAP-057951 begin
ww002(4),
BY5T62-SAP-057951 end
ww007(2),
ww008(2),
werks(4), "=> SHIPP
prcomp(4),
artnr(18),
artnrloc(8),
KUNWE(10),
KUNRG(10),
KUNRE(10),
REC_WAERS(3),
VV001_ME(3), "=> unit of measurement for VV001
VBUND(6),
Besonderheit fuer BSE-Ges.,dass VV001 sales quantity in KG
VV001 like CE12000-VV001, "=> P55009110/P55009115
VV002 like CE12000-VV002, "=> P30020110/P30020150
VV004_5_6_7 like CE12000-VV004, "=> P31123050
VV009 like CE12000-VV009, "=> P33120010/P33121050
VV010 like CE12000-VV010, "=> P33130250
VV011_12_13 like CE12000-VV011, "=> P33140050
VV014 like CE12000-VV014, "=> P33150010/P33150050
VV015_75 like CE12000-VV015, "=> P32211600/P32211350
VV016 like CE12000-VV016, "=> P32212600/P32212250
VV019 like CE12000-VV019, "=> P32221010/P32221050
END OF ws_dp24_tmc70.
DATA: dp24_tmc70_comp TYPE TABLE OF ws_dp24_tmc70.
Kind regards
Udo
08-07-2008 8:27 AM
08-07-2008 8:27 AM
data: no_lines type i. " TYpe I
describe table dp24_tmc70_comp lines no_lines.
if no_lines > 0.
08-07-2008 8:27 AM
08-07-2008 8:29 AM
hiii
change variable type as i because for condition type i will use
date: no_lines TYPE i. " Number Of Total Records Read
DESCRIBE TABLE i_output LINES no_lines .
regards
twinkal
08-07-2008 8:29 AM
08-07-2008 8:33 AM
Hi,
I used data-type i (integer) before and had the same problem.
regards
Udo
08-07-2008 8:36 AM
hiii
then there will be problem with your internal table...it is strange error..if possible paste your code with internal table..
regards
twinkal
08-07-2008 8:34 AM
hi
declare
data : no_ines type i.
if no_lines is not initial.
>>>>>>
>>>>>>
endif.
Regards ,
sabari
08-07-2008 9:48 AM
Hello,
the Code of the internal table is:
TYPES: BEGIN OF ws_dp24_tmc70,
cyrmont(6),
bukrs TYPE bukrs,
ww001(2),
ru(3),
BY5T62-SAP-057951 begin
ww002(4),
BY5T62-SAP-057951 end
ww007(2),
ww008(2),
werks(4), "=> SHIPP
prcomp(4),
artnr(18),
artnrloc(8),
KUNWE(10),
KUNRG(10),
KUNRE(10),
REC_WAERS(3),
VV001_ME(3), "=> unit of measurement for VV001
VBUND(6),
Besonderheit fuer BSE-Ges.,dass VV001 sales quantity in KG
VV001 like CE12000-VV001, "=> P55009110/P55009115
VV002 like CE12000-VV002, "=> P30020110/P30020150
VV004_5_6_7 like CE12000-VV004, "=> P31123050
VV009 like CE12000-VV009, "=> P33120010/P33121050
VV010 like CE12000-VV010, "=> P33130250
VV011_12_13 like CE12000-VV011, "=> P33140050
VV014 like CE12000-VV014, "=> P33150010/P33150050
VV015_75 like CE12000-VV015, "=> P32211600/P32211350
VV016 like CE12000-VV016, "=> P32212600/P32212250
VV019 like CE12000-VV019, "=> P32221010/P32221050
END OF ws_dp24_tmc70.
DATA: dp24_tmc70_comp TYPE TABLE OF ws_dp24_tmc70.
Kind regards
Udo
08-07-2008 9:54 AM
Try to use the following syntax and see what is the result:
data: no_lines type n.
no_lines = lines( dp24_tmc70_comp ).
if no_lines > 0.
08-07-2008 10:06 AM
Hi,
If u are check the number of lines condition immediately then there is no need to have one variable. We can make use of system variables.
When DESCRIBE TABLE statement is executed system variable sy-tfill is filled with number of lines in internla tbale.
DESCRIBE TABLE i_mara.
IF sy-tfill GT 0.
Do ur work.
ENDIF.
If u r checking for existance of at least one record then even describe table is also not required. u can check like this.
IF NOT i_mara[] IS INITIAL.
If u r using this number of lines some where else then ideally TYPE i should work as suggested by others.
Hope it is clear.
Thanks,
Vinod.
Thanks,
Vinod.