cancel
Showing results for 
Search instead for 
Did you mean: 

Help for ABAP routine in Infopackage

Former Member
0 Kudos

Hello guys,

I need your help regarding a routine for an Infopackage.

Infopackage is based on a data source which is an oracle data base and it contains a field "DTIMECRE" which is a time stamp like the folling:

"2015-02-20 10:02:33"

What I want is to load the data of the last three days from "sy-datum" and this based on the timestamp above.

How can I do this using a rountine in infopackage? Please bear in mind that I do not have the chance to change data source in source system.

You would really help. Dont worry about points.

Regards

Jesper

Accepted Solutions (1)

Accepted Solutions (1)

Loed
Active Contributor
0 Kudos

Hi,

This will be your routine in infopackage:

data: l_idx like sy-tabix,
       temp_start(19) type c,
       temp_end(19) type c,
       temp_date type sy-datum.

read table l_t_range with key
      fieldname = 'DTIMECRE'.
l_idx = sy-tabix.
*....

   temp_date = sy-datum - 3.
  
   CONCATENATE temp_date(4) '-' temp_date+4(2) '-' temp_date+6(2) ' 00:00:00' into temp_start.
   CONCATENATE sy-datum(4) '-' sy-datum+4(2) '-' sy-datum+6(2) ' 23:59:59' into temp_end.

   l_t_range-sign = 'I'.
   l_t_range-option = 'BT'.
   l_t_range-low = temp_start.
   l_t_range-high = temp_end.

modify l_t_range index l_idx.

p_subrc = 0.

If you run it now, it will fetch the dates from August 21 - August 24..

Regards,

Loed

Former Member
0 Kudos

Kudos! Works like a charm!

Former Member
0 Kudos

Hey Loed,

sorry, I forgot to mark your answer as correct. It works fine. Thx a lot!

Regards

Jesper

Loed
Active Contributor
0 Kudos

Hi Jesper,

Good to know that the solution worked for you..

, thanks..

Regards,

Loed

Answers (1)

Answers (1)

sander_vanwilligen
Active Contributor
0 Kudos

Hi Jesper,

Writing an ABAP routine won't be so difficult if you know what is the internal format of the field. As comparison you can have a look at Characteristic 0TCTTIMSTMP. Internal format is NUMC14 and external format NUMC30. Conversion routine TIMES is used to convert from internal format to external format and vice versa.

To be sure re. the internal format you can create an ABAP routine and write the statement BREAK-POINT here. Then if you execute the InfoPackage (in dialog), you can check the internal format during debugging.

Please try it and give us information on the technical properties and value you found during debugging.

Best regards,

Sander