‎2007 Mar 04 2:01 PM
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 )
‎2007 Mar 04 2:38 PM
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
‎2007 Mar 04 2:38 PM
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
‎2007 Mar 04 2:41 PM
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
‎2007 Mar 04 3:17 PM
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