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: 

how to get the duplicate records in report rfbnum10

Former Member
0 Kudos

Hi Experts,

I am modifying the standard report RFBNUM10 copying it to another program name.

my requirement was to display duplicate reference number. i have completed the task but now i have one doubt that if we check the same amount check box and execute then how the report will display.

My input parameters are

Same amount check box  ( if check box is ticked Need to remove single values).

Same Ref check box  ( if check box is ticked Need to remove single values).

I am using delete adjustment duplicate logic and I am also trying at new (Amount and Ref ) but its not working properly.

 

Below is my example test data


SlAmountRef.
110001234
210001234
3200012345
420001234
5300012345
65000123



I wanted out put like this.

SlAmountRef.
110001234
210001234


Please help me out.


Regards

Shambuling Kulkarni

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Experts,

Issue has been solved the report is displaying data as per our expectations.

Thanks all for providing your valuable input and time.

below is the code which i used.

loop at  lt_itab into wa_itab1.

loop at it_itab into wa_itab where bukrs = wa_itab1-bukrs and

                       koart = wa_itab1-koart and

                       konto = wa_itab1-konto and

                       gjahr = wa_itab1-gjahr and

                       xblnr = wa_itab1-xblnr.

lv_cnt1 = lv_cnt1 + 1.

clear wa_itab.

endloop.

if lv_cnt1 = 1.

   wa_itab1-dele_flg = 'X'.

modify it_itab from wa_itab1 transporting dele_flg where bukrs = wa_itab1-bukrs and

                                                             koart = wa_itab1-koart and

                                                             konto = wa_itab1-konto and

                                                             gjahr = wa_itab1-gjahr and

                                                             xblnr = wa_itab1-xblnr.

endif.

clear :lv_cnt1,wa_itab1.

endloop.


delete it_itab where dele_flg = 'X'.


Regards

Shambuling

8 REPLIES 8

Former Member
0 Kudos

Hi Shambuling,

You can create following 3 internal tables:

1. ITAB1 which will have same amout & same ref data-it should be display in output if both checkbox selected

2. ITAB2 which will have same amount data-it should be display in output if same amt checkbox selected

3. ITAB3-which will have same ref data-it should be display in output if same ref checkbox selected

Regards,

Sudeesh Soni

0 Kudos

Hi Sudeesh.

Thanks for your reply.

Actually in the same way i am displaying the data but the thing here is to get the correct data. when i check the same amount checkbox it is displaying like below .

110001234
210001234
3200012345
420001234

but what about the reference it is not proper .

i am think about the logic how should we eliminate it .

Thanks

Shambuling

Former Member
0 Kudos

Hi Shambuling,

Can you show the expected output for following scenarios:

1. same amount checkbox selected

2. same ref. checkbox selected

3. Both checkbox selected

Regards,

Sudeesh Soni

0 Kudos

Hi sudeesh

here is the output which i am getting on the overview its correct i am not sure whether it is correct whether it is totally correct.

refentry date docu datepostamount
XXXXX00002      05/25/2013   05/25/2013   31                        6,360.25-
XXXXX00002      06/24/2013   06/24/2013   31                        6,360.25-
XXXXX00002      07/24/2013   07/24/2013   31                        6,360.25-
XXXXX00002      03/03/2013   03/03/2013   31                        5,695.20-
XXXXX00002      03/22/2013   03/22/2013   31                        5,695.20-
XXXXX00002      04/25/2013   04/25/2013   31                        5,695.20-

0 Kudos

Hi Shambuling,

I hope I understood your requirement clearly if not then correct me.

If you want to remove single values from ITAB.

*****************************************************************************

CLEAR: WA, WA1.               " wa and wa1 are work areas of same table type.

SORT ITAB BY LV_AMOUNT LV_REFERENCE.

ITAB1[] = ITAB[].

LOOP AT ITAB INTO WA.

     LV_TABIX = SY-TABIX.

     IF WA1 IS NOT INITIAL.

          IF WA <> WA1.

                DELETE ITAB1 INDEX LV_TABIX.                           

          ENDIF.        

     ENDIF.

   

          WA1 = WA.

ENDLOOP.

CLEAR ITAB[].

ITAB[] = ITAB1[].

*****************************************************************************

Try above code to delete single values from ITAB.

Jay MH..!!

Regards,

Siddhesh Satghare.

Message was edited by: Siddhesh Satghare

0 Kudos

Hi Siddhesh.

Its deleting entire data .

for your reference : we are using these below fields

bukrs : company code

koart: account type

konto : vendor .

gjahr : fiscal year

xblnr : reference number

waehr :amount

bldat : document date.


thanks

Shambuling

Former Member
0 Kudos

Hi Shambuling,

I need the sample expected output data for given 3 scenario because depending upon checkbox your output is getting changed if i am correct. It will be helpful in writing the code logic.

Regards,

Sudeesh Soni


Former Member
0 Kudos

Hi Experts,

Issue has been solved the report is displaying data as per our expectations.

Thanks all for providing your valuable input and time.

below is the code which i used.

loop at  lt_itab into wa_itab1.

loop at it_itab into wa_itab where bukrs = wa_itab1-bukrs and

                       koart = wa_itab1-koart and

                       konto = wa_itab1-konto and

                       gjahr = wa_itab1-gjahr and

                       xblnr = wa_itab1-xblnr.

lv_cnt1 = lv_cnt1 + 1.

clear wa_itab.

endloop.

if lv_cnt1 = 1.

   wa_itab1-dele_flg = 'X'.

modify it_itab from wa_itab1 transporting dele_flg where bukrs = wa_itab1-bukrs and

                                                             koart = wa_itab1-koart and

                                                             konto = wa_itab1-konto and

                                                             gjahr = wa_itab1-gjahr and

                                                             xblnr = wa_itab1-xblnr.

endif.

clear :lv_cnt1,wa_itab1.

endloop.


delete it_itab where dele_flg = 'X'.


Regards

Shambuling