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

regarding time conversion

Former Member
0 Likes
583

Hi All,

Iam using bdc to upload data. I have got a time field which would accept only hh:mm. Iam not using any text file to upload the data. All the data is transferred from VL02N. Now the date format here is hhmmss. Can anyone help me to either change this value to the required format or any other suggestions would be of gr8 help

thanks

skk

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
558

Assign a variable for time

and use the logic as

data : hr(2) type c value '10',
       mm(2) type c value '45',
       ss(2) type c value '00',
       val type sy-uzeit.
       concatenate hr mm ss into val .

       write:/ val.

submit the val to the time portion of ur Vl02n (o/b devlivery change trnxn )

See eventhough u have hh:mm in ur flat file declare a vareiable val type sy-uziet and ss a variable for seconds default it to '00' and pass the content of hhmmss into val this will take the value in hhmmss format into the Db

try this.

regards,

vijay

4 REPLIES 4
Read only

Former Member
0 Likes
558

data : hr(2),

min(2),

tim(5).

hr = VL02N-<fieldname>(2).

min = VL02N-<fieldname>+2(2).

concatenate hr min into tim separated by ':'.

now tim contains the value.

regards

shiba dutta

Read only

Former Member
0 Likes
558

take two var hh and mm

hh = time+0(2).

mm = time+2(2).

concatenate the values and assign to time

Read only

Former Member
0 Likes
559

Assign a variable for time

and use the logic as

data : hr(2) type c value '10',
       mm(2) type c value '45',
       ss(2) type c value '00',
       val type sy-uzeit.
       concatenate hr mm ss into val .

       write:/ val.

submit the val to the time portion of ur Vl02n (o/b devlivery change trnxn )

See eventhough u have hh:mm in ur flat file declare a vareiable val type sy-uziet and ss a variable for seconds default it to '00' and pass the content of hhmmss into val this will take the value in hhmmss format into the Db

try this.

regards,

vijay

Read only

Former Member
0 Likes
558

Before giving the value of this date field to a screeen filed in BDC program ( I mean before the perform ) U copy the date into a variable of 5 characters...

data w_time(5) type c.

before that perform ...( assuming vlo2n-time is of 6 characters )

use

w_time(2) = vlo2n-time(2).

w_time+2(1) = ':'.

w_time3(2) = vlo2n-time2(2).

perform field_fill using 'Screen no.' w_time.

reward if it helps u...

sai ramesh