Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Date issue when downloading ....

Former Member
0 Likes
3,900

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....

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,980

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!!

17 REPLIES 17
Read only

Former Member
0 Likes
1,980

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

Read only

Former Member
0 Likes
1,981

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!!

Read only

0 Likes
1,980

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

Read only

0 Likes
1,980

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

Read only

0 Likes
1,980

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

Read only

0 Likes
1,980

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

Read only

0 Likes
1,980

Client has Agreed to put ' so vikred has going to get full marks

and rest are too rewarded thanks all

Regards

sas

Read only

Former Member
0 Likes
1,980

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

Read only

Former Member
0 Likes
1,981

Well then, change the date format in excel sheet.

right click, format cells, date and then the format you want..

Sumit.

Read only

Former Member
0 Likes
1,981

hi,

do changes only in exel ie., the cell format to your requirement.

~linganna

Read only

Former Member
0 Likes
1,981

In the function module 'gui_download'

we have a option for WRITE_FIELD_SEPARATOR

i think this should work

Read only

0 Likes
1,981

HUMMM nothing is working out any other inputs Please:(

Sas....

Read only

0 Likes
1,981

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

Read only

0 Likes
1,981

Hy Dude nice idea but Condense is not working whyyyyy any idea

Please it is not able to delete spaces no idea why

Sas

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,981

Hello,

Try: CONDENSE v_date NO-GAPS .

BR,

Suhas

Read only

0 Likes
1,981

Thanks just about to post

Regards

sas

Read only

0 Likes
1,981

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