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

Time Format

Former Member
0 Likes
2,888

Hi everyone,

I'm creating a report in which i'm stuck and not able to solve it..Hope u guys will help me out.

Here is my issue..

I'm creating a new report for unused t-codes in which i have to download data from SM20 and store it in a database table which i have created.

The records are huge so need to store them in table.When i download the data the time column in it is being downloaded in the format "12.02.00 PM"

So when i try to upload the excel sheet it is not processing since the time format is not compatible.

I did search but couldn't find proper answer to it.

Can anyone help me how to solve it pls.I need to submit it today.

Thank You.

12 REPLIES 12
Read only

vinodkumar_thangavel
Participant
0 Likes
2,835

Hi,

U shall try to remove the PM by using 'REPLACE ALL OCCURRENCES OF' and upload the same in data base table.

Regards,

Vinodkumar.

Read only

0 Likes
2,835

Hi Vinod,

First of all thanks for replying.

Can u please elaborate it,because first step in my program itself is uploading the file.When am i supposed to use the statement to remove AM/PM from time format.

Read only

0 Likes
2,835

Hi,

Before uploading u shall change the format rit.

Regards,

Vinodkumar.

Read only

ipravir
Active Contributor
0 Likes
2,835

Hi,

try to make the formation as string in Excel, like 12:20:33 AM to 122030AM.

And then try to upload the data in internal table.

Take the CHAR8 data type for Time column, once you get the data in internal table, change the same as per your requirement.

Regards.

Praveer.

Read only

Former Member
0 Likes
2,835

Hi praveen,

that won't workout i guess.The data is very  huge.

Read only

ipravir
Active Contributor
0 Likes
2,835

Hi,

What wont workout?

or

Changing format of time in Excel or Uplodaing and changing again in SAP ends

For change the Format, take any excel expert help, in excel one option is there to 'REPLACE' method to replace the value based on the selected column.

Regards.

Praveer.

Read only

Former Member
0 Likes
2,835

@Praveen.

of course the idea abt replacing in excel works,but can't ask the users to replace whenever they download data in excel.

Read only

ipravir
Active Contributor
0 Likes
2,835

Hi,

You have excel with you, make a copy of that and follow the below step to format you excel sheet.

1. Open Excel.

2. Select the Time Column.

3. Select ->Replace Option.

4. Give Below screen input and select replace all.

5.the same way pass 'AM' and 'PM' to repalce with '' [SPACE].

input ;  12.13.25AM

output: 121325.

Hope you can understand the process.

Regards.

Praveer.

Read only

Former Member
0 Likes
2,835

@praveen.

The problem is not during uploading.Yes we can upload the excel sheet,but after storing in table it doesn't take time format but instead gives something like "0.4126".So what could be the format for uploading time with AM/PM.

Read only

ipravir
Active Contributor
0 Likes
2,835

Hi,

that's why, i ask you, before uploading change the format of the time.

In SAP time format is

In Excel, after format the time (The process already explained).

In program, internal table will store the data in same format.

Hope, you understand, how time is storing in SAP.

Regards.

Praveer.

Read only

Former Member
0 Likes
2,835

Hi praveer,

u are not understanding abt my requirement.

when i download data from SM20,it stores time with AM or PM in excel sheet (Ex:09:50:00 AM).

And when i debug and see its displaying time as 0.4197 instead of 09:50:00.

Hope u anderstand.

Read only

ipravir
Active Contributor
0 Likes
2,835

Hi,

Means, you are trying to upload the information from Excel.

Since SAP is not having the AM/PM format with Sy-uzite, so you have to change the Format of the data 1st in Excel and then you have to upload the same in SAP.

Regards.

Praveer.