‎2007 Jan 29 4:23 AM
Hi all,
My requirement is that I want to display the total number of items I have in my internal table the moment I enter my selection criteria.... any suggestions plz.
‎2007 Jan 29 4:38 AM
Hi,
You write the code based on the selecion criteria.
After that
TABLES: mara.
DATA: BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE mara.
DATA: END OF itab.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
SELECT * INTO TABLE itab
FROM mara
WHERE matnr IN s_matnr.
IF sy-subrc = 0.
WRITE:/ sy-dbcnt.
ENDIF.Also you can use
DESCRIBE TABLE ITAB LINES n.
Try this, will solve ur problem.
‎2007 Jan 29 4:38 AM
Hi,
You write the code based on the selecion criteria.
After that
TABLES: mara.
DATA: BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE mara.
DATA: END OF itab.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
SELECT * INTO TABLE itab
FROM mara
WHERE matnr IN s_matnr.
IF sy-subrc = 0.
WRITE:/ sy-dbcnt.
ENDIF.Also you can use
DESCRIBE TABLE ITAB LINES n.
Try this, will solve ur problem.
‎2007 Jan 29 5:29 AM
I tried it but using WRITE:/ sy-dbcnt. always gives me fix number I mean to say if I have 3 records I'm getting 20 and if I have 30 I 'm getting 20....
tried to use DESCRIBE TABLE ITAB LINES n. but not getting any display of any number on my screen.
‎2007 Jan 29 5:32 AM
HI,
The stmt. is:
WRITE:/ n. "where n is the total entries in internal table.
Regards
Subramanian
‎2007 Jan 29 5:34 AM
hi,
kindly chk ur itab contains dat or not.
if itab[] is not initial.
DESCRIBE TABLE ITAB LINES n.
write n.
endif.rgds
Anver
‎2007 Jan 29 5:37 AM
‎2007 Jan 29 4:38 AM
use like this , to count the number of lines in IT -
tables mara.
DATA: N TYPE I.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
SELECT * INTO TABLE ITAB
FROM MARA
WHERE matnr in s_matnr.
if sy-subrc = 0.
DESCRIBE TABLE ITAB LINES N.
endif.
Result: N contains the value.
‎2007 Jan 29 4:40 AM
Hi,
Once you have all your data in the internal table,
write a stmt like :
describe table itab lines ws_lines.
ws_lines has the total number of entries in the internal table ITAB.
Regards
Subramanian
‎2007 Jan 29 5:40 AM
i think you want to show it before showing the list.
then you have to code at :
at selection-screen.
here select the data into itab.
now use describe table.
here you can call a popup with the variable.
fm like POPUP_TO_DISPLAY_VALUE.
start-of-selection.
regards
shiba dutta