start portlet menu bar

HCLSoftware: Fueling the Digital+ Economy

Display portlet menu
end portlet menu bar
Close
Select Page

This blog aims to show how SAP Calendar Import could be done through Workload Automation. Workload Automation as a product has ready made integration with SAP since the 90’s leveraging the SAP RFC Libraries of SAP using the SAP R/3 Batch Access Method. 

Now , we would see how we can use this same access method to import Freeday Calendars or Workday Calendars from an SAP R/3 System into Workload Automation. 

The r3batch access method can be invoked from TWS/methods Directory(in the older versions) or from the TWSDATA/methods directory in the Newer versions . The export can be for both Freeday Calendars as well as Workday Calendars. The below example is an export of a Freeday Calendar referenced by the Factory Calendar ID 02 exported into a text file /tmp/calendar_03.dat with the name HLI : 

wauser@wa-server:/opt/wa/TWS/methods$ ./r3batch -t RSC -c S4HANAR3BW — ” –calendar_id 02 –year_from 2020 –year_to 2021 –tws_name HLI –getfreedays -filename ‘/tmp/calendar_03.dat’ “ 

Tue Mar 10 09:48:58 2020 

-t RSC represents that the import is for an RFC SAP Calendar. 

-c CalendarName represents that the Calendar name which is imported from the specific SAP System. 

calendar_id XX denotes a 2 Character identifier of the SAP R/3 Calendar to be imported. 

year_from XXXX denotes the Start year from which to start exporting the dates. 

year_to XXXX denotes the End Year upto which you can export dates. 

getfreedays indicates that the export is for Freedays. 

-filename ‘<PATH>/CalendarFileName indicates the name of the file to which export is to be done on the Host OS where you are issuing the command. 

The exported Calendar can be viewed in the File as shown below : 

wauser@wa-server:/opt/wa/TWS/methods$ cat /tmp/calendar_03.dat 

$CALENDAR 

HLI 

  “” 

  01/01/2020 01/04/2020 01/05/2020 01/11/2020 01/12/2020 01/18/2020 01/19/2020 

  01/25/2020 01/26/2020 02/01/2020 02/02/2020 02/08/2020 02/09/2020 02/15/2020 

  02/16/2020 02/22/2020 02/23/2020 02/29/2020 03/01/2020 03/07/2020 03/08/2020 

  03/14/2020 03/15/2020 03/21/2020 03/22/2020 03/28/2020 03/29/2020 04/04/2020 

  04/05/2020 04/10/2020 04/11/2020 04/12/2020 04/13/2020 04/18/2020 04/19/2020 

  04/25/2020 04/26/2020 05/01/2020 05/02/2020 05/03/2020 05/09/2020 05/10/2020 

  05/16/2020 05/17/2020 05/21/2020 05/23/2020 05/24/2020 05/30/2020 05/31/2020 

  06/01/2020 06/06/2020 06/07/2020 06/13/2020 06/14/2020 06/20/2020 06/21/2020 

  06/27/2020 06/28/2020 07/04/2020 07/05/2020 07/11/2020 07/12/2020 07/18/2020 

  07/19/2020 07/25/2020 07/26/2020 08/01/2020 08/02/2020 08/08/2020 08/09/2020 

  08/15/2020 08/16/2020 08/22/2020 08/23/2020 08/29/2020 08/30/2020 09/05/2020 

  09/06/2020 09/12/2020 09/13/2020 09/19/2020 09/20/2020 09/26/2020 09/27/2020 

  10/03/2020 10/04/2020 10/10/2020 10/11/2020 10/17/2020 10/18/2020 10/24/2020 

  10/25/2020 10/31/2020 11/01/2020 11/07/2020 11/08/2020 11/14/2020 11/15/2020 

  11/21/2020 11/22/2020 11/28/2020 11/29/2020 12/05/2020 12/06/2020 12/12/2020 

  12/13/2020 12/19/2020 12/20/2020 12/24/2020 12/25/2020 12/26/2020 12/27/2020 

  12/31/2020 01/01/2021 01/02/2021 01/03/2021 01/09/2021 01/10/2021 01/16/2021 

  01/17/2021 01/23/2021 01/24/2021 01/30/2021 01/31/2021 02/06/2021 02/07/2021 

  02/13/2021 02/14/2021 02/20/2021 02/21/2021 02/27/2021 02/28/2021 03/06/2021 

  03/07/2021 03/13/2021 03/14/2021 03/20/2021 03/21/2021 03/27/2021 03/28/2021 

  04/02/2021 04/03/2021 04/04/2021 04/05/2021 04/10/2021 04/11/2021 04/17/2021 

  04/18/2021 04/24/2021 04/25/2021 05/01/2021 05/02/2021 05/08/2021 05/09/2021 

  05/13/2021 05/15/2021 05/16/2021 05/22/2021 05/23/2021 05/24/2021 05/29/2021 

  05/30/2021 06/05/2021 06/06/2021 06/12/2021 06/13/2021 06/19/2021 06/20/2021 

  06/26/2021 06/27/2021 07/03/2021 07/04/2021 07/10/2021 07/11/2021 07/17/2021 

  07/18/2021 07/24/2021 07/25/2021 07/31/2021 08/01/2021 08/07/2021 08/08/2021 

  08/14/2021 08/15/2021 08/21/2021 08/22/2021 08/28/2021 08/29/2021 09/04/2021 

  09/05/2021 09/11/2021 09/12/2021 09/18/2021 09/19/2021 09/25/2021 09/26/2021 

  10/02/2021 10/03/2021 10/09/2021 10/10/2021 10/16/2021 10/17/2021 10/23/2021 

  10/24/2021 10/30/2021 10/31/2021 11/06/2021 11/07/2021 11/13/2021 11/14/2021 

  11/20/2021 11/21/2021 11/27/2021 11/28/2021 12/04/2021 12/05/2021 12/11/2021 

  12/12/2021 12/18/2021 12/19/2021 12/24/2021 12/25/2021 12/26/2021 12/31/2021 

 

The exported Calendar in the text file can be imported into Workload Automation using a composer add as shown below : 

HCL Workload Automation(UNIX)/COMPOSER 9.5.0.01 (20190703) 

Licensed Materials – Property of IBM* and HCL** 

5698-WSH 

(C) Copyright IBM Corp. 1998, 2016 All rights reserved. 

(C) Copyright HCL Technologies Ltd. 2016, 2019 All rights reserved. 

* Trademark of International Business Machines 

** Trademark of HCL Technologies Limited 

Installed for user “wauser“. 

Locale LANG set to the following: “en 

User: wauser, Host:127.0.0.1, Port:31116 

User: wauser, Host:localhost, Port:31114 

/ 

-add /tmp/calendar_03.dat 

AWSJCL003I The command “add” completed successfully on object “cal=HLI”. 

AWSBIA302I No errors in /tmp/calendar_03.dat. 

AWSBIA288I Total objects updated: 1 

wauser@wa-server:/opt/wa/TWS/methods$ 

So , with the above Steps a Factory Freeday Calendar with ID 02 was imported Successfully into Workload Automation under the name HLI . 

The below example is an export of a Factory Workday Calendar referenced by the Workday Calendar ID 02 exported into a text file /tmp/calendar_02.dat with the name NEW : 

wauser@wa-server:/opt/wa/TWS/methods$ ./r3batch -t RSC -c S4HANAR3BW — ” –calendar_id 02 –year_from 2020 –year_to 2021 –tws_name NEW –tws_description ‘SAP Calendar 02’ –getworkdays -filename ‘/tmp/calendar_02.dat’ “ 

Tue Mar 10 09:43:43 2020 

The exported Calendar can be displayed and viewed as follows : 

wauser@wa-server:/opt/wa/TWS/methods$ cat /tmp/calendar_02.dat 

$CALENDAR 

NEW 

  “SAP Calendar 02” 

  01/02/2020 01/03/2020 01/06/2020 01/07/2020 01/08/2020 01/09/2020 01/10/2020 

  01/13/2020 01/14/2020 01/15/2020 01/16/2020 01/17/2020 01/20/2020 01/21/2020 

  01/22/2020 01/23/2020 01/24/2020 01/27/2020 01/28/2020 01/29/2020 01/30/2020 

  01/31/2020 02/03/2020 02/04/2020 02/05/2020 02/06/2020 02/07/2020 02/10/2020 

  02/11/2020 02/12/2020 02/13/2020 02/14/2020 02/17/2020 02/18/2020 02/19/2020 

  02/20/2020 02/21/2020 02/24/2020 02/25/2020 02/26/2020 02/27/2020 02/28/2020 

  03/02/2020 03/03/2020 03/04/2020 03/05/2020 03/06/2020 03/09/2020 03/10/2020 

  03/11/2020 03/12/2020 03/13/2020 03/16/2020 03/17/2020 03/18/2020 03/19/2020 

  03/20/2020 03/23/2020 03/24/2020 03/25/2020 03/26/2020 03/27/2020 03/30/2020 

  03/31/2020 04/01/2020 04/02/2020 04/03/2020 04/06/2020 04/07/2020 04/08/2020 

  04/09/2020 04/14/2020 04/15/2020 04/16/2020 04/17/2020 04/20/2020 04/21/2020 

  04/22/2020 04/23/2020 04/24/2020 04/27/2020 04/28/2020 04/29/2020 04/30/2020 

  05/04/2020 05/05/2020 05/06/2020 05/07/2020 05/08/2020 05/11/2020 05/12/2020 

  05/13/2020 05/14/2020 05/15/2020 05/18/2020 05/19/2020 05/20/2020 05/22/2020 

  05/25/2020 05/26/2020 05/27/2020 05/28/2020 05/29/2020 06/02/2020 06/03/2020 

  06/04/2020 06/05/2020 06/08/2020 06/09/2020 06/10/2020 06/11/2020 06/12/2020 

  06/15/2020 06/16/2020 06/17/2020 06/18/2020 06/19/2020 06/22/2020 06/23/2020 

  06/24/2020 06/25/2020 06/26/2020 06/29/2020 06/30/2020 07/01/2020 07/02/2020 

  07/03/2020 07/06/2020 07/07/2020 07/08/2020 07/09/2020 07/10/2020 07/13/2020 

  07/14/2020 07/15/2020 07/16/2020 07/17/2020 07/20/2020 07/21/2020 07/22/2020 

  07/23/2020 07/24/2020 07/27/2020 07/28/2020 07/29/2020 07/30/2020 07/31/2020 

  08/03/2020 08/04/2020 08/05/2020 08/06/2020 08/07/2020 08/10/2020 08/11/2020 

  08/12/2020 08/13/2020 08/14/2020 08/17/2020 08/18/2020 08/19/2020 08/20/2020 

  08/21/2020 08/24/2020 08/25/2020 08/26/2020 08/27/2020 08/28/2020 08/31/2020 

  09/01/2020 09/02/2020 09/03/2020 09/04/2020 09/07/2020 09/08/2020 09/09/2020 

  09/10/2020 09/11/2020 09/14/2020 09/15/2020 09/16/2020 09/17/2020 09/18/2020 

  09/21/2020 09/22/2020 09/23/2020 09/24/2020 09/25/2020 09/28/2020 09/29/2020 

  09/30/2020 10/01/2020 10/02/2020 10/05/2020 10/06/2020 10/07/2020 10/08/2020 

  10/09/2020 10/12/2020 10/13/2020 10/14/2020 10/15/2020 10/16/2020 10/19/2020 

  10/20/2020 10/21/2020 10/22/2020 10/23/2020 10/26/2020 10/27/2020 10/28/2020 

  10/29/2020 10/30/2020 11/02/2020 11/03/2020 11/04/2020 11/05/2020 11/06/2020 

  11/09/2020 11/10/2020 11/11/2020 11/12/2020 11/13/2020 11/16/2020 11/17/2020 

  11/18/2020 11/19/2020 11/20/2020 11/23/2020 11/24/2020 11/25/2020 11/26/2020 

  11/27/2020 11/30/2020 12/01/2020 12/02/2020 12/03/2020 12/04/2020 12/07/2020 

  12/08/2020 12/09/2020 12/10/2020 12/11/2020 12/14/2020 12/15/2020 12/16/2020 

  12/17/2020 12/18/2020 12/21/2020 12/22/2020 12/23/2020 12/28/2020 12/29/2020 

  12/30/2020 01/04/2021 01/05/2021 01/06/2021 01/07/2021 01/08/2021 01/11/2021 

  01/12/2021 01/13/2021 01/14/2021 01/15/2021 01/18/2021 01/19/2021 01/20/2021 

  01/21/2021 01/22/2021 01/25/2021 01/26/2021 01/27/2021 01/28/2021 01/29/2021 

  02/01/2021 02/02/2021 02/03/2021 02/04/2021 02/05/2021 02/08/2021 02/09/2021 

  02/10/2021 02/11/2021 02/12/2021 02/15/2021 02/16/2021 02/17/2021 02/18/2021 

  02/19/2021 02/22/2021 02/23/2021 02/24/2021 02/25/2021 02/26/2021 03/01/2021 

  03/02/2021 03/03/2021 03/04/2021 03/05/2021 03/08/2021 03/09/2021 03/10/2021 

  03/11/2021 03/12/2021 03/15/2021 03/16/2021 03/17/2021 03/18/2021 03/19/2021 

  03/22/2021 03/23/2021 03/24/2021 03/25/2021 03/26/2021 03/29/2021 03/30/2021 

  03/31/2021 04/01/2021 04/06/2021 04/07/2021 04/08/2021 04/09/2021 04/12/2021 

  04/13/2021 04/14/2021 04/15/2021 04/16/2021 04/19/2021 04/20/2021 04/21/2021 

  04/22/2021 04/23/2021 04/26/2021 04/27/2021 04/28/2021 04/29/2021 04/30/2021 

  05/03/2021 05/04/2021 05/05/2021 05/06/2021 05/07/2021 05/10/2021 05/11/2021 

  05/12/2021 05/14/2021 05/17/2021 05/18/2021 05/19/2021 05/20/2021 05/21/2021 

  05/25/2021 05/26/2021 05/27/2021 05/28/2021 05/31/2021 06/01/2021 06/02/2021 

  06/03/2021 06/04/2021 06/07/2021 06/08/2021 06/09/2021 06/10/2021 06/11/2021 

  06/14/2021 06/15/2021 06/16/2021 06/17/2021 06/18/2021 06/21/2021 06/22/2021 

  06/23/2021 06/24/2021 06/25/2021 06/28/2021 06/29/2021 06/30/2021 07/01/2021 

  07/02/2021 07/05/2021 07/06/2021 07/07/2021 07/08/2021 07/09/2021 07/12/2021 

  07/13/2021 07/14/2021 07/15/2021 07/16/2021 07/19/2021 07/20/2021 07/21/2021 

  07/22/2021 07/23/2021 07/26/2021 07/27/2021 07/28/2021 07/29/2021 07/30/2021 

  08/02/2021 08/03/2021 08/04/2021 08/05/2021 08/06/2021 08/09/2021 08/10/2021 

  08/11/2021 08/12/2021 08/13/2021 08/16/2021 08/17/2021 08/18/2021 08/19/2021 

  08/20/2021 08/23/2021 08/24/2021 08/25/2021 08/26/2021 08/27/2021 08/30/2021 

  08/31/2021 09/01/2021 09/02/2021 09/03/2021 09/06/2021 09/07/2021 09/08/2021 

  09/09/2021 09/10/2021 09/13/2021 09/14/2021 09/15/2021 09/16/2021 09/17/2021 

  09/20/2021 09/21/2021 09/22/2021 09/23/2021 09/24/2021 09/27/2021 09/28/2021 

  09/29/2021 09/30/2021 10/01/2021 10/04/2021 10/05/2021 10/06/2021 10/07/2021 

  10/08/2021 10/11/2021 10/12/2021 10/13/2021 10/14/2021 10/15/2021 10/18/2021 

  10/19/2021 10/20/2021 10/21/2021 10/22/2021 10/25/2021 10/26/2021 10/27/2021 

  10/28/2021 10/29/2021 11/01/2021 11/02/2021 11/03/2021 11/04/2021 11/05/2021 

  11/08/2021 11/09/2021 11/10/2021 11/11/2021 11/12/2021 11/15/2021 11/16/2021 

  11/17/2021 11/18/2021 11/19/2021 11/22/2021 11/23/2021 11/24/2021 11/25/2021 

  11/26/2021 11/29/2021 11/30/2021 12/01/2021 12/02/2021 12/03/2021 12/06/2021 

  12/07/2021 12/08/2021 12/09/2021 12/10/2021 12/13/2021 12/14/2021 12/15/2021 

  12/16/2021 12/17/2021 12/20/2021 12/21/2021 12/22/2021 12/23/2021 12/27/2021 

 

The Calendar exported can be imported using a composer add command as follows: 

HCL Workload Automation(UNIX)/COMPOSER 9.5.0.01 (20190703) 

Licensed Materials – Property of IBM* and HCL** 

5698-WSH 

(C) Copyright IBM Corp. 1998, 2016 All rights reserved. 

(C) Copyright HCL Technologies Ltd. 2016, 2019 All rights reserved. 

* Trademark of International Business Machines 

** Trademark of HCL Technologies Limited 

Installed for user “wauser“. 

Locale LANG set to the following: “en 

User: wauser, Host:127.0.0.1, Port:31116 

User: wauser, Host:localhost, Port:31114 

/ 

-add /tmp/calendar_02.dat 

AWSJCL003I The command “add” completed successfully on object “cal=NEW“. 

AWSBIA302I No errors in /tmp/calendar_02.dat. 

AWSBIA288I Total objects updated: 1 

wauser@wa-server:/opt/wa/TWS/methods$ 

So, with the above Steps a Factory Workday Calendar with ID 02 was imported Successfully into Workload Automation under the name NEW.

So, in this way, you can import any SAP Factory Calendar into Workload Automation easily or import all SAP Calendars needed for managing SAP Jobs, this greatly reduces any efforts needed in replicating SAP Calendars which are already defined on SAP Side to WA Side. 

 Author’s Bio

sriram vSriram V

Sriram is working with Workload Automation for the last 11.5 years. Started out as a Scheduler, later as an Administrator, SME and India SME of the Product. He has been part of the Product Team in the last few years supporting Workload Automation on SaaS before moving to the Tech Sales and Lab Services of WA. 

LinkedIn: https://www.linkedin.com/in/sriram-v-4163b820/ 

 

Comment wrap
Automation | May 20, 2024
HCL Workload automation, IT automation, Automation as code, Observability
HCL Workload Automation 10.2.2 streamlines your processes with simplified installation, enhanced security via rootless installs and CyberArk integration, plus observability with OpenTelemetry.
Automation | February 6, 2024
Send Email Plug-in: Deliver Emails Simply and Effectively
Automate email delivery with Send email plug-in for Workload Automation. Simplify communication workflows, improve efficiency, and download now!
Automation | August 23, 2023
The New Kubernetes Plugin in HCL Workload Automation
Read how to automate container orchestration with the new Kubernetes plugin in HCL Workload Automation.