Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with "Describe Table .... Lines ..."

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

11 REPLIES 11

Former Member
0 Kudos

use data type i.


data: no_lines type i.

former_member223537
Active Contributor
0 Kudos
data: no_lines type i. " TYpe I

describe table dp24_tmc70_comp lines no_lines.

if no_lines > 0.

Former Member
0 Kudos

Define no_lines as type i.

Regards,

Aparna Gaikwad

Former Member
0 Kudos

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

Former Member
0 Kudos

just declare

data: no_lines type I.

rgds

rajesh

Former Member
0 Kudos

Hi,

I used data-type i (integer) before and had the same problem.

regards

Udo

0 Kudos

hiii

then there will be problem with your internal table...it is strange error..if possible paste your code with internal table..

regards

twinkal

Former Member
0 Kudos

hi

declare

data : no_ines type i.

if no_lines is not initial.

>>>>>>

>>>>>>

endif.

Regards ,

sabari

Former Member
0 Kudos

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

0 Kudos

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.

0 Kudos

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.