05-13-2014 9:59 AM
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
Sl | Amount | Ref. |
1 | 1000 | 1234 |
2 | 1000 | 1234 |
3 | 2000 | 12345 |
4 | 2000 | 1234 |
5 | 3000 | 12345 |
6 | 5000 | 123 |
I wanted out put like this.
Sl | Amount | Ref. |
1 | 1000 | 1234 |
2 | 1000 | 1234 |
Please help me out.
Regards
Shambuling Kulkarni
05-14-2014 6:22 AM
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
05-13-2014 10:57 AM
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
05-13-2014 11:09 AM
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 .
1 | 1000 | 1234 |
2 | 1000 | 1234 |
3 | 2000 | 12345 |
4 | 2000 | 1234 |
but what about the reference it is not proper .
i am think about the logic how should we eliminate it .
Thanks
Shambuling
05-13-2014 11:13 AM
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
05-13-2014 11:39 AM
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.
ref | entry date | docu date | post | amount | ||
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- |
05-13-2014 11:55 AM
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
05-13-2014 12:13 PM
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
05-13-2014 1:49 PM
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
05-14-2014 6:22 AM
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