cancel
Showing results for 
Search instead for 
Did you mean: 

Update Routine( Very Urgent)

Former Member
0 Kudos

Hi,

I have issue with select statement to pull the records from two tables. Here I have two tables one is with Billing Document Items and Service Order Operations.

I have service order as unique field in both tables, When I execute select statement with one service order I got 10 records like

S Ord Oper Billing Document Items

-


-


Oper Repair Code Item Oper Repair Code

10 AD01 1 10 AD01

20 AD01 2 20 AD01

30 OT01 3 10 AD01

40 RE01 4 20 AD01

50 RP01 5 20 AD01

6 20 AD01

7 30 OT01

8 40 RE01

9 50 RP01

10 50 RP01

This are the records with same Service order number, and my select statement giving data like

O/P

Service Order = 60001212

OPER ITEM REPAIR TYPE

10 1 AD01

20 1 AD01

10 2 AD01

20 2 AD01

10 3 AD01

20 3 AD01

10 4 AD01

20 4 AD01

10 5 AD01

20 5 AD01

10 6 AD01

20 6 AD01

30 7 OT01

40 8 RE01

50 9 RP01

50 10 RP01

But I need output like this

Item Oper Rep Code

1 10 AD01

2 20 AD01

3 10 AD01

4 20 AD01

5 20 AD01

6 20 AD01

7 30 AD01

8 40 RE01

9 50 RP01

10 50 RP01

Please give me the select statement which gives the above output. I need very urgent please....

Thanks

Robbie

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Robert,

You can correct this by adding the DISTINCT statement in your SQL join query. e.g.

SELECT distinct item oper repcode from .......

Another way to do it is to use a DELETE ADJACENT duplicates statement so that your ABAP internal table will contain distinct entries.

e.g. sort t_table by item oper repcode.

delete adjacent duplicates from t_table.

Hope this helps.

Former Member
0 Kudos

Hi Kumar, Emanuel,

Thanks for your quick reply, I followed the Emanuel and it worked.

Regds

Robbie.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Please provide the select statement so that it would help in suggesting you.

Thanks,

Kumar