Application Development and Automation 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: 
Read only

differentiating the data

Former Member
0 Likes
501

Hi

I had uploaded a flat file. I'm having all the data from my flat file to an internal table. In that flat file i'm having a field MANDT also. Now i want to check mandt field with my system mandt field and if i found the other mandt other than the present system mandt then i have to redirect to some other internal table and then i want to count all the data in that table. How to do that??

Regards

Nanda

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
486

Hi

Suppose you are having all the records in a internal table as lt_flat and you are having data in this internal table then compare like this

if sy-mandt = lt_flat.

and then u can use for all entries in your select statement or u can use read statement then get all your values into your internal table

Regards

Pavan

3 REPLIES 3
Read only

JozsefSzikszai
Active Contributor
0 Likes
486

hi Nanda,

something like:

DATA : gv_lines TYPE i.

LOOP AT itab INTO wa WHERE mandt NE sy-mandt.

APPEND wa TO itab2.

DELETE itab.

ENDLOOP.

DESCRIBE TABLE itab LINES gv_lines.

gv_lines contains the number of lines in your itab now.

hope this helps

ec

Read only

Former Member
0 Likes
487

Hi

Suppose you are having all the records in a internal table as lt_flat and you are having data in this internal table then compare like this

if sy-mandt = lt_flat.

and then u can use for all entries in your select statement or u can use read statement then get all your values into your internal table

Regards

Pavan

Read only

Former Member
0 Likes
486

Hi,

LOOP AT ITAB.

IF ITAB-MANDT NE SY_MANDT.

MOVE : all records to one more internal table ITAB2.

APPEND ITAB2.

If you want to delete that record from ITAB

DELETE ITAB WHERE MANDT EQ ITAB-MANDT.

ENDIF.

ENDLOOP.

To count the data ...

DATA v_line TYPE I.

DESCRIBE TABLE ITAB2 LINES v_lines.

WRITE v_lines.

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Feb 27, 2008 5:31 PM