‎2008 Aug 20 8:02 AM
Hi all,
In my report i have to display date in mmddyyyy format but date is being concatenated from the different parameters entered by the user what i m doing is ..concatenating all the parameters into a variable fdate which is of type string now i want to transfer this fdate into final_date which is of type sy-datum but output is not coming proper ....plz help me out..
Thanks & regards
Ashu SIngh
‎2008 Aug 20 8:13 AM
Hi,
Use this FM : HRGPBS_HESA_DATE_FORMAT. It will convert varriable like fdate to date format.
Regards,
T.D.M.
‎2008 Aug 20 8:07 AM
If you want to display the final output as mmddyyyy, then display the string itself
dont pass it to sy-datum.
‎2008 Aug 20 8:08 AM
‎2008 Aug 20 8:10 AM
declare a variable of type STRING or CHAR. Then pass that date to that variable and output it. Let me know if you have any more queries
‎2008 Aug 20 8:11 AM
Hi,
You are making a variable fdate that is made from concatenation of parameters then why do you need to pass in another variable final_date which is of type sy-datum. Output that string only na i.e fdate arranged in mmddyyyy manner.
hope this helps.
thanx,
dhanashri.
‎2008 Aug 20 8:13 AM
Hi,
Use this FM : HRGPBS_HESA_DATE_FORMAT. It will convert varriable like fdate to date format.
Regards,
T.D.M.
‎2008 Aug 20 8:23 AM
Hi Ashu ,
Try this :
select-options :
s_inprd for sy-datum.
DATA :
w_date like sy-datum,
w_year(4) TYPE n, " Year
w_month(2) TYPE n, " Month
w_day(2) TYPE n, " Day
w_condat(10) TYPE c, " Date
w_year = s_inprd-high+0(4).
w_month = s_inprd-high+4(2).
w_day = s_inprd-high+6(2).
CONCATENATE w_day
w_month
w_year
INTO w_condat
SEPARATED BY '.'.
w_date = w_condat.
This will surely solve the purpose.
Regards,
Swapna.
‎2008 Aug 20 8:43 AM
Hi,
DATA :
w_date TYPE sy-datum,
*Assuming the date after concatenate is
w_string TYPE string VALUE '20080820'.
w_date = w_string.
WRITE:
w_date.Regards
Adil
‎2008 Aug 20 9:53 AM
Hi
I didn't get your question..
Just for example i am assuming that you are grabing baseline date which was posted by one user and trying to do vendor posting with another user.
in this scenario you will get into this kind of trouble.
Solution:
read the baseline date(always in format yyyymmdd)
convert it to the present user format.
SELECT SINGLE * INTO l_usr01
FROM usr01
WHERE bname = sy-uname. "YYYYMMDD
CASE l_usr01-datfm.
WHEN '1'.
convert to "dd.mm.yyyy
when '2'.
convert to "mm.dd.yyyy
when '3'.
convert to "mm-dd-yyyy
when '4'.
convert to "mm-dd-yyyy
when '5'.
convert to "yyyy/mm/dd
when '6'.
convert to "yyyy-mm-dd