2007 Jul 10 6:26 AM
Hi Genius,
I have a doupts in Report..
<b> budat = 01.04.2007 to 30.04.2007</b>
<b> matnr = a001</b>
SELECT * FROM zs_mkpf_mseg
into corresponding fields of table it_opbal
WHERE werks = itmat-werks
AND matnr = itmat-matnr
AND budat LT s_budat-low.
Now iam getting the opening balance..that is the closing balance of up to
30-3-2007.
My req is..between 1st month to 30th, i have to calculate the opbal of every day wise(1-4-07 to 30-4-07) for that how i should write the query statement.
please suggest me.
2007 Jul 10 6:37 AM
Just add moving balance to open balance.
For example:
DATA: balance type <the data type>.
LOOP AT it_opbal ASSIGNING <fs>.
IF sy-tabix = 1.
<fs>-opbal = <closing balance from previous period>.
ELSE.
READ TABLE it_opbal INTO wa_temp INDEX sy-tabix - 1.
<fs>-opbal = wa_temp-opbal + wa_temp-movbal.
sy-tabix = sy-tabix + 1. "To revert the index to actual position
ENDLOOP.
Hope it'll work.
Just add moving balance to open balance.
For example:
DATA: balance type <the data type>.
LOOP AT it_opbal ASSIGNING <fs>.
IF sy-tabix = 1.
<fs>-opbal = <closing balance from previous period>.
ELSE.
READ TABLE it_opbal INTO wa_temp INDEX sy-tabix - 1.
<fs>-opbal = wa_temp-opbal + wa_temp-movbal.
sy-tabix = sy-tabix + 1. "To revert the index to actual position
ENDLOOP.
Hope it'll work.
2007 Jul 10 6:36 AM
Hi,
Please Check the change in bold.
SELECT * FROM zs_mkpf_mseg
into corresponding fields of table it_opbal
WHERE werks = itmat-werks
AND matnr = itmat-matnr
AND budat <b>IN s_budat</b>.
Regards,
Ranjit Thakur.
<b>Please Mark The Helpful Answer.</b>
2007 Jul 10 6:37 AM
Just add moving balance to open balance.
For example:
DATA: balance type <the data type>.
LOOP AT it_opbal ASSIGNING <fs>.
IF sy-tabix = 1.
<fs>-opbal = <closing balance from previous period>.
ELSE.
READ TABLE it_opbal INTO wa_temp INDEX sy-tabix - 1.
<fs>-opbal = wa_temp-opbal + wa_temp-movbal.
sy-tabix = sy-tabix + 1. "To revert the index to actual position
ENDLOOP.
Hope it'll work.
2007 Jul 10 6:48 AM
hi first i have to calculate the opbal of 01-04-07 to 30-04-07.(00-00-0000 to 30-03-2007).
Now the opening balance for 01-04-07 is calculated..Again I want to calculate the opening balance of between<b> 01-04-2007 to 30-04-2007.</b>. please guide me.
2007 Jul 10 8:13 AM
Hi
SELECT gjahr belnr FROM bseg
into corresponding fields of table int_bseg
WHERE werks = itmat-werks
AND budat = s_budat-low.
loop at int_BSEG.<-- loop at ur date declared internal table
read table int_bseg WITH KEY BELNR = INT_BSEG-BELNR
GJAHR = INT_BSEG-GJAHR. <-- to read the same internal table
IF int_bseg-belnr = 'compare value'.
total = total + int_bseg-belnr. " here goes ur coding part for date "
.......................
try like thi s
Reward all helpfull answers
Regards
Pavan
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |