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

Delete adjacent duplicates

Former Member
0 Likes
1,241

Hi All

My requirement is as follows :

i have a report where LABST (unrestricted stock) displays stock of all storage locations for all sales order nos..

but report has to restrict to INRE storage location(LGORT); stock should not show the values containing INRE storage locations.

Now., I have got almost done., stock  is not showing INRE values (storage location)., but it is also deleting SALES ORDER no..it is just displaying the sals order no which is having stock., sales order no which do not have Storge location with INRE is not being displayed..

eg:

1)        material no                                    Unrestricted stock                         Sales order doc no

               0000-003-3001-00                          3115                                                  009234345

               0000-003-3001-00                           3115                                                 009234359



2)        material no                                    Unrestricted stock                         Sales order doc no

               0000-003-3001-00                          3115                                                  009234359

Eg2 is right., but the other line has to be displayed with unrestricted stock Zero for that particular sales order no..

(Have used delete adjacent duplicates from it_final comparing matnr werks labst)


Could anyone help on this..?please

?


Thanks and Regards

Shashi

Hi All

My requirement is as follows :

i have a report where LABST (unrestricted stock) displays stock of all storage locations for all sales order nos..

but report has to restrict to INRE storage location(LGORT); stock should not show the values containing INRE storage locations.

Now., I have got almost done., stock  is not showing INRE values (storage location)., but it is also deleting SALES ORDER no..it is just displaying the sals order no which is having stock., sales order no which do not have Storge location with INRE is not being displayed..

eg:

1)        material no                                    Unrestricted stock                         Sales order doc no

               0000-003-3001-00                          3115                                                  009234345

               0000-003-3001-00                           3115                                                 009234359



2)        material no                                    Unrestricted stock                         Sales order doc no

               0000-003-3001-00                          3115                                                  009234359

Eg2 is right., but the other line has to be displayed with unrestricted stock Zero for that particular sales order no..

(Have used delete adjacent duplicates from it_final comparing matnr werks labst)


Could anyone help on this..?please

?


Thanks and Regards

Shashi

8 REPLIES 8
Read only

Chintu6august
Contributor
0 Likes
1,195

hi,

make use of field symbols.

loop your final internal table and set LABST = 0 if LGORT = 'INRE'.

and  delete adjacent duplicates from it_final comparing matnr werks labst, this will delete all the entries which have same matnr werks labst except one that's why your entries got deleted.

thanks!!

Read only

0 Likes
1,195

Hi Adi

Many Thanks for the reply.,

I used loop at final itab., and set labst  = 0 and  lgort = 'INRE'.

But still it id displaying only one line., the other line is still not being displayed.

Thanks & regards

Shashi

Read only

0 Likes
1,195

either write properly OR remove your delete adjacent duplicate statement..

Read only

0 Likes
1,195

i did remove adjacent duplicates syntax., but stil it was not working.,

I had to use control break statements within loop and modify..It worked..

Thank you.

Read only

davis_raja
Active Participant
0 Likes
1,195

Instead of using DELETE ADJACENT DUPLICATES,

you can LOOP the internal table

add a IF statement which matches your condition

and DELETE the row which doesnt matched your condition

Read only

0 Likes
1,195

I think we do not use DELETE statement inside the loop..

instead of that make use of FLAG field.. using loop mark 'X' to the records which you want to delete.

then after LOOP , DELETE <ITAB> where Flag = 'X'.


Read only

0 Likes
1,195

Using INDEX addition for the DELETE statement won't affect the performance much.

Read only

0 Likes
1,195

thank you.. Issue got resolved...