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: 

At new statement for Summary report

Former Member
0 Kudos

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 ***************************

9 REPLIES 9

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

Y dont u just try using the indicator value -

IF SHKZG = 'H'.

debit

else.

credit.

endif.

Hope this helps.

Former Member
0 Kudos

//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.

amit_khare
Active Contributor
0 Kudos

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.

0 Kudos

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

0 Kudos

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

0 Kudos

Hi,

In my case i want dat in one table only with two records one debit and one credit.

regards,

zafar

0 Kudos

Hi,

As per my method you can combine the data of two tables in 1 table at the end.

Thanks,

Archana

0 Kudos

OK