‎2007 Jan 03 6:00 AM
HI ABAPERS,
I am using RANGES statement and i am selecting the range of dates in it.
using this range i want to pass one by one date to function module how can i do.
<b>BELOW IS THE CODE WHAT I AM DOING</b>
I WANT TO PASS ALL THE DATES TO THIS FN MODULE
data : begin of wr_date occurs 0, " ranges accepts in format YYYY MM DD
sign(1),
option(2),
low type char8,
high type char8,
end of wr_Date.
wr_date-sign = 'I'.
wr_date-option = 'BT'.
wr_date-low = w_low. " HERE IAM PASSING INITIAL DATE
wr_date-high = w_high. " HERE IAM PASSING LAST DATE
APPEND wr_date.
loop at WR_DATE where option = 'BT' AND SIGN = 'I'.
CALL FUNCTION 'CONVERSION_EXIT_INVDT_INPUT'
EXPORTING
input = " HERE I WANT TO PASS ONE BY ONE DATE"
IMPORTING
OUTPUT = " APPENDING SOME INTERNAL TABLE"
endloop.
pLEASE HELP
AHMED
‎2007 Jan 03 6:06 AM
u have to define ranges like this
ranges : r_budat for bkpf-budat.
then no need to put a logic.
Regards
prabhu
‎2007 Jan 03 6:07 AM
if it is same as tht of ur previos query then just copy my code and it work as to read data from tcurr ,u need to do any conversion.if it something else then simply do as follows -
loop at WR_DATE where option = 'BT' AND SIGN = 'I'.
CALL FUNCTION 'CONVERSION_EXIT_INVDT_INPUT'
EXPORTING
input = wr_date-low
IMPORTING
OUTPUT = wr_date-low.
CALL FUNCTION 'CONVERSION_EXIT_INVDT_INPUT'
EXPORTING
input = wr_date-high
IMPORTING
OUTPUT = wr_date-high.
modify wr_date index sy-tabix.
endloop.
Message was edited by:
Amit Tyagi
‎2007 Jan 03 7:07 AM
how will i select all the dates and convert all the dates and for all the dates converted to inverted fom.
‎2007 Jan 03 7:11 AM
just check ur internal table wr_date it is having all the converted dates now..
now u can have select query on the databse table based on these dates to fetch data.
amit
‎2007 Jan 03 6:09 AM
Hi Ahmed ,
Here is a sample code which must be able to help
wr_date-sign = 'I'.
wr_date-option = 'BT'.
wr_date-low = w_low. " HERE IAM PASSING INITIAL DATE
wr_date-high = w_high. " HERE IAM PASSING LAST DATE
APPEND wr_date.
*loop at WR_DATE where option = 'BT' AND SIGN = 'I'. "Commenetd
LOOP AT WR_DATE .
IF NOT WR_DATE-LOW IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_INVDT_INPUT'
EXPORTING
input = WR_DATE-LOW
IMPORTING
OUTPUT = WA_FTABLE-DATE.
APPEND WA_FTABLE. " append to your internal table
ENDIF.
F NOT WR_DATE-high IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_INVDT_INPUT'
EXPORTING
input = WR_DATE-HIGH
IMPORTING
OUTPUT = WA_FTABLE-DATE.
APPEND WA_FTABLE.
ENDIF.
endloop.Do revert back in case you have more queries.
Regards
Arun
‎2007 Jan 03 6:13 AM
Hi Ahmed,
RANGES r_budat for bkpf-budat.
r_budat-sign = 'I'.
r_budat-option = 'BT'.
r_budat-low = lowdate.
r_budat-high = highdate.
APPEND r_budat.
loop at r_budat where option = 'BT' AND SIGN = 'I'.
CALL FUNCTION 'CONVERSION_EXIT_INVDT_INPUT'
EXPORTING
input = " pass date here like r_budat.
IMPORTING
OUTPUT = " APPENDING SOME INTERNAL TABLE"
endloop.
Regards,
Sunil