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 STAMP

Former Member
0 Likes
1,300

Program:

CONVERT TIME STAMP gs_test-timestamp_from

TIME ZONE 'UTC'

INTO DATE gv_price_date TIME gv_price_time.

Wrong message:

The line type of "GS_TEST-TIMESTAMP_FROM" must be compatible

Anybody how knows what I should do?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,268

hi,

gs_test-timestamp_from must be type timestamp

look at this example

DATA:

tstamp type timestamp,

d TYPE D VALUE '19971224',

t TYPE T VALUE '235500'.

SET COUNTRY 'US'.

CONVERT DATE d TIME t INTO

TIME STAMP tstamp TIME ZONE 'UTC+12'.

" tstamp : 19971224115500

" (12/24/1997 11:55:00)

CONVERT TIME STAMP tstamp TIME ZONE 'UTC+12' INTO

DATE d TIME t.

cheers,

sasi

Program:

CONVERT TIME STAMP gs_test-timestamp_from

TIME ZONE 'UTC'

INTO DATE gv_price_date TIME gv_price_time.

Wrong message:

The line type of "GS_TEST-TIMESTAMP_FROM" must be compatible

Anybody how knows what I should do?

2 REPLIES 2
Read only

Former Member
0 Likes
1,269

hi,

gs_test-timestamp_from must be type timestamp

look at this example

DATA:

tstamp type timestamp,

d TYPE D VALUE '19971224',

t TYPE T VALUE '235500'.

SET COUNTRY 'US'.

CONVERT DATE d TIME t INTO

TIME STAMP tstamp TIME ZONE 'UTC+12'.

" tstamp : 19971224115500

" (12/24/1997 11:55:00)

CONVERT TIME STAMP tstamp TIME ZONE 'UTC+12' INTO

DATE d TIME t.

cheers,

sasi

Read only

Former Member
0 Likes
1,268

I got this from help:

CONVERT - Converting Timestamps

CONVERT - Converting Timestamps

              Variants:
              1. CONVERT TIME STAMP tst TIME ZONE tz INTO DATE d TIME t.
              2. CONVERT DATE d TIME t INTO TIME STAMP tst TIME ZONE tz.

Effect        Converts the timestamp tst into date d or time t based on the
              time zone tz.

              tst must have the type P(8) (short form) or P(11) with 7
              decimal places (long form). tz must have the type C(6). The
              ABAP Dictionary contains the data elements TIMESTAMP,
              TIMESTAMPL, and TIMEZONE, which you can use in DATA ... TYPE
              ... statements to declare tst and tz. There are no strict type
              checks for the date d or time t. If you specify a variable
              that does not have type T, the system uses the type conversion
              rules applied in the MOVE statement.

As mentioned above, the data type of GS_TEST-TIMESTAMP_FROM should be p.

Sudha