‎2011 Jun 02 9:24 PM
hello
i am doing a program that read some file but the name of the file is dynamic base in a config table where i put the path, some prefix and subfix and a date mask
now i want convert any give date to the date format ( date mask ) that i get when i fetch the data form the config table something like this
select single * from config_table wa_something
where key1 = something
write sy-datum using mask wa_something-datemask to vFinalvar.but that not work , not sure if i explain right... but i will thanks any help
Thanks in advanced
‎2011 Jun 02 9:33 PM
Hope you used the below syntax and missing 'edit' is a typo. What are the possible values in datemask of the config_table or mention atleast the one which didnt work?
WRITE SY-DATUM TO vFinalvar USING EDIT MASK wa_something-datemask.
‎2011 Jun 02 9:53 PM
Hope you used the below syntax and missing 'edit' is a typo. What are the possible values in datemask of the config_table or mention atleast the one which didnt work?
>
>
> WRITE SY-DATUM TO vFinalvar USING EDIT MASK wa_something-datemask. >
i try that too but i only get the mask write in the vFinalvar
( vFinalVar ='YYYYMMDD )
‎2011 Jun 02 9:59 PM
You have mistaken the usage of EDIT MASK. Plese refer to the below link...
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9e3d35c111d1829f0000e829fbfe/content.htm
As of now I can only think of the below solution for your problem.
Case wa_something-datemask.
When 'DD/MM/YY'.
WRITE SY-DATUM DD/MM/YYYY TO vFinalvar.
When 'MM/DD/YY'.
WRITE SY-DATUM MM/DD/YY TO vFinalvar.
* Similarly below formats....
....DD/MM/YYYY
....MM/DD/YYYY
....DDMMYY
....MMDDYY
....YYMMDD
Endcase.
or you may have to write your own logic to format the date into vFinalvar for the formats which are not supported by standard write.
Edited by: Suman Jagu on Jun 2, 2011 5:08 PM