Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

PBO/PAI : Date picker popup for Input field

Former Member
0 Kudos

Hi,

I am trying to provide value help with date picker for an textbox.

1) I created textbox with name 'SYST-DATUM' and it proposed for the search help and showed the date picker. But the values i not passed to the field after execution.

2) If i have 2 textboxes which needs Date picker how to handle this, because there cannot be 2 fields within same name.

Can anyone suggest value help popup for date picker?

Thank you

arun

1 ACCEPTED SOLUTION

nablan_umar
Active Contributor
0 Kudos

Hi Arun,

Why don't you do like this:

1. Create a custom structure (eg ZDATESTRUC) that contains

a. Field DATE1 of type DATUM. Make sure entry help/check is "Input help based on data type"

b. Field DATE2 of type DATUM. Make sure entry help/check is "Input help based on data type"

2. In your screen, define the date field as ZDATESTRUC-DATE1 and ZDATESTRUC-DATE2.

Date picker popup will automatically appears.

4 REPLIES 4

nablan_umar
Active Contributor
0 Kudos

Hi Arun,

Why don't you do like this:

1. Create a custom structure (eg ZDATESTRUC) that contains

a. Field DATE1 of type DATUM. Make sure entry help/check is "Input help based on data type"

b. Field DATE2 of type DATUM. Make sure entry help/check is "Input help based on data type"

2. In your screen, define the date field as ZDATESTRUC-DATE1 and ZDATESTRUC-DATE2.

Date picker popup will automatically appears.

0 Kudos

Hi Arun

Nablan's solution should be OK if your fields can be referenced to dictionary. But if your field stands alone you can code your POV utilizing the FM 'F4_DATE' . Yesss, again POV programming

e.g.

Assume our field whish we require F4 is gv_date.

<b>DATA gv_date LIKE sy-datum.</b>

Here is the snippet for F4 processing.

<b>DATA cv_date like sy-datum .

CALL FUNCTION 'F4_DATE'

IMPORTING

select_date = cv_date

EXCEPTIONS

OTHERS = 8.

IF sy-subrc = 0 AND NOT cv_date IS INITIAL .

gv_date = cv_date .

ENDIF.</b>

*--Serdar

Former Member
0 Kudos

Hi serder,

It worked perfectly. But how do i set the default value as todays date when the screen loads?

When i use the SYST-DATUM it automatically populated the text field with todays date.

Thank you

arun

0 Kudos

Hi Arun

Before calling your screen, set the variable with today's date.

e.g.

gv_date = sy-datum .

CALL SCREEN 100 .

*----


A second thing to mention about the FM: If you pass a date to the parameter "DATE_FOR_FIRST_MONTH", the date picker is displayed with that date as default.

*--Serdar