‎2006 Dec 12 9:53 AM
Hi,
I have a requirement wherein the user shud be allowed to choose a date on the calendar using F4 help and after choosing, it shud get displayed as dd.mm.yyyy format in the field. Is there any functional module to implement this.
Thanks in Advance,
Saranya.
‎2006 Dec 12 9:56 AM
Hi Saranya ,
chk this FM
CALL FUNCTION 'F4_DATE'
EXPORTING
DATE_FOR_FIRST_MONTH = DATE
DISPLAY = HELPDISP
IMPORTING
SELECT_DATE = DATE
EXCEPTIONS
OTHERS = 4.
‎2006 Dec 12 9:56 AM
Hi Saranya ,
chk this FM
CALL FUNCTION 'F4_DATE'
EXPORTING
DATE_FOR_FIRST_MONTH = DATE
DISPLAY = HELPDISP
IMPORTING
SELECT_DATE = DATE
EXCEPTIONS
OTHERS = 4.
‎2006 Dec 12 10:40 AM
Chandrasekhar,
This FM is not working and it throws exception as my date field is 10 char. Pls suggest an alternative solution. Pls note that the date field that I am using is in
Module-pool programming.
thanks in advance,
Saranya
‎2006 Dec 12 10:59 AM
HI Saranya,
Firstly, you have to define a field like this in your module pool main program.
data: date type sy-datum.
Then in the screen painter, click on CHOOSE FROM PROGRAM option. YOu will get a list of all program variables.
Chose the date field and continue.
YOu can place the date field wherever you like.
Save it and activate.
The f4 help come by default.
Regards,
Ravi
‎2006 Dec 12 9:58 AM
Hi Saranya,
For this use one of the database date reference field and regarding the date formate, it is based on the user settings. Still you want the same dd.mm.yyyy format just take one label field to speicy this and validate the value of this field to check the format.
Regards,
Satya
‎2006 Dec 12 9:58 AM
If you use a field which is referiing to the domain datum or data element ERDAT, it would come up automatically.
To display it in the format you have mentioned, you have to set your user parameters. (System->User Profile->SEt status)
Regards,
ravi
‎2006 Dec 12 9:58 AM
For this help we dont need to have the function module
we can use the date field as type of system variable
Ex: date type sy-datum.
it will enable the F4 help for the field that u r going to specify in the module programming
Regards,
Shanmuga.
‎2006 Dec 12 9:58 AM
Hello Saranya,
In the attribute of the field give the following
Format - DATS
Possible entry - 1
Input checkbox should be checked.
If useful reward.
Vasanth
‎2022 May 12 6:57 AM
Ideally speaking this should be the right answer for the Question asked.
‎2006 Dec 12 9:59 AM
hi,
no need for any FM.
decakre like this. automatically f4 will come.
data : f_data like sy-datum.
rgds
anver
‎2006 Dec 12 10:51 AM
You can check this also F4_DATE_CONTROL
are u writing the code in PROCESS ON VALUE-REQUEST
Message was edited by:
chandrasekhar jagarlamudi
‎2006 Dec 12 11:10 AM
Hi Saranya,
Try this.
1. Define the field on the screen as type dats.
2. In the Screen layout, Under field Attributes, choose Poss. entries value as 1.
3. Goto Systems -> User Profile -> Own Data -> Defaults tab. Change the date format to 'DD.MM.YYYY'.
This should display the date in the format you require.
Pls. mark helpful answers.
Best Regards,
Biju V
‎2007 Oct 17 10:09 AM
Hi,
Please try the below code in your prgm.
You have to write the below code in the POV of the required field.
----
***INCLUDE MZDATE_POV_DATEI01 .
----
&----
*& Module pov_date INPUT
&----
text
----
module pov_date input.
DATA: li_ret_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = ' '
fieldname = ' '
searchhelp = 'BU_DATE_CHAR'
TABLES
return_tab = li_ret_tab
EXCEPTIONS
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
OTHERS = 5.
IF sy-subrc IS INITIAL.
READ TABLE li_ret_tab INDEX 1.
IF sy-subrc IS INITIAL.
wrk_date = li_ret_tab-fieldval. "The required field
ENDIF.
ENDIF.
endmodule. " pov_date INPUT
Hope it suits ur requirement.
Reward points if useful.
Thanks and regards,
Litta.