07-25-2007 10:08 AM
hi, i need to convert date format in screen field to be - MM/YY
and not dd.mm.yyyy.
07-26-2007 12:09 PM
Check the following code... It may help u...
parameters: w_date type d.
data: w_my(5) type c.
write w_date to w_my using edit mask '__/__'.
write:/ w_my.
Reward if helpful
Regards
Prax
07-25-2007 10:11 AM
Hi Mally,
use
concatenate sy-datum+4(2)
'/'
sy-datum+2(2)
into lv_date
Regards
Arun
07-25-2007 10:12 AM
07-25-2007 10:15 AM
use 'write to .......... with edit mask' statement.
don't forget to reward
Sameer
07-25-2007 10:29 AM
Hi,
u can check out this code.
data : yy(2) type c,
mm(2) type c.
data : c(8) type c.
parameters : p_date type sy-datum.
yy = p_date+2(2).
mm = p_date+4(2).
concatenate mm '/' yy into c.
write : / c.
Reward points if useful.
Thanks
Sudha
07-26-2007 11:42 AM
first, thank u all for your answers...
i realize now that i wasn't so clear about my question..
i have a control table in the screen - in that table there's a date field
i found the appropriate data element of type MM/YYYY
but when i try to insert a string composed of this format - i get a message error that this format is worng...
i think that i need to change , in the attributes of the date field , the format (corrent format - DATS' - i also tried 'CHAR' and 'ACCP')
or to insert a value or text in the date field ... maybe something like '____,MM/YYY'....???
07-26-2007 11:55 AM
Hi,
please follow this procedure..
Go to screen->layout.
Get for dictionary PTDW_QUOT_DB-Kmonth.
This field will work the way you want
Reward if useful
07-26-2007 11:45 AM
use this:
CALL FUNCTION '/BEV4/PLPS__ADD_MONTH_TO_DATE'
reward if useful
anju
07-26-2007 12:09 PM
Check the following code... It may help u...
parameters: w_date type d.
data: w_my(5) type c.
write w_date to w_my using edit mask '__/__'.
write:/ w_my.
Reward if helpful
Regards
Prax
07-29-2007 4:38 PM
thank u for all your answer..
i "solved" the problem by checking the content of the field my self
IF p_start CA '/' AND p_end CA '/'.
SPLIT p_start AT '/' INTO lv_start_month lv_start_year.
SPLIT p_end AT '/' INTO lv_end_month lv_end_year.
IF lv_start_month BETWEEN 1 AND 12
AND lv_end_month BETWEEN 1 AND 12.
IF STRLEN( lv_start_year ) <> 4
OR STRLEN( lv_end_year ) <> 4.
MESSAGE w031(zpm_notif) .
Format Date needs to be - MM/YYYY
ENDIF.