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

Export data to speardsheet with date format

Former Member
0 Likes
941

HI ALL,

I export data from SAP (standard report) to spreadsheet (excel 2007). and in the posting date column appears number. i have to change the format used to date manually first, so that the number changed to date.

is there a way so that it can be done automatically ? i mean when i export data the column posting date contains date not number.

Thanks & best regards,

Saiful arif

4 REPLIES 4
Read only

former_member925838
Participant
0 Likes
692

Hi Arif,

How are you passing data from SAP to spreadsheet?

which FM?

Read only

Former Member
0 Likes
692

change the date column to a string column.. and then download

Read only

koolspy_ultimate
Active Contributor
0 Likes
692

Hi declare a variable type string in your final internal table.

now concatenate the date field into that string variable in your final loop and pass this value.

So that you will get your desired output.


" in you final internal tab
types: begin of itab,
           .
           .
          date  type string.
           end of itab.


loop at itab.
concatenate itab-budat+6(2)  '/' itab-budat+4(2) '/' itab-budat+0(4) into date.
" now use this date field to your gui_download 
endloop.

regards,

koolspy.

Read only

Former Member
0 Likes
692

Hi,

convert the posting date to date format first and then append it to the final internal table which can be sent to excel sheet.

try like this....

data: lv_date type string.

constants: lc_slash type c value '/'.

lv_date = posting date...(assign posting date here)

CONCATENATE lv_date+4(2)

lc_slash lv_date+6(2)

lc_slash lv_date+0(4)

INTO lv_date.

gs_final-date = lv_date.

append gs_final to gt_final.

hope this will help.

Regards

Karuna