02-23-2010 4:46 AM
Hi,
I have made a vendor balance report having debit and credit entry in on eintrenal table IT_BSIK, with all line item detail in another table IT_TAB1 i want to make summry report by adding all the amount of of line item it is also working fine but i wan tto change the summary report i want summary for debit and credit entery seperate How to do it find Below the code part for summary how to use AT NEW SHKZG then append the IT_TAB1
find the code here.
**********************summarised part
loop at it_lfnr.
Clear : VTOTBAL, vNtdue, vDue, vDue0, vDue31, vDue61, vDue91,V1TOTBAL.
loop at it_bsik where lifnr = it_lfnr-lifnr.
IT_TAB1-LIFNR = IT_BSIK-LIFNR.
IT_TAB1-BUKRS = IT_BSIK-BUKRS.
IT_TAB1-SAKNR = IT_BSIK-SAKNR.
IT_tab1-NAME1 = IT_bsik-NAME1.
ADD IT_BSIK-dmbtr TO V1TOTBAL.
move V1TOTBAL TO IT_TAB1-dmBTR.
ADD IT_BSIK-WRBTR TO VTOTBAL.
move VTOTBAL TO IT_TAB1-WRBTR.
MOVE IT_BSIK-WAERS TO IT_TAB1-WAERS.
ADD IT_BSIK-NTDUE TO VNTDUE.
move VNTDUE TO IT_TAB1-NTDUE.
ADD IT_BSIK-DUE TO VDUE.
move VDUE TO IT_TAB1-DUE.
ADD IT_BSIK-DUE0 TO VDUE0.
move VDUE0 TO IT_TAB1-DUE0.
ADD IT_BSIK-DUE31 TO VDUE31.
move VDUE31 TO IT_TAB1-DUE31.
ADD IT_BSIK-DUE61 TO VDUE61.
move VDUE61 TO IT_TAB1-DUE61.
ADD IT_BSIK-DUE91 TO VDUE91.
move VDUE91 TO IT_TAB1-DUE91.
endloop.
append it_tab1.
endloop.
***********************************end of summarised vendor part ***************************
02-23-2010 4:53 AM
Hi,
BSIK table has one field called 'Debit/Credit Indicator' (SHKZG ). So, while retrieving data from BSIK retrieve this field as well then, separate data based on this indicator field. So, you will get separate detals of debit and credit.
Hope it helps.
Thansk,
Archana
02-23-2010 4:59 AM
Hi,
Y dont u just try using the indicator value -
IF SHKZG = 'H'.
debit
else.
credit.
endif.
Hope this helps.
02-23-2010 4:59 AM
//AT NEW SHKZG
In my opinion you should apply the control break based on some unique key for adding up the credit and debit . before apllying control break at new the fields should be sorted by the same unique key .. in your case it should be on lifnr or some unique key but cant be on a indicator like SHKZG.
Br,
Vijay.
02-23-2010 5:00 AM
Use IF instead of AT NEW.
loop.
If SCHKZ = 'Debit'
Move data.
Append Data.
endif.
If SCHKZ = 'Credit'
Move data.
Append Data.
endif.
endloop.
Add a FLAG field to differentiate between them and Then sort it based on that value.
Easy option is Use SCHKZ and SORT it.
02-23-2010 5:44 AM
Hi,
Thanks for your reply.
but still i am not getting what exactly to be done plz help with some more detail i jhave given my code above can u just show how to do it with this code.
i have try with if debit and credit but not getting proper data.
regards,
zafar
02-23-2010 5:51 AM
Hi,
loop at it_bsik where lifnr = it_lfnr-lifnr.
if it_bsik-SHKZG eq 'Debit.
add all your fields to table itab.
else.
add all your fields to table itab1.
endif.
endloop.
This way you will get debit data in table itab and credit data in itab1.
Then you can use At new lifnr for both tables separately and you will be able to sum it separately.
Hope its clear.
Thanks,
Archana
02-23-2010 6:01 AM
Hi,
In my case i want dat in one table only with two records one debit and one credit.
regards,
zafar
02-23-2010 6:58 AM
Hi,
As per my method you can combine the data of two tables in 1 table at the end.
Thanks,
Archana
02-24-2010 3:42 AM