Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8794715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:17:22+00:00 2026-06-13T23:17:22+00:00

I am working on a DTP filter routine for a timestamp field in the

  • 0

I am working on a DTP filter routine for a timestamp field in the format of YYYYMMDDhhmmss. I am trying to declare the range as ({timestamp 3 months ago} to {current timestamp}). I am very new to ABAP and basically have the code set up right now so it doesn’t have any syntax errors. I am currently having trouble getting the correct timestamp to be filled when I assign it to “l_ts”.

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


DATA: l_idx LIKE sy-tabix,
        l_ts TYPE rstimestmp,
        l_ts2 TYPE rstimestmp.


  READ TABLE l_t_range WITH KEY
   fieldname = 'TIMESTAMP'.
   l_idx = sy-tabix.

* Capture the Current Date
  l_ts = sy-datlo + sy-timlo.
  l_ts2 = ( sy-datlo + sy-timlo ) - 93.

  IF l_idx <> 0.

* fill the Selection table.
    l_t_range-low = l_ts.
    l_t_range-sign = 'I'.
    l_t_range-option = 'BT'.
    l_t_range-high = l_ts2.

    MODIFY l_t_range INDEX l_idx.
 ELSE.
* fill the Selection table.
    l_t_range-fieldname = 'TIMESTAMP'.
    l_t_range-low = l_ts.
    l_t_range-high = l_ts2.
    l_t_range-sign = 'I'.
    l_t_range-option = 'BT'.


    APPEND l_t_range.
  ENDIF.

  p_subrc = 0.


*$*$ end of routine - insert your code only before this line         *-* 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:17:22+00:00Added an answer on June 13, 2026 at 11:17 pm

    You’re mixing up timestamps and discrete date and time calculations – won’t work this way. What you’ll really want is probably something like this:

      DATA: l_date TYPE d,
            l_time TYPE t,
            l_ts   TYPE rstimestmp.
    
      FIELD-SYMBOLS: <ls_param> LIKE LINE OF l_t_range.
    
    * ensure that the parameter exists
      READ TABLE l_t_range ASSIGNING <ls_param> WITH KEY fieldname = 'TIMESTAMP'.
      IF sy-subrc <> 0.
        APPEND INITIAL LINE TO l_t_range ASSIGNING <ls_param>.
        <ls_param>-fieldname = 'TIMESTAMP'.
      ENDIF.
    
      <ls_param>-sign = 'I'.
      <ls_param>-option = 'BT'.
    
    * "from" date = three months ago, more or less - probably the start of the day?
      l_date = sy-datlo - 93.
      l_time = '000000'. " or sy-timlo.
      CONVERT DATE l_date TIME l_time INTO TIME STAMP l_ts TIME ZONE sy-zonlo. 
      <ls_param>-low = l_ts.
    
    * "to" date = today - probably the end of the day?
      l_date = sy-datlo.
      l_time = '235959'. " or sy-timlo.
      CONVERT DATE l_date TIME l_time INTO TIME STAMP l_ts TIME ZONE sy-zonlo. 
      <ls_param>-high = l_ts.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working on a project using Entity Framework (4.3.1.0). I'm trying to figure out how
Working with a Lucene index, I have a standard document format that looks something
Working on calling a C function from my asm project. I'm trying to push
Working with the Box2djs plugin here: http://www.crackin.com/dev/mms/physics/ ... and all I'm trying to do
Working with JodaTime, trying to convert a List[LocalDate] to Tuple2[JodaTime, JodaTime] so I can
Working on a small game using an HTML5 canvas, and javascript. And it's working
Working with an undisclosed API, I found a function that can set the number
Working with Reporting Services 2008 r2. So here's my issue: We have 5 reports
Working with H2 I get this error when I try to write a row
Working on the problems on Project Euler to try to learn Clojure. I'm on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.