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 problem

Former Member
0 Likes
729

dear experts,

when i download my report in excel sheet and application server the date is displaying like 20051021 . I need to display like 21.10.2005.

I declared like zfurcostdte(10) in the internal table after i changed like zfr0023x-zfurcostdte. even though i am getting the same result,

pls give the solution for this,

thanks in advance

karthik

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
702

Hi,

Try this..

DATA: V_INPUT TYPE SYDATUM.

DATA: V_OUTPUT(10).

V_INPUT = SY-DATUM.

CONCATENATE V_INPUT6(2) V_INPUT4(2) V_INPUT(4) INTO V_OUTPUT

SEPARATED BY '.'.

WRITE: / V_OUTPUT.

Thanks,

Naren

5 REPLIES 5
Read only

Former Member
0 Likes
703

Hi,

Try this..

DATA: V_INPUT TYPE SYDATUM.

DATA: V_OUTPUT(10).

V_INPUT = SY-DATUM.

CONCATENATE V_INPUT6(2) V_INPUT4(2) V_INPUT(4) INTO V_OUTPUT

SEPARATED BY '.'.

WRITE: / V_OUTPUT.

Thanks,

Naren

Read only

Former Member
0 Likes
702

Hello ,

Use this method .

The DateFormat maps as follows:-

DateFormat = 0 -> DD/MM/YY

DateFormat = 1 -> DD/MM/YYYY

DateFormat = 2 -> MM/DD/YY

DateFormat = 3 -> MM/DD/YYYY

DateFormat = 4 -> YYYY/MM/DD

Below is a sample that identifies the date seperator, it would be easy to also include the date format.

'Identify the current date seperator character

Set sboRecordset = sboCompany.GetBusinessObject(BoRecordset)

strQuery = "SELECT datesep from oadm where currperiod = (select max(currperiod) from oadm)"

sboRecordset.DoQuery strQuery

sboRecordset.MoveFirst

mstrDateSeperator = sboRecordset.Fields(0).value

Hope this helps.

reward if it helps.

Regards,

Deepu.K

Read only

suresh_datti
Active Contributor
0 Likes
702

use concatenate like in the sample below..

data: w_str(10).    
w_str = sy-datum.
concatenate w_str+6(2) w_str+4(2) w_str+0(4) into w_str
        separated by '.'.
write: / w_str.

~Suresh

Read only

RaymondGiuseppi
Active Contributor
0 Likes
702

Look at OSS <a href="https://service.sap.com/sap/support/notes/358644">Note 358644 - ALV Export Excel: Recommendations and known errors</a> and OSS <a href="https://service.sap.com/sap/support/notes/316814">Note 316814 - ALV Export Excel: Switching date in ALV with Excel download</a>

Regards

Read only

Former Member
0 Likes
702

hi,

when u write out dae try to write as

<b>write:/ date edit mask '..----'. </b>

pls check the synax for editmask....

reward if useful

ravi