‎2009 Aug 07 10:28 AM
My Requirement is to display date in Text format like
02-21-2009 in
March 21 , 2009
I have done it sucesfully through the FM CONVERSION_EXIT_LDATE_OUTPUT
which it is sucesfully displaying as March 21 , 2009 but issue coming while downloading !!
I am using GUI_DOWNLOAD
where in the excel it is displaying l as 21-Mar-09
Please can any one help me to solve this
Regards
sas....
‎2009 Aug 07 10:36 AM
Hi SAS,
You can try copying the output date (ie. 21-March-09) into a character type variable instead of a date type variable.
You can then correspondingly modify your table used in the GUI_DOWNLOAD FM by replacing the date type field with a character type field. So when you download into your Excel file, the text "21-March-09" will be interpreted as a character type varibale.
Hope this helps! If you want a sample code for doing this, please revert back!!
Cheers,
Shailesh.
Always provide feedback for helpful answers!!
‎2009 Aug 07 10:36 AM
Hi,
I suppose it has nothing to do in the coding. In order to get the format as March 21 , 2009, change the excel setting by choosing format cell option and under date category choose the format you require.
Regards,
Vik
‎2009 Aug 07 10:36 AM
Hi SAS,
You can try copying the output date (ie. 21-March-09) into a character type variable instead of a date type variable.
You can then correspondingly modify your table used in the GUI_DOWNLOAD FM by replacing the date type field with a character type field. So when you download into your Excel file, the text "21-March-09" will be interpreted as a character type varibale.
Hope this helps! If you want a sample code for doing this, please revert back!!
Cheers,
Shailesh.
Always provide feedback for helpful answers!!
‎2009 Aug 07 10:43 AM
i have taken in character only i
declared as DATA : t_dATE(20) TYPE C.
THEN USING THE FM,
CALL FM 'CONVERSION_EXIT_lDATE_OUTPUT'.
EXPORT
DATE = SY-DATUM.
IMPORT
DATE = T_dATE
now this date is exactly of our requirement inside sap output " August 7, 2009'
Now after using GUI_DOWNLOAD in the excel it is showing as 7-aug-09
Sas
‎2009 Aug 07 10:49 AM
Hi,
Well if u dont want to change any settings in excel, you can display exactly what u have in the internal table by appending a ( ' ) mark to the field before calling the gui_download FM.
create a text element as ' (i,e) single quotation mark
declared as DATA : t_dATE(21) TYPE C.
CALL FM 'CONVERSION_EXIT_lDATE_OUTPUT'.
EXPORT
DATE = SY-DATUM.
IMPORT
DATE = T_dATE.
concatenate text-001 t_date into t_date.
Now pass the gui_download FM
Regards,
Vik
Edited by: vikred on Aug 7, 2009 3:20 PM
‎2009 Aug 07 10:53 AM
Thats true but can we do something which is not invinsible to the client ... i am suspecting that it may be used for 3rd party tools that which may cause a slight issue
Using space or increasing the space can we do any thing???
Sas
‎2009 Aug 07 10:59 AM
Hi,
Well am not sure if any other possible solution is available for this. If you change the excel settings, you dont have the need to even use 'CONVERSION_EXIT_lDATE_OUTPUT' . If you dont dont want to change excel settings for date then the only solution is to make excel interpret it as text by preceeding apostrphe.
Regards,
Vik
‎2009 Aug 07 4:50 PM
Client has Agreed to put ' so vikred has going to get full marks
and rest are too rewarded thanks all
Regards
sas
‎2009 Aug 07 10:39 AM
Hi,
there is nothing to do with coding.
you need to put options in the excell sheet.
In excell go to the date field , right click and goto format cell, then under category select date and proide the type you need.
regards,
nazeer
‎2009 Aug 07 10:53 AM
Well then, change the date format in excel sheet.
right click, format cells, date and then the format you want..
Sumit.
‎2009 Aug 07 11:16 AM
hi,
do changes only in exel ie., the cell format to your requirement.
~linganna
‎2009 Aug 07 11:18 AM
In the function module 'gui_download'
we have a option for WRITE_FIELD_SEPARATOR
i think this should work
‎2009 Aug 07 11:25 AM
HUMMM nothing is working out any other inputs Please:(
Sas....
‎2009 Aug 07 1:03 PM
Hi Sas,
you are using FM CONVERSION_EXIT_LDATE_OUTPUT.
the import parameter u r getting is in following format of Date " March 21 , 2009 ".
what u have to do is just pass this import parameter to a variable declared as String Or a variable declared as character of size 15.
Example-
***********************************************************************
Data : Dat type string. " OR
data : Dat1(50) type c.
CALL FUNCTION 'CONVERSION_EXIT_LDATE_OUTPUT'
EXPORTING
INPUT = Date1
IMPORTING
OUTPUT = Date2.
DAT = Date2. " or
Dat1 = Date2.
Condense DAT.
Condense Dat1.
*************************************************************************
Now both DAT and Dat1 would be downloaded as u require.
*************************************************************************
or
Declare Date2 directly as " data : Date2(50) type c "
and after u get the result condense the same i.e
Condense date2.
Regards,
Akash Rana
Edited by: AKASH RANA on Aug 7, 2009 2:04 PM
‎2009 Aug 07 1:24 PM
Hy Dude nice idea but Condense is not working whyyyyy any idea
Please it is not able to delete spaces no idea why
Sas
‎2009 Aug 07 1:27 PM
‎2009 Aug 07 1:28 PM
‎2009 Aug 07 2:47 PM
Hi SAS,
Condense will definitely work.
well u can also use
DATA: DATE1(15) TYPE C.
U CAN THEN ....
PASS THE DATE FORMAT RECEIVED FROM FUNCTION MODULE TO DATE1.
AS DATE1 IS WITH EXACT NUMBER OF LENGTH OF OUTPUT TYPE "7TH AUG 2009' I.E 15 U WONT REQUIRE THE SAME TO CONDENSE.
Regards,
Akash Rana