Skip to Content
0
Former Member
Apr 20, 2005 at 06:38 PM

Two separate formats from source file

17 Views

Hello Rishi/friends,

I have a similar problem. I get time formats from my source file in the form of -

hh:mm

h:mm

So now I need to convert into SAP standard form hh:mm:ss

Is this code right or do I need to make any corrections or changes?

DATA: seconds(2) TYPE n.

DATA: minutes(2) TYPE n.

DATA: hours(2) TYPE n.

SPLIT TRAN_STRUCTURE-/BIC/ZSGYINCTM AT ':' INTO hours minutes seconds.

IF hours LT 8.

CONCATENATE '0' hours INTO hours.

ENDIF.

IF seconds LT 8.

CONCATENATE '00' seconds INTO seconds.

ENDIF.

CONCATENATE hours minutes seconds INTO result.

Thanks,

But the problem is I do not have any colons after minutes. So how does it apply?