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

Former Member
0 Likes
372

Dear All,

Here i am facing a problem in selection screen ,in this when i am entering the year from date and to date should be automatically displayed.

and all should be in the same line.

Year _______ _________ To __________

(Year is mandatory, From date & To are display field. Eg. Year = 2006, then from = 01.04.2006 and to = 31.03.2007 )

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
352

Hi Prince,

For displaying all the selection screen fields on the same line just use the syntax:

SELECTION-SCREEN: BEGIN OF LINE.

parameters: p_year type gjahr,

p_from_date type datum,

p_to_date type datum.

SELECTION-SCREEN: END OF LINE.

As for populating the from and to dates automatically from the year, how do you determine 0104 and 3103 ?!?! Would it ALWAYS follow the fiscal year start and end dates? If so, then use the even AT SELECTION-SCREEN ON p_year

and populate the other two values using ur logic.

Regards,

Aditya

3 REPLIES 3
Read only

Former Member
0 Likes
353

Hi Prince,

For displaying all the selection screen fields on the same line just use the syntax:

SELECTION-SCREEN: BEGIN OF LINE.

parameters: p_year type gjahr,

p_from_date type datum,

p_to_date type datum.

SELECTION-SCREEN: END OF LINE.

As for populating the from and to dates automatically from the year, how do you determine 0104 and 3103 ?!?! Would it ALWAYS follow the fiscal year start and end dates? If so, then use the even AT SELECTION-SCREEN ON p_year

and populate the other two values using ur logic.

Regards,

Aditya

Read only

Former Member
0 Likes
352

Hi Prince,

Try executing this:

SELECTION-SCREEN: BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(4) year.

selection-screen POSITION 6.

PARAMETERS para(4) TYPE c.

selection-screen POSITION 12.

select-options v1 for mara-matnr.

SELECTION-SCREEN END OF LINE.

INITIALIZATION.

year = 'year'.

Award points if it helps you

Br,

Laxmi

Read only

ferry_lianto
Active Contributor
0 Likes
352

Hi,

Please try this.


SELECTION-SCREEN BEGIN OF BLOCK B1.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(4) TEXT-001.                 <---- Year 
SELECTION-SCREEN POSITION 6.
PARAMETERS : P_YEAR(4) OBLIGATORY.
SELECTION-SCREEN POSITION 11.
PARAMETERS : P_DATE1 LIKE SY-DATUM.
SELECTION-SCREEN COMMENT 21(2) TEXT-002.                <---- To 
SELECTION-SCREEN POSITION 24.
PARAMETERS : P_DATE2 LIKE SY-DATUM.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B1.


AT SELECTION-SCREEN OUTPUT.

IF NOT P_YEAR IS INITIAL.
 P_DATE1(4)   = P_YEAR.
 P_DATE1+4(4) = '0401'.
 P_DATE2(4)   = P_YEAR + 1.
 P_DATE2+4(4) = '0331'. 
ENDIF.

Regards,

Ferry Lianto