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 Validation

Former Member
0 Likes
499

Hi all,

In selection screen i'm passing month nad year field.

if it 03 2008 means. it should fetch the values of mkpf from 01.03.2008 to 31.03.2008.

how to do this

Regards

Suprith

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
456

HI,

You are getting the month and year from the selection screen like 03.2008

in the program split the month and year

ranges r_date for sy-datum.

p_month = p_date(2).

p_year = p+3(4).

To build the dates

From date

CONCATENATE p_year p_month(2) '01' INTO g_begda.

To Date

CALL FUNCTION 'LAST_DAY_OF_MONTHS' "#EC

EXPORTING

day_in = g_begda

IMPORTING

last_day_of_month = g_endda

EXCEPTIONS

day_in_no_date = 1

OTHERS = 2.

r_date-sign = 'I'.

r_date-option = 'BT'.

r_date-low = g_begda .

r_date-high = g_endda .

append r_date.

then use the r_date in mkpf data selection

Edited by: avinash kodarapu on Dec 10, 2008 12:29 PM

3 REPLIES 3
Read only

h_senden2
Active Contributor
0 Likes
456

Based on value of month you can create 2 variable l_start and l_end where l_start is the first day of the month and l_end is the last day. This last day can be calculated by using function RP_LAST_DAY_OF_MONTHS .

With these values you can read the MKPF table.

regards,

hans

Read only

Former Member
0 Likes
456

Hi

in the selection screen you can give the date field as S_DATE and then you can directly provide the input valuse in S_Date-low and S_date-high.

Neha

Read only

Former Member
0 Likes
457

HI,

You are getting the month and year from the selection screen like 03.2008

in the program split the month and year

ranges r_date for sy-datum.

p_month = p_date(2).

p_year = p+3(4).

To build the dates

From date

CONCATENATE p_year p_month(2) '01' INTO g_begda.

To Date

CALL FUNCTION 'LAST_DAY_OF_MONTHS' "#EC

EXPORTING

day_in = g_begda

IMPORTING

last_day_of_month = g_endda

EXCEPTIONS

day_in_no_date = 1

OTHERS = 2.

r_date-sign = 'I'.

r_date-option = 'BT'.

r_date-low = g_begda .

r_date-high = g_endda .

append r_date.

then use the r_date in mkpf data selection

Edited by: avinash kodarapu on Dec 10, 2008 12:29 PM