Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3273

Flat file issue: Incorrect time format issue in the columns.

$
0
0

Hi Everyone,

 

We receive flat file on a daily basis and this gets placed on the application server. the file has 2 columns call duration and call time that have time details.However, the time in the csv file is in the HH:MM in one column and h:mm:ss in the other. I tried to change the format using routine at the infopackage level.

 

The ABAP routine i wrote in the info package is not working correctly.Could you please help me with this.

 

Below is the code:

form compute_CALL_DURATION

   tables   l_t_range      structure rssdlrange

   using    p_infopackage  type rslogdpid

            p_fieldname    type rsfnm

   changing p_subrc        like sy-subrc.

*       Insert source code to current selection field

*$*$ begin of routine - insert your code only below this line        *-*

data: l_idx like sy-tabix.

 

 

 

   Data : lv_data type c LENGTH 8,

        lv_len  type n,

        lv_time type t.

BREAK-POINT.

read table l_t_range with key

      fieldname = 'CALL_DURATION'.

l_idx = sy-tabix.

 

 

lv_len = STRLEN( LV_DATA ).

case lv_len.

   when 0.

*----------Dont do any thing Lv_time ...will have 000000 by default.

   when 4.

     concatenate lv_data '00' into lv_time.

   when 6.

     lv_time = lv_data.

   when 5.

*--------that is hh:mm

     concatenate lv_data+0(2) lv_data+3(2) '00' into lv_time.

     when 7.

     concatenate '0' lv_data+0(1) lv_data+2(2) lv_data+5(2) into lv_time

     .

endcase.

l_t_range-low = lv_time.

l_t_range-option = 'EQ'.

l_t_range-sign = 'I'.

modify l_t_range index l_idx.

 

p_subrc = 0.

 

 

*$*$ end of routine - insert your code only before this line         *-*

endform.               


Viewing all articles
Browse latest Browse all 3273

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>