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: 

custom report is not pulling the sales order/delivery no for multiple line items correctly

mr22
Advisor
Advisor
0 Kudos

Hi,

I have an issue in which a custom report is not pulling the sales order/delivery no for multiple line items correctly.

For a particular custom deeclation, there are many sales order/delivery no. But in this case, the sales order/delivery are getting fetched incorrectly.

I have given an example as shown below--

( Sales order/delivery no. are replicating here )

custom declaration     sales order     delivery order

                                        a                     p

                                        a                     p

                                        a                     p

                                        a                     p

  x                                    a                     p

                                        b                     q

                                        b                     q

                                        b                     q

                                        b                     q

The sales order/delivery no should appear like this--

custom declaration     sales order     delivery order

                                        a                     p

                                        b                     q

                                        c                      r

                                        d                      s

                                        e                      t

  x                                     f                      u

                                        g                      v

                                        h                     w

                                        i                       y

                                                             

what can i do in this case?

4 REPLIES 4

arivazhagan_sivasamy
Active Contributor
0 Kudos

Hi,

Please update your final internal table using below.

Loop at itab.

At end of delivery order.

final-salesorder = itab-salesorder.

final-deliveryorder = itab-deliveryorder.

append final.

endat.

Endloop.

Your final internal table will get output like above.

Arivazhagan S

sivaganesh_krishnan
Contributor
0 Kudos

HI meenakshi,

I guess that you would have maintained a internal table with all the values.

I have just written the logic , try with your own variable

loop at l_itab into x_itab where customerno = lv_cust .   " looping for a particular customer declaration

x_new-customer      = x_itab-customer.

x_new-salesorder    = x_itab-salesorder.

x_new-deliverynote = x_itab-deliverynote.

append x_new to l_new .

clear x_new.

endloop.

Now this l_new internal table will hold the correct values without dupicating .

Regards,

Sivaganesh

former_member188827
Active Contributor
0 Kudos

Share your code. Also, sort your internal table and use "DELETE ADJACENT DUPLICATES".

Regards

nabheetscn
Active Contributor
0 Kudos

Lets say IT_FINAL is having this data.

Sort it_final by custom,order,deliver.

delete adjacenet duplicates from it_final comparing custom order delivery