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

form painter: data format in command line

Former Member
0 Likes
720

Hi together,

I want to insert a command line like...

IF MHNK-LAUFD GE >>certain date<<.

What format do I have to use for >>certain date<<.

e.g.:

YYYYMMDD or

YYYY/MM/DD or

YYYY.MM.DD or ...

I´ve already checked out several formats; without success.

Thanks for any help

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
673

This is a date (DATS) field, so use a format compatible with internal format 'YYYYMMDD', e.g. '20120629', or define a constant CONSTANTS: c_date TYPE D VALUE '20120629'.

(You are using SmartForms ?)

Regards,

Raymond

5 REPLIES 5
Read only

RaymondGiuseppi
Active Contributor
0 Likes
674

This is a date (DATS) field, so use a format compatible with internal format 'YYYYMMDD', e.g. '20120629', or define a constant CONSTANTS: c_date TYPE D VALUE '20120629'.

(You are using SmartForms ?)

Regards,

Raymond

Read only

0 Likes
673

Hi,

although I set data mask 'YYYYMMDD' and put '20120601' for the actual date it doesn´t work.

By the way....I´m using trx. se71.

best

Read only

0 Likes
673

You are using SAPscript, so your syntax was not

IF MHNK-LAUFD GE '20120629.

but rather

/:   IF &MHNK-LAUFD& GE '20120629'.

You should force date to use a "sortable" format like YYYYMMDD

/: SET DATE MASK 'YYYYMMDD'.

/: IF &MHNK-LAUFD& GE '20120629'.

...

/: SET DATE MASK ' '.

The last statement to put date format back to default (before printing a date)

If that don't work, try to force data format before calling the SAPscript.

(I never liked way that SAPscript use to pass numerical, date or time fields...)

Regards,

Raymond

Read only

Former Member
0 Likes
673

If you are using smartform/sap script then you will need to use conversion exits for date for the comparison to work. The format will depend on your profile in transaction SU3.

CONVERT_DATE_TO_EXTERNAL

CONVERT_DATE_TO_INTERNAL

Regards,

Shravan

Read only

venkateswaran_k
Active Contributor
0 Likes
673

Hi

Try using following statements in the Script.

 

/: SET DATE MASK = 'DD.MMMM.YYYY'

/: SET COUNTRY 'USA'

Regards,

Venkat