10-09-2006 3:32 PM
Hi,
i have Char10 field on selection screen which doesnt have f4 help.
i want f4 functionality for that particular filed,when press f4 i should get calander,so that i have to slect date.
note:selection screen field type should be of char10.
please post the answer as soon as possible.its an urgent requirement for me.
Regards,
Sunil.
10-09-2006 3:33 PM
Hi
If you declare your parameter like SY-DATUM instead of CHAR10 you'll have automatically what you need:
PARAMETERS: P_DATE LIKE SY-DATUM.
Max
10-09-2006 3:33 PM
Hi
If you declare your parameter like SY-DATUM instead of CHAR10 you'll have automatically what you need:
PARAMETERS: P_DATE LIKE SY-DATUM.
Max
10-09-2006 3:33 PM
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_ym.
PERFORM f4_ym.
&----
*& Form f4_ym
&----
F4 for Year and Month
----
FORM f4_ym .
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.
CONCATENATE li_ret_tab-fieldval6(4) li_ret_tab-fieldval3(2) li_ret_tab-fieldval+0(2)
INTO p_ym separated by '.'.
ENDIF.
ENDIF.
ENDFORM. " f4_ym
10-09-2006 3:34 PM
10-09-2006 3:38 PM
If you still want to use char10 and do not want to use sy-datum as other have suggested, then use this code:
parameters: p_date like char10.
at selection-screen on value-request for p_date.
call function 'F4_DATE'
exporting
date_for_first_month = sy-datum
display = ' '
importing
select_date = p_date.
Regards,
ravi
10-09-2006 3:38 PM
Hi,
When you use the Date, then why don't you declare it as like SY-DATUM, so it will pick the calender when you press the F4. however, see the below code
Parameters: Date(10).
AT SELECTION-SCREEN ON VALUE-REQUEST FOR DATE.
DATA: DAte_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = ' '
fieldname = ' '
<b>searchhelp = 'BU_DATE_CHAR'</b>
TABLES
return_tab = date_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 date_tab INDEX 1.
IF sy-subrc IS INITIAL.
CONCATENATE date_tab-fieldval6(4) li_ret_tab-fieldval3(2) li_ret_tab-fieldval+0(2)
INTO dateseparated by '/'.
ENDIF.
ENDIF.
Regards
Sudheer