‎2007 May 11 3:52 AM
Hi friends,
My date field format is '20070418'.
I need to declare my date field in this format '18042007'can any one tell me how to declare it.
Regards,
Line
‎2007 May 11 5:04 AM
Hi ,
DATA : date(10) VALUE '00/00/0000'.
PERFORM date_conv USING itdate CHANGING date.
FORM date_conv USING date CHANGING date1.
MOVE date0(4) TO date16(4).
MOVE date4(2) TO date13(2).
MOVE date6(2) TO date10(2).
ENDFORM.
You can remove the speartors / if you dont want.
Regards,
Irfan
Note: Reward useful answers.
‎2007 May 11 3:59 AM
hi Line,
you can use the function CONVERSION_EXIT_PDATE_OUTPUT to convert the date from YYYYMMDD to DDMMYYYY.
Tell me if you need and example,
Regards,
Roxana
‎2007 May 11 4:35 AM
Hi,
You can use concatenate to get it in the format..
DATA: V_INPUT TYPE SYDATUM.
DATA: V_OUTPUT(8).
V_INPUT = SY-DATUM.
CONCATENATE V_INPUT6(2) V_INPUT4(2) V_INPUT(4) INTO V_OUTPUT.
WRITE: / v_output.
Thanks,
Naren
‎2007 May 11 4:40 AM
hi
good
try with this function module
RP_CALC_DATE_IN_INTERVAL Add/subtract years/months/days from a date
otherwise store the current date value into a character string and than change the format and store in another character string and print that new character string.
thanks
mrutyun^
‎2007 May 11 5:04 AM
Hi ,
DATA : date(10) VALUE '00/00/0000'.
PERFORM date_conv USING itdate CHANGING date.
FORM date_conv USING date CHANGING date1.
MOVE date0(4) TO date16(4).
MOVE date4(2) TO date13(2).
MOVE date6(2) TO date10(2).
ENDFORM.
You can remove the speartors / if you dont want.
Regards,
Irfan
Note: Reward useful answers.
‎2007 May 11 5:28 AM
In this code you can interchange the location of the year,day and month fields as required.
DATA: date LIKE sy-datum,
changedate(10) TYPE c.
DATA: BEGIN OF it_date1, " To accept date into a internal table
yyyy(4),
mm(2),
dd(2),
END OF it_date1.
DATA: BEGIN OF it_date2, " Internal table for dd/mm/yyyy format
dd(2),
mm(2),
yyyy(4),
END OF it_date2.
DATA: BEGIN OF it_date3, " Internal table for mm/dd/yyyy format
mm(2),
dd(2),
yyyy(4),
END OF it_date3.
date = sy-datum.
it_date1 = date.
MOVE-CORRESPONDING it_date1 TO: it_date2,it_date3.
WRITE it_date2 TO changedate USING EDIT MASK '__/__/____'. " dd/mm/yyyy
WRITE:/ 'Date in dd/mm/yyyy format',
/ changedate.
SKIP.
CLEAR changedate.
WRITE it_date3 TO changedate USING EDIT MASK '__/__/____'. " mm/dd/yyyy
WRITE:/ 'Date in mm/dd/yyyy format',
/ changedate.
Reward if useful