‎2007 Feb 06 12:17 PM
hi guys,
i just got a requirement where i need to take date from BEDAT field in EKKO and
build a date in this format.
MM.YYYY in the selection screen but when user enter date in selection screen say:
ex: 02.2007 it should be stored as 01.02.2007 in data base ( that is, it should take first day i.e 1 of that particular month.)
can any one please give me a piece of code for this.
Thank you
pavan
‎2007 Feb 06 12:24 PM
hi for this u need to write some piece of code like this
you cannot declare a parameter in selection screen of sy-datum as it will give it as an invalid date
suppose that ur parameter in selection screen contains this 02.2007 then declare v_date field.
parameter: v_date(10).
concatenate '01.' v_date0(3) v_date4(5) into v_date.
this will do ur work seperated by dots.
<b>
award points if found helpful</b>
Message was edited by:
Rahul Kavuri
‎2007 Feb 06 12:24 PM
hi for this u need to write some piece of code like this
you cannot declare a parameter in selection screen of sy-datum as it will give it as an invalid date
suppose that ur parameter in selection screen contains this 02.2007 then declare v_date field.
parameter: v_date(10).
concatenate '01.' v_date0(3) v_date4(5) into v_date.
this will do ur work seperated by dots.
<b>
award points if found helpful</b>
Message was edited by:
Rahul Kavuri
‎2007 Feb 06 12:26 PM
parameters: dats(6) type c.
data: dats1(10).
dats1+0(2) = '01'.
dats1+2(6) = dats.
write: dats1 using edit mask '__/__/____'.
Cheers.
‎2007 Feb 06 12:26 PM
hi,
user entered 02.2007 .this is a parameter declaration .
parameter :p_date(10) type c. (where p_date = 02.2007)
concatenate '01.' p_date into a. (where a is some variable )
then u can update the d/b using a.
<b>reward pts if useful.</b>
‎2007 Feb 06 12:35 PM
RS_VARI_V_1_ACTUAL_MONTH
RS_VARI_V_1_LAST_MONTH
RS_VARI_V_1_NEXT_MONTH Returns first day of the actual/last/next month.
RS_VARI_V_ACTUAL_MONTH
RS_VARI_V_LAST_MONTH Returns selection range for the actual/last month.
Output: 1st line in table P_DATETAB
‎2007 Feb 06 2:59 PM
execute the code .
parameters : p_date(7) type c. " RSCALMONTH.
initialization.
concatenate sy-datum+4(2) sy-datum+0(4) into p_date separated by '.'.
data : date like sy-datum.
start-of-selection.
concatenate sy-datum+0(4) sy-datum+4(2) '01' into date .
write:/ date."exchange this filed to ur table .
regards,
vijay