SAP-samples / abap-platform-application-jobs

Implementation of a simple RAP (ABAP RESTful application programming model) business object that allows you to schedule a class as an application job that takes the semantic key of the selected entity as a parameter.
Apache License 2.0
28 stars 14 forks source link

Job templates not allowed in OnPremise systems #1

Open ckraussdennree opened 1 year ago

ckraussdennree commented 1 year ago

Dear André,

thanks for this nice description how to achieve batch runs within RAP. Currently, I'm trying to implement such a feature in a retail environment (S/4HANA 2021 FPS02; ABAP 756 02), but now I'm stuck on creation of the job templates. Since I have to transport the entries from DEV, QAS to PRD system I would like to maintain the templates via transaction SAPJ. Implementeng the setup class seems a bit to much for a single creation. At the moment this transaction does not allow the creation of new templates. I also found this note https://me.sap.com/notes/2829891/E explaining that job templates are not allowed to be created by customers.

Do you have any idea how to solve this?

Best regards, Christian

franksgit commented 6 months ago

Hi @ckraussdennree, I think the note meant to say that one can only pragmatically create job templates for customers. Got this provided source code of André to work in a S/4HANA 2023 FPS00 system at least. I was adjusting the provided coding of zapp_cl_demo_01_setup->constructor to skip the part

IF package_of_rap_generator->read( )-property-record_object_changes = abap_true. transport_request = create_transport( ). ELSE. CLEAR transport_request. ENDIF. transport_request = create_transport( ). ...

and instead provide a workbench request as transport_request.

If you then run this console app zapp_cl_demo_01_setup, it does create the job template, job catalog as well as application log object. Also the fiori app then successfully allows to schedule a job based on this.

Kind regards, Frank