Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Urgent ......regarding date format in SAP Script

Former Member
0 Likes
656

In my MAIN WINDOW I have date fields like Date of Manifacture, created date and Expiry date.

So, currently I am using SET DATE MASK = 'YYYY-MM' and it is printing same format for all fields.

But now my requirement is I want to show date for Expiry Date like 'YYYY-MM-DD'. For this I defined one temparary variable in the form like below

DEFINE &outdate& = &mchar-vfdat&

SET &outdate& MASK = 'YYYY-MM-DD'.

but still it is showing format YYYY-MM...

Plz help me how to print my desired date format...

I am waiting for ur reply...

Regards,

Kumar

In my MAIN WINDOW I have date fields like Date of Manifacture, created date and Expiry date.

So, currently I am using SET DATE MASK = 'YYYY-MM' and it is printing same format for all fields.

But now my requirement is I want to show date for Expiry Date like 'YYYY-MM-DD'. For this I defined one temparary variable in the form like below

DEFINE &outdate& = &mchar-vfdat&

SET &outdate& MASK = 'YYYY-MM-DD'.

but still it is showing format YYYY-MM...

Plz help me how to print my desired date format...

I am waiting for ur reply...

Regards,

Kumar

4 REPLIES 4
Read only

Former Member
0 Likes
633

Hi Kishore,

you have to check outdate field type.change it according to your requirement

reward points if helpfu.

Read only

Former Member
0 Likes
633

Hi

Try to check the value in &mchar-vfdat&, I believe the format date is changed before moving it to the new variable &outdate&.

Try to use this command:

SET DATE MASK = 'YYYY-MM-DD'.

DEFINE &outdate& = &mchar-vfdat&.

&outdate&

SET DATE MASK = 'YYYY-MM''.

Max

Read only

Former Member
0 Likes
633

Hi Kishore kumar,

What you can do is befor printing the Expiry date set the date Mask as 'YYYY-MM-DD' and after printing your Expiry Date again set the DATE MASK to 'YYYY-MM'

i.e.

/: SET DATE MASK = 'YYYY-MM-DD'
   &mchar-vfdat&
/: SET DATE MASK = 'YYYY-MM'

Regards,

Sunil

Read only

Former Member
0 Likes
633

Hi,

Declare temporary variable with 10 chars and check

data: v_date(10).