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

regarding selection screen

Former Member
0 Likes
638

Hi

I got to write simple code for the selection screen , thing is i got from date as 14-01-2009 and to date as 22-01-2009 . I would like to subtract a week from the to value of selection screen.

this is related to BW. I am giving selection on BEDAT of EKKO that is DOC.DATE

&----


*& Include RSBC_SEL_ROUTINE_TPL

&----


program conversion_routine.

  • Type pools used by conversion program

type-pools: rsarc, rsarr, rssm.

tables: rssdlrange.

  • 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 -

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

  • Fieldname =

  • data type =

  • length = 000000

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

form compute_

tables l_t_range structure rssdlrange

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.

read table l_t_range with key

fieldname = 'bedat'.

l_idx = sy-tabix.

*....

if l_idx <> 0.

modify l_t_range index l_idx.

else.

append l_t_range.

endif.

p_subrc = 0.

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

endform.

Thanks in Advance

4 REPLIES 4
Read only

former_member156446
Active Contributor
0 Likes
604

Check this code:

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
    EXPORTING
      date      = sy-datum       "input date
      days      = '7'                 " seven days
      months    = '00'
      signum    = '-'                "subract from Input date
      years     = '00'
    IMPORTING
      calc_date = lv_default_date."output date

Read only

Former Member
0 Likes
604

Hi,

Simply subtract 7 days from the date.

Data p_date type sy-datum default '20080108'.

p_date = p_date - 7.

Now p_date will have '20080101'.

Read only

0 Likes
604

Hi Avinash

Thanks for ur answer , but i am working on selection screen named x for instance where I got two values one is from value and other is to value , in my program i want to take to value and need to change that every time and to value must become the from value in next data load.

Read only

0 Likes
604

Hi,

can you please explain when these upload takes place periodically or continuously.please explain the date concept with example.