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 Default Value

Former Member
0 Likes
1,296

Dear All,

I have two select options line so_1date and so_2date

when screen appear i want to display 1st day in running month like 01.01.2008 in the so_1date

and last day in running month like 31.01.2008 in the so_2date screen field

i can get these values to the veriable

i want to assign these to screen fields please help me to solve this matter.

Thanks in Advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,000

Hi,

use this function module HR_JP_MONTH_BEGIN_END_DATE

to get the start date and end date of the month.

input is the current date ie sy-datum

CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'

EXPORTING

iv_date = sy-datum

IMPORTING

ev_month_begin_date = lv_date2.

regards

Santosh Thorat.

8 REPLIES 8
Read only

Former Member
0 Likes
1,001

Hi,

use this function module HR_JP_MONTH_BEGIN_END_DATE

to get the start date and end date of the month.

input is the current date ie sy-datum

CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'

EXPORTING

iv_date = sy-datum

IMPORTING

ev_month_begin_date = lv_date2.

regards

Santosh Thorat.

Read only

0 Likes
1,000

Thanks Santosh

but i want how can i assigning values to screen fields.

Read only

0 Likes
1,000

Hi Nelson,

U Can use initialization event.

for eg

select-options : s_audat for vbak-audat.

initialization.

call the function module.

and then.

s_audat-low = lv_date1.

s_audat-high = lv_date2.

s_audat-sign = 'I'.

s_audat-option = 'BT'.

append s_audat.

regards,

Santosh Thorat

Read only

0 Likes
1,000

Thanks Santosh

I got solved

h1.

Thank you very much!

Read only

Former Member
0 Likes
1,000

Hi,

First get the first day of the period by using FIRST_DAY_IN_PERIOD_GET. Then get last month of the month by using LAST_DAY_IN_PERIOD_GET. Once you get these dates under the event AT SELECTION-SCREEN OUTPUT.

so_1date = date got from the first FM

so_2date = date got from second FM.

I hope this helps,

Regards

Raju Chitale

Read only

Former Member
0 Likes
1,000

Hi ,

Please try the following code in the initialisation event.

data:w_begin type D,

w_end type D.

select-options:s_date for syst-datum.

initialization.

CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'

EXPORTING

IV_DATE = sy-datum

IMPORTING

EV_MONTH_BEGIN_DATE = w_begin

EV_MONTH_END_DATE = w_end

.

if sy-subrc eq 0.

s_date-low = w_begin.

s_date-high = w_end.

s_date-sign = 'I'.

s_date-option = 'BT'.

append s_date.

endif.

Regards

DV

Read only

Former Member
0 Likes
1,000

SELECT-OPTIONS : s_date FOR sy-datum.

INITIALIZATION.

  s_date-low = sy-datum.
  s_date-low+6(2) = '01'.
  s_date-sign = 'I'.
  s_date-option = 'BT'.
  CALL FUNCTION 'DATE_GET_MONTH_LASTDAY'
    EXPORTING
      i_date = s_date-low
    IMPORTING
      e_date = s_date-high.
  APPEND s_date.

Read only

Former Member
0 Likes
1,000

Hi Nelson,

inorder to the get the default valules in the select-options, use the following code:

select-options for <table_name>-<field_name> default '<variable_name>'.

This will make the values in the select options filled with the variable_name value as default whenever you call the screen.

Reward if helpfull.

Regards,

Kashyap