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: 

Report to display the GL balances according to Fiscal period

vinay_pasalkar
Participant
0 Kudos

Hi Experts,

I have a requirment to display GL balances for the different account numbers from the table- faglflext

If the period is 3, the GL balances should add up the value from total= KSLVT to KSL03 and total1 =KSLVT to KSL02.

If the period is 10, the GL balances should add up the value from  total= KSLVT to KSL03 and total1 = KSLVT to KSL02.

I have all the account balances for Debit & credit in one internal table,

Could you please let me know how I can apply the logic to show the total & Total 1 according to Fiscal period of the Run date.

Thanks

Vinay Pasalkar

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

You could try a DO VARYING, syntax like this

DO VARYING period TIMES VARYING value FROM faglflext-ksl01 NEXT faglflext-ksl02 RANGE faglflext.

     ADD value TO wa-total.

     CHECK sy-index LT period.

     ADD value TO wa-total1.

ENDDO.

Regards,

Raymond

3 REPLIES 3

former_member421418
Participant
0 Kudos

Hi Vinay,

I used below logic to get totals of Amount usually the amount field in the faglflext is TSL01. u can apply the logic for your KSL01 also.

DATA : lv_trans TYPE char10,
          lv_period TYPE char3,
          lv_len TYPE i.
   MOVE wa_data-rpmax TO lv_period .
   SHIFT lv_period LEFT DELETING LEADING '0'.
   CONDENSE lv_period.
   DO lv_period TIMES.
     SHIFT lv_period LEFT DELETING LEADING '0'.
     CONDENSE lv_period.
     IF lv_period GT 0.
       lv_len = strlen( lv_period ).
       IF lv_len EQ '2'.
         CONCATENATE 'TSL' lv_period INTO lv_trans.
         CONDENSE lv_trans.
       ELSE.
         CONCATENATE 'TSL' '0' lv_period INTO lv_trans.
         CONDENSE lv_trans.
       ENDIF.
       ASSIGN COMPONENT lv_trans OF STRUCTURE wa_data TO <fs_tran>.
       lv_amount = <fs_tran> + lv_amount.
       lv_period = lv_period - 1.
     ELSE.
       EXIT.
     ENDIF.

Above Lv_period is the period value which is entered in the selection screen.

This will be in Parameters.

Check the logic and Modify according to yourself.

Any issues let me know

Thanks & Regards

Kiran

raymond_giuseppi
Active Contributor
0 Kudos

You could try a DO VARYING, syntax like this

DO VARYING period TIMES VARYING value FROM faglflext-ksl01 NEXT faglflext-ksl02 RANGE faglflext.

     ADD value TO wa-total.

     CHECK sy-index LT period.

     ADD value TO wa-total1.

ENDDO.

Regards,

Raymond

0 Kudos

Thanks a lot for your reply.