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: 

internal table duplicates

Former Member
0 Kudos

hi all,

I have problem with internal table.there is field profit center in internal table.

iam also getting blanks for profit center. i want to keep interies in internal table,

if there is a value in profit center and if it is blank it should be deleted from internal table.

plz suggest any solution .

thank you.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

cldnt understand exactly wht u r asking ?

how do u want to maintain the entires in the internal table ?

if u dont want blan entries at all..

delete <internal_table> where profitcenter = space

n if u dont want duplicate values for profit center also not even blank den

sort internal table by profit center

delete adjacent dupliactes from internaltable comparing profitcenter

delete <internal_table> where profitcenter = space

Edited by: Ashwinee Mali on Jan 27, 2009 11:29 AM

8 REPLIES 8

Former Member
0 Kudos

cldnt understand exactly wht u r asking ?

how do u want to maintain the entires in the internal table ?

if u dont want blan entries at all..

delete <internal_table> where profitcenter = space

n if u dont want duplicate values for profit center also not even blank den

sort internal table by profit center

delete adjacent dupliactes from internaltable comparing profitcenter

delete <internal_table> where profitcenter = space

Edited by: Ashwinee Mali on Jan 27, 2009 11:29 AM

0 Kudos

hi,

Internal table has a field called profitcenter.

some records in internal table have values for profitcenter.

and some records doesnot have values.

now i want to delete all the records from internal table where profit center is blank.

thank you

0 Kudos

Hi,

use this statement...

DELETE itab WHERE profitcenter EQ spcae.

Former Member
0 Kudos

After selecting data into internal table write

Delete itab where profitcenter is initial.

Hope this helps...

Edited by: Karan Sethi on Jan 27, 2009 11:38 AM

Former Member
0 Kudos

hi,

set flag if there is no entries in that column.

then delete internal table transporting flag.

Try,

DELETE itab WHERE fname IS INITIAL.

or

DELETE itab WHERE col IS INITIAL.

or try this.

sort it_tab field1 . ..

Delete itab where itab-field = space.

Former Member
0 Kudos

Hi

Check out the syntax for different types of Delete at: [Delete from itab|http://help.sap.com/saphelp_nw70/helpdata/en/06/aafd54fc4011d195280000e8353423/content.htm]

Delete itab where profit_center IS INITIAL. will work

Hope this helps

Regards,

Jayanthi.K

Former Member
0 Kudos

Hi,

Try this solution:

DELETE <internal table name> WHERE <field name (Profit Center)> IS INITIAL.

I hope it will help you.

Thanks and regards,

Suresh

Former Member
0 Kudos

Hi,

You can delete from itab as below.

Delete I_Tab where FieldName Is Initial.

or

Delete I_Tab where FieldName Eq ' '.

Other wise you can move all values of the field to one more internal table and you can clear first Itab clear.

Regards

Md.MahaboobKhan