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

selection screen - requirement

Former Member
0 Likes
780

Hello all,

I have a report with a date range at the selection screen.


select-options:  s_date    for   afko-gltrp obligatory.

I want to do something like this. At the selection screen when I pick any start date for s_date-low I should get the date 4 weeks from s_date-low into s_date-high. For example if I select 02/01/2007 for s_date-low, I should get 02/28/2007 into s_date-high.

Any ideas please................

5 REPLIES 5
Read only

amit_khare
Active Contributor
0 Likes
737

Hi,

Try out with writing the code in AT SELECTION-SCREEN OUTPUT.

Check this link for usage -

Regards,

Amit

Reward all helpful replies.

Read only

Former Member
0 Likes
737

In the AT SELECTION-SCREEN event,

write the below code:

loop at s_date.

s_date-high = s_date-low + 28.

modify s_date.

endloop.

Thus after entering the low value if you press enter, the respective high value will appear in the output.

Thanks

Read only

Former Member
0 Likes
737

Hi Raju

You can try this way:

SELECT-OPTIONS S_DATE FOR SY-DATUM MODIF ID ABC.

DATA: DUR TYPE PSEN_DURATION_DEC.

AT SELECTION-SCREEN OUTPUT.

  IF NOT S_DATE-LOW IS INITIAL.
     DUR-CALDD = 28.
     CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
       EXPORTING
         ID_DATE                        = S_DATE-LOW
         ID_OPERATOR                    = '+'
         IS_DURATION                    = DUR
      IMPORTING
        ED_DATE                        = S_DATE-HIGH
      EXCEPTIONS
        CONVERSION_NOT_SPECIFIED       = 1
        CONVERSION_NOT_POSSIBLE        = 2
        OTHERS                         = 3.
     MODIFY S_DATE INDEX 1.
  ENDIF.

Kind Regards

Eswar

Read only

Former Member
0 Likes
737

Hi Raju,

press f4 for date-low and then press enter or execute.

selection-screen begin of block b1.

select-options: s_date for sy-datum.

selection-screen end of block b1.

at selection-screen on value-request for s_date-low.

*

CALL FUNCTION 'F4_DATE'

  • EXPORTING

  • DATE_FOR_FIRST_MONTH = SY-DATUM

  • DISPLAY = ' '

  • FACTORY_CALENDAR_ID = ' '

  • GREGORIAN_CALENDAR_FLAG = ' '

  • HOLIDAY_CALENDAR_ID = ' '

  • PROGNAME_FOR_FIRST_MONTH = ' '

IMPORTING

SELECT_DATE = s_DATE-low

  • SELECT_WEEK = SELECT_WEEK

  • SELECT_WEEK_BEGIN = SELECT_WEEK_BEGIN

  • SELECT_WEEK_END = SELECT_WEEK_END

EXCEPTIONS

CALENDAR_BUFFER_NOT_LOADABLE = 1

DATE_AFTER_RANGE = 2

DATE_BEFORE_RANGE = 3

DATE_INVALID = 4

FACTORY_CALENDAR_NOT_FOUND = 5

HOLIDAY_CALENDAR_NOT_FOUND = 6

PARAMETER_CONFLICT = 7

OTHERS = 8

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION 'CALCULATE_DATE'

EXPORTING

DAYS = '28'

  • MONTHS = '0'

START_DATE = s_date-low

IMPORTING

RESULT_DATE = s_date-high .

reward if helpful,

keerthi

Read only

Former Member
0 Likes
737

Raju,

IF you select the date ,no event will get fire.so your logic never works.What i mean is whenever you select the date into "low " based on your date "high" date has to calculate.for that one event has to get trigger.But here no event will get trigger.So change your requiremnet.