2007 Apr 09 12:23 PM
Hi abap gurus,
I have an ALV report in which I want the output dates to have format DD-MMM-YYYY . The input date format is MM/DD/YYYY.
Its an Urgent requirement plz suggest me an solution
Best Regards,
Argz
2007 Apr 09 12:26 PM
use offsets to do this
supposet the variable is w_var
then
w_var + 12/31/9999
concatenate w_var3(2) '.' w_var(2) '.' w_var6(4) into w_var1.
Your var1 will have 31.12.9999
Pass var1 to your ALV
Regards,
Himanshu
Hi abap gurus,
I have an ALV report in which I want the output dates to have format DD-MMM-YYYY . The input date format is MM/DD/YYYY.
Its an Urgent requirement plz suggest me an solution
Best Regards,
Argz
2007 Apr 09 12:26 PM
use offsets to do this
supposet the variable is w_var
then
w_var + 12/31/9999
concatenate w_var3(2) '.' w_var(2) '.' w_var6(4) into w_var1.
Your var1 will have 31.12.9999
Pass var1 to your ALV
Regards,
Himanshu
2007 Apr 09 12:30 PM
Hi..,
use this function module to convert the date into DD.MMM.YYYY format..
<b>CONVERSION_EXIT_SDATE_OUTPUT.</b>
and take the output into a text variable of size 11 say w_date.
use this statement to get DD-MMM-YYYY format..
translate w_date using '.-'.
u will get the date in DD-MMM-YYYY format.. now send this to ALV function module..
reward all helpful answers..
regards,
sai ramesh
2007 Apr 09 12:31 PM
Hi,
You can use the EDIT MASK for this one.
Take a Date field. and move your date to this field, then use the edit mask
DATA: date type sy-datum.
Move: your_date-Field to DATE.
Write DATE to Your_alv_field USING EDIT MASK '__/__/____.
Regards
Sudheer
2007 Apr 09 12:33 PM
Hi raghvendra,
use this FM....<b>CONVERT_DATE_FORMAT</b>
<b>Reward points if this helps,</b>
Regards,
Tejas
2007 Apr 09 12:36 PM
Hi,
Try out the following logic.
Declare three variable as char2, char3 and char4 and one with char10.
Use the SPLIT command to split the date at the seperator used in the date format. In this case, it is '-'.
e.g SPLIT dd-mmm-yyyy AT '-' INTO char2 char3 char4.
After this use the concatenate command.
e.g. CONCATENATE char3 char2 char4 into char10 seperated by '/'.
I hope this will solve your query.
reward if useful.
2007 Apr 09 12:38 PM
Hi Raghavender,
select the date format in table usr01.
<b>CONVERT_DATE_TO_EXTERNAL </b>Converts date from system storage format to users specified display format
or second method wud be
DATA: V_INPUT(10) VALUE '09.04.2007'.
DATA: V_OUTPUT(10).
<b>CONCATENATE V_INPUT(2) '/' V_INPUT3(2) '/' V_INPUT6(4)
INTO V_OUTPUT.</b>
WRITE: / V_OUTPUT.
2007 Apr 09 12:40 PM
You can specify the edit_mask property for the fieldcatalogue of that date field as
fieldcat-edit_mask = '__-__-____'
Regards,
Ravi