‎2008 Feb 01 9:05 AM
Hi Everyone,
I am reading date from a file which is in the form YYYYMMDD.
Is there any functional module that checks the user's date format and changes the format according to it.
for eg. if the user has a setting DD.MM.YYYY then YYYYMMDD should be converted to this format.
Helpful answeres will be certainly rewarded.
Thanks,
Sandeep
‎2008 Feb 01 9:20 AM
Use function module '/SAPDII/SPP05_CONVERT_DATE'.
Reward if found useful
‎2008 Feb 01 9:08 AM
Hi,
Check this Example..
DATA:V_DATE(10).
concatenate sy-datum6(2)'.' sy-datum4(2)'.' sy-datum+0(4) into v_date.
Write:V_DATE.
Or Use the FM:
CONVERT_DATE_TO_INTERNAL
‎2008 Feb 01 9:10 AM
hi
CONCATENATE p_date+6(2) '/'
p_date+4(2) '/'
p_date+0(4) INTO p_date1 .
regards
kk.
‎2008 Feb 01 9:12 AM
Hi,
Use the function module CONVERT_DATE_TO_INTERNAL..
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
DATE_EXTERNAL = V_DATE_EX
IMPORTING
DATE_INTERNAL = V_DATE.
Regards,
Satish
‎2008 Feb 01 9:14 AM
hi sandeep
plz go to debugging
in that give sy-datum field in fields of the debugger
then u will be knowing the format of the date
then u can use the correct concatenation formula inorder to fit the format of the date in the sap.
if satisfied plz reward
regards
samarendra
‎2008 Feb 01 9:19 AM
I dont think you need any FM in this case. Anyway SAP is going to store date in YYYYMMDD format internally.
So you can assign date value from file which is in YYYYMMDD with out any validations.
then after depending upon user setting date is going to dispaly. You need not do anything.
‎2008 Feb 01 9:20 AM
Hi sandeep
There is a table USR01 where data format for current user is stored.
pass user name to 'BNAME' field
'DATFM' field value gives you the type of date format set.
then you can dynamically write code according to the date format set.
eg.
CASE DATFM
when '2'
concatenate sy-datum6(2)'.' sy-datum4(2)'.' sy-datum+0(4) into v_date.
when '
endcase.
I think this will solve your problem'
Please reward points if this solves ur problem
Sukhi.
‎2008 Feb 01 9:20 AM
Use function module '/SAPDII/SPP05_CONVERT_DATE'.
Reward if found useful
‎2008 Feb 01 4:38 PM