In select-options, how to get the default values as current
month first date and last date by default?
Eg: 1/10/2006 and 31/10/2006
Answer Posted / sinu mathew
DATA : lv_last_day_of_month TYPE sy-datum,
lv_datum_low TYPE sy-datum.
SELECT-OPTIONS : s_data FOR sy-datum.
INITIALIZATION.
s_data-sign = 'I'.
s_data-option = 'BT'.
s_data-low = sy-datum.
lv_datum_low = sy-datum.
REPLACE SECTION OFFSET 6 LENGTH 2 OF lv_datum_low WITH '01'.
if sy-subrc eq 0.
s_data-low = lv_datum_low.
endif.
CALL FUNCTION 'LAST_DAY_OF_MONTHS'
EXPORTING
day_in = sy-datum
IMPORTING
last_day_of_month = lv_last_day_of_month
EXCEPTIONS
day_in_no_date = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
s_data-high = lv_last_day_of_month.
ENDIF.
APPEND s_data.
| Is This Answer Correct ? | 14 Yes | 0 No |
Post New Answer View All Answers
please give the remaining answers.
What are the system fields you have worked with? Explain?
How many primary keys can be created for a table?
What is a transaction variant and why are they used?
Difference between sap script and report?
How do you set up background jobs in sap? What are the steps? What are the event driven batch jobs?
What is asap methodology? : sap abap hr
what are the two methods of modifying sap standard tables? : abap data dictionary
What is asynchronous update?
In the `select' statement what is group by ?
Is it possible to pass data to and from include programs explicitly? : abap modularization
What are roles and authorization objects?
Which infotype records can not be deleted ? : abap hr
What is dialog module?
What are the types of the software component being deployed in the sap?