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: 

How to add factory calender in ABAP Selection Screen?

vijay_kumar134
Participant
0 Kudos

Hi,

Anyone can guide me, how to add the factory or Holiday calender in ABAP Selection screen?

Thanks in advance.

VJ.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Vijay,

Call Function module 'F4_DATE', in event AT SELECTION-SCREEN ON VALUE-REQUEST.

Pass Factory calendar ID to " FACTORY_CALENDAR_ID" parameter.

You can execute the FM in SE37 screen and see how it works.

Days marked in red will be one which are excluded from the standard calendar.

Regards,

Nisha Vengal.

10 REPLIES 10

Former Member
0 Kudos

Parameters: p_fcal type TFACD-IDENT.

Thanks,

Vikram.M

0 Kudos

Hi Vikram,

Thanks for your reply..

My req is, when we click the selection, i need the factory calender. i don't want F.calender ID.

Please guide me.

Thanks.

VJ.

0 Kudos

Can you please elaborate?

When you click on what? a button?

What do you mean by you need the factory calendar? a group of parameters and select options?

Vikram.M

0 Kudos

In the Select Options:\\ 

SELECT-OPTIONS: s_date  FOR sy-datum DEFAULT space NO-EXTENSION.

Here i declared sy-datum.

my client re.q is factory or holiday calender. Below is my current screen.

0 Kudos

You will need to build the logic on at selection on value request.

for factory calendars you can look at the transaction SCAL. You should be able to build something similar. You can use the tables:

THOCT: Public holiday calendar texts

TFACD:  calendar definition

THOCI: Public holiday calendar.

There should be similar table from which you can get the required data.

Vikram.M

Former Member
0 Kudos

Hi Vijay,

Call Function module 'F4_DATE', in event AT SELECTION-SCREEN ON VALUE-REQUEST.

Pass Factory calendar ID to " FACTORY_CALENDAR_ID" parameter.

You can execute the FM in SE37 screen and see how it works.

Days marked in red will be one which are excluded from the standard calendar.

Regards,

Nisha Vengal.

0 Kudos

Hi Nisha,

Thanks for your reply.

As per your sugession i have created but i am not able to pick the date from Factory calender.

Means, in the selection screen s_date field just showing the factory calender but i am not able to pick the date from the f. calender.

You have any idea about this issue?

Thanks.

VJ.

0 Kudos

Use the below code and it should work.

AT SELECTION-SCREEN on VALUE-REQUEST FOR p_date. "p_date is your selection screen field.


   CALL FUNCTION 'F4_DATE'

    EXPORTING

      DATE_FOR_FIRST_MONTH               = SY-DATUM

      DISPLAY                                           = ' '

      FACTORY_CALENDAR_ID                = 'US'

      HOLIDAY_CALENDAR_ID                = 'US'

    IMPORTING

      SELECT_DATE                        = p_date

The thing to note above is DISPLAY should NOT be 'X'.

0 Kudos

Hi Vikram,

The above code is working. and also trying for High value..

Means in the selection screen ranges low and high..

Once again thanks for your cooperation.

Thanks.|

VJ.

0 Kudos

ISSUE SOLVED.

Thank you very much.. Vikram and Nisha..

VJ.