cancel
Showing results for 
Search instead for 
Did you mean: 

Script required to access Display Pattern Property of Date Field.

Former Member
0 Kudos

hi all,

I want to change the display pattern property for date field.

How can i write a script to achieve this ?

Accepted Solutions (1)

Accepted Solutions (1)

Kanagaraja_L
Active Contributor
0 Kudos

You can put your own DATE format under OBJECT -> FIELD (EDIT PATTERN here you have to mention your date format) then assign BINDING -> Data pattern

or

Define with new CHAR field for the DATE field then concatenate (Which type you want MM/DD/YY .....) and send to Form.

Kanagaraja L

Edited by: Kanagaraja Lokanathan on Sep 1, 2009 2:22 PM

Edited by: Kanagaraja Lokanathan on Sep 1, 2009 3:02 PM

Former Member
0 Kudos

Hi ,

Can you elaborate on this " Define with new CHAR field for the DATE field then concatenate (Which type you want MM/DD/YY .....) and send to Form.

Actually i need to determine the user settings for Date format from SU3. That is done in Code initialisation.

Now problem is to have the same format in Date. How to bind the date field ?

Kanagaraja_L
Active Contributor
0 Kudos
data:lv_date type string.

CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
 EXPORTING
   DATE_INTERNAL                  = SY-DATUM
 IMPORTING
   DATE_EXTERNAL                  = lv_date   -> same as in SU3
 EXCEPTIONS
   DATE_INTERNAL_IS_INVALID       = 1
   OTHERS                         = 2
          .
IF sy-subrc <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
 else.
* Declare LV_FIELD in Global data type string
* and Bind the same to Form Layout
  Lv_fdate =  lv_date.         -> Declare and Bind LV_FDATE in the Form layout and interface level
ENDIF.

Kanagaraja L

Former Member
0 Kudos

Thanks alot.

It worked.

Answers (0)