## 4.2.15.8.1.5  Creating a Job Catalog Entry and a Job Template via API
Find out how to create job catalog entries and job templates using a released API.
If you can't use the ABAP development tools for Eclipse to create job catalog entries and job templates, or of you have the requirement to create these objects via an ABAP class, you can use a released API. To use this API, you can use the ABAP class CL\_APJ\_DT\_CREATE\_CONTENT . The class offers the following methods:
- GET\_INSTANCE (static): Get an instance of class CL\_APJ\_DT\_CREATE\_CONTENT
- CREATE\_JOB\_CAT\_ENTRY : Create an application job catalog entry
- CREATE\_JOB\_TEMPLATE\_ENTRY : Create an application job template
- DELETE\_JOB\_CAT\_ENTRY : Delete an application job catalog entry
- DELETE\_JOB\_TEMPLATE\_ENTRY : Delete an application job template
- EXISTS\_JOB\_CAT\_ENTRY : Check the existence of an application job catalog entry
- EXISTS\_JOB\_TEMPLATE\_ENTRY : Check the existence of an application job template
The following code sample generates one job catalog entry and one related job template:
<!-- image -->
```
CONSTANTS lc_template_text     TYPE cl_apj_dt_create_content=>ty_text          VALUE 'My first simple job template'. CONSTANTS lc_transport_request TYPE cl_apj_dt_create_content=>ty_transport_request VALUE 'Y11K900361'. CONSTANTS lc_package           TYPE cl_apj_dt_create_content=>ty_package           VALUE 'Z_D028092_APJ_MAIN'. DATA(lo_dt) = cl_apj_dt_create_content=>get_instance( ). " Create job catalog entry (corresponds to the former report incl. selection parameters) " Provided implementation class iv_class_name shall implement two interfaces: " - if_apj_dt_exec_object to provide the definition of all supported selection parameters of the job "   (corresponds to the former report selection parameters) and to provide the actual default values " - if_apj_rt_exec_object to implement the job execution TRY. lo_dt->create_job_cat_entry( iv_catalog_name       = lc_catalog_name iv_class_name         = lc_class_name iv_text               = lc_catalog_text iv_catalog_entry_type = cl_apj_dt_create_content=>class_based iv_transport_request  = lc_transport_request iv_package            = lc_package ). out->write( |Job catalog entry created successfully| ). CATCH cx_apj_dt_content INTO DATA(lx_apj_dt_content). out->write( |Creation of job catalog entry failed: { lx_apj_dt_content->get_text( ) }| ). ENDTRY. " Create job template (corresponds to the former system selection variant) which is mandatory " to select the job later on in the Fiori app to schedule the job DATA lt_parameters TYPE if_apj_dt_exec_object=>tt_templ_val. NEW zcl_test_apj_simple( )->if_apj_dt_exec_object~get_parameters( IMPORTING et_parameter_val = lt_parameters ). TRY. lo_dt->create_job_template_entry( iv_template_name     = lc_template_name iv_catalog_name      = lc_catalog_name iv_text              = lc_template_text it_parameters        = lt_parameters iv_transport_request = lc_transport_request iv_package           = lc_package ). out->write( |Job template created successfully| ). CATCH cx_apj_dt_content INTO lx_apj_dt_content. out->write( |Creation of job template failed: { lx_apj_dt_content->get_text( ) }| ). RETURN. ENDTRY. ENDMETHOD. ENDCLASS.
```