on 09-18-2007 4:23 PM
hallow
i have table a_itab with begdate and endate and i wont to move it to table
with period and price for period <b>on every month</b>
how is the <b>best</b> way to do that?
<b><REMOVED BY MODERATOR></b>
i give example
a_itab
reserc--
price
0000008254 20070330 20070101 0000014850 3000.00
0000010599 20080731 20080401 0000014851 15000.00
0000123456 20070331 20070101 0000014834 20000.00
0000123456 20070631 20070601 0000014835 80.00
i wont
b_itab
period----price--
reserc
012007--3000.00--
0000008254
022007--3000.00--
0000008254
032007 3000.00 0000008254
042008 15000.00 0000010599
052008 15000.00 0000010599
062008 15000.00 0000010599
072008 15000.00 0000010599
012007 20000.00 0000123456
022007 20000.00 0000123456
032007 20000.00 0000123456
042007 80.00 0000123456
052007 80.00 0000123456
062007 80.00 0000123456
Regards
Message was edited by:
Alvaro Tejada Galindo
Hi,
Please try this.
DATA: DURATION TYPE I,
DATE TYPE SY-DATUM.
LOOP AT A_ITAB.
CALL FUNCTION 'HR_GBSXP_GET_MONTHS'
EXPORTING
FIRST_DATE = A_ITAB-BEGDATE
SECOND_DATE = A_ITAB-ENDDATE
MODIFY_INTERVAL = ' '
IMPORTING
DURATION = DURATION
EXCEPTIONS
INVALID_SEQ_DATES = 1
OTHERS = 2.
DURATION = DURATION + 1.
DO DURATION TIMES.
IF SY-INDEX = 1.
DATE = A_ITAB-BEGDATE.
ELSE.
IF DATE+4(2) = '12'.
DATE(4) = DATE(4) + 1.
DATE+4(2) = 1.
ELSE.
DATE+4(2) = DATE+4(2) + 1.
ENDIF.
ENDIF.
B_ITAB-PERIOD = DATE(6).
B_ITAB-PRICE = A_ITAB-PRICE.
B_ITAB-RESERC = A_ITAB-RESERC.
APPEND B_ITAB.
ENDDO.
ENDLOOP.
Regards,
Ferry Lianto
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can give you some ideas and it requires some time and trial and error probably!!
loop through your first table a_itab.
Get just month from your begda/enda Ex:if begda is 09/18/07 then month would return 09.
You can then use "On change of month inside loop".
Keep accumulating price and then you can then move your price and priod into second internal table b_itab "on change of month"..
You can try something like above!!
Mithun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi experts
i need some help.
<b><REMOVED BY MODERATOR></b>
regards
Message was edited by:
Alvaro Tejada Galindo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.