Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

From & To Selection for <htmlb:inputField id = "DATE" >

Hi Friends,

Is there any feature like ,to select the dates in the htmlb calendar ? I need to select the from date , to date in the same calendar ,for results in that particular dates. I look for your suggestions in this regard.

Regards

CSM Reddy

Former Member replied

You can refer to this sample code:

<htmlb:gridLayout columnSize = "2"
                  rowSize    = "2" >
        <htmlb:gridLayoutCell columnIndex = "1"
                              rowIndex    = "1" >
          <htmlb:label for      = "date_frm"
                       required = "true"
                       text     = "Date From"
                       design   = "EMPHASIZED" />
        </htmlb:gridLayoutCell>
        <htmlb:gridLayoutCell columnIndex = "2"
                              rowIndex    = "1" >
          <htmlb:inputField id             = "date_frm"
                            type           = "date"
                            required       = "true"
                            doValidate     = "TRUE"
                            firstDayOfWeek = "2"
                            showHelp       = "true"
                            value          = "<%= date_frm %>" />
        </htmlb:gridLayoutCell>
        <htmlb:gridLayoutCell columnIndex = "1"
                              rowIndex    = "2" >
          <htmlb:label for      = "date_to"
                       required = "true"
                       text     = "Date To"
                       design   = "EMPHASIZED" />
        </htmlb:gridLayoutCell>
        <htmlb:gridLayoutCell columnIndex = "2"
                              rowIndex    = "2" >
          <htmlb:inputField id             = "date_to"
                            type           = "date"
                            doValidate     = "TRUE"
                            required       = "true"
                            firstDayOfWeek = "2"
                            showHelp       = "true"
                            value          = "<%= date_to %>" />
        </htmlb:gridLayoutCell>
        </htmlb:gridLayout>

Now in OnInput Processing we can have:

date_frm = request->get_form_field( 'date_frm' ).
date_to = request->get_form_field( 'date_to' ).

If you need to fetch records, from a DB table within this interval you can use:

SELECT <fields> FROM INTO <itab> WHERE <date in DB table>

BETWEEN date_frm AND date_to.

Hope this helps,

Regards,

Ravikiran.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question