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

System date

Former Member
0 Likes
902

Hi All, I need to introduce two lines of ABAP code to do this:

  • p_datefrom less than or equal to systemdate

  • p_dateto greater than or equal to systemdate

What's the code that I should use? Is the variable name for systemdate also called systemdate in ABAP?

Thanks!

Regards,

Pat

6 REPLIES 6
Read only

gopi_narendra
Active Contributor
0 Likes
838

p_datefrom <b>le</b> sy-datum.

p_dateto <b>ge</b> sy-datum.

system date in ABAP is <b>sy-datum</b>

is this what u r looking for?

Regards

- Gopi

Read only

0 Likes
838

Hi Gopi,

Thanks for your reply. Yes that's what I was asking for. I tried to introduce your code into the routine, but keep getting complaints that the syntax check produced errors in the form routine.

The full code is below. Can you see what's wrong? Thanks!

program conversion_routine.

  • Type pools used by conversion program

type-pools: rsarc, rsarr, rssm.

tables: rsldpsel.

  • Global code used by conversion rules

$$ begin of global - insert your declaration only below this line -

  • TABLES: ...

  • DATA: ...

$$ end of global - insert your declaration only before this line -

  • -------------------------------------------------------------------

form compute_time_dependent_dates

using p_infopackage type rslogdpid

changing p_datefrom type d

p_dateto type d

p_subrc like sy-subrc.

  • Insert source code to current selection field

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

p_datefrom le sy-datum.

p_dateto ge sy-datum.

*....

p_subrc = 0.

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

endform.

Read only

0 Likes
838

Hi KMT,

The statements which i gave u are logical expressions whihc shud be used with IF Statement.

if p_datefrom LE sy-datum.

  • write ur code

write : 'From Date is Less than System Date'.

endif.

if p_dateto GE sy-datum.

  • write ur code

write : 'To Date is Greater than System Date'.

endif.

Regards

- Gopi

Read only

0 Likes
838

Hi Gopi,

I don't really need a logical statement, this routine is used in BW infopackage to extract data based on certain rules, and the rules I want is as follows:

p_datefrom less than or equal to systemdate

p_dateto greater than or equal to systemdate

Perhaps I should try the BW forum and see?

Regards,

KM

Read only

0 Likes
838

Yes, posting in BW forum might help u.

Regards

- Gopi

Read only

0 Likes
838

try:

check p_datefrom <= sy-datum.

check p_dateto >= sy-datum.