SAP BAPI_XBP_JOB_ADD_ABAP_STEP Function Module for Add Job Step with ABAP Program to a Job
BAPI_XBP_JOB_ADD_ABAP_STEP is a standard bapi xbp job add abap step SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Add Job Step with ABAP Program to a Job processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for bapi xbp job add abap step FM, simply by entering the name BAPI_XBP_JOB_ADD_ABAP_STEP into the relevant SAP transaction such as SE37 or SE38.
Function Group: SXBP
Program Name: SAPLSXBP
Main Program: SAPLSXBP
Appliation area: S
Release date: 20-Jul-2012
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function BAPI_XBP_JOB_ADD_ABAP_STEP pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'BAPI_XBP_JOB_ADD_ABAP_STEP'"Add Job Step with ABAP Program to a Job.
EXPORTING
JOBNAME = "Job Name
* ALLPRIPAR = ' ' "BAPI structure for transferring print parameters
* ALLARCPAR = ' ' "ImageLink structure
* FREE_SELINFO = "Table Type of RSDS_RANGE_S
JOBCOUNT = "Job Count
EXTERNAL_USER_NAME = "Name of the SAP-External User
ABAP_PROGRAM_NAME = "ABAP Program Name
* ABAP_VARIANT_NAME = ' ' "ABAP Variant Name
* SAP_USER_NAME = SY-UNAME "SAP User Name for Authorization Check
* LANGUAGE = SY-LANGU "Language for List Output
* PRINT_PARAMETERS = ' ' "Obsolete, replaced by ALLPRIPAR
* ARCHIVE_PARAMETERS = ' ' "Obsolete, replaced by ALLARCPAR
IMPORTING
STEP_NUMBER = "Job Step Sequential ID Number
RETURN = "
TEMP_VARIANT = "Variant Name
TABLES
* SELINFO = "ABAP: General Structure for PARAMETERS and SELECT-OPTIONS
* PRIPAREXT = "Structure for Extended Print Parameters of Type Name - Value
IMPORTING Parameters details for BAPI_XBP_JOB_ADD_ABAP_STEP
JOBNAME - Job Name
Data type: BAPIXMJOB-JOBNAMEOptional: No
Call by Reference: No ( called with pass by value option)
ALLPRIPAR - BAPI structure for transferring print parameters
Data type: BAPIPRIPARDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
ALLARCPAR - ImageLink structure
Data type: BAPIARCPARDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FREE_SELINFO - Table Type of RSDS_RANGE_S
Data type: RSDSRANGE_T_SSELOptional: Yes
Call by Reference: No ( called with pass by value option)
JOBCOUNT - Job Count
Data type: BAPIXMJOB-JOBCOUNTOptional: No
Call by Reference: No ( called with pass by value option)
EXTERNAL_USER_NAME - Name of the SAP-External User
Data type: BAPIXMLOGR-EXTUSEROptional: No
Call by Reference: No ( called with pass by value option)
ABAP_PROGRAM_NAME - ABAP Program Name
Data type: BAPIXMREP-REPORTIDOptional: No
Call by Reference: No ( called with pass by value option)
ABAP_VARIANT_NAME - ABAP Variant Name
Data type: BAPIXMREP-VARIANTNAMDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SAP_USER_NAME - SAP User Name for Authorization Check
Data type: BAPIXMSTEP-AUTHCKNAMDefault: SY-UNAME
Optional: Yes
Call by Reference: No ( called with pass by value option)
LANGUAGE - Language for List Output
Data type: BAPIXMSTEP-LANGUAGEDefault: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)
PRINT_PARAMETERS - Obsolete, replaced by ALLPRIPAR
Data type: BAPIXMPRNTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
ARCHIVE_PARAMETERS - Obsolete, replaced by ALLARCPAR
Data type: BAPIXMARCHDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_XBP_JOB_ADD_ABAP_STEP
STEP_NUMBER - Job Step Sequential ID Number
Data type: BAPIXMJOB-STEPCOUNTOptional: No
Call by Reference: No ( called with pass by value option)
RETURN -
Data type: BAPIRET2Optional: No
Call by Reference: No ( called with pass by value option)
TEMP_VARIANT - Variant Name
Data type: BAPIXMREP-VARIANTNAMOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BAPI_XBP_JOB_ADD_ABAP_STEP
SELINFO - ABAP: General Structure for PARAMETERS and SELECT-OPTIONS
Data type: RSPARAMSOptional: Yes
Call by Reference: Yes
PRIPAREXT - Structure for Extended Print Parameters of Type Name - Value
Data type: BAPIXMPRIPAREXTOptional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for BAPI_XBP_JOB_ADD_ABAP_STEP Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_jobname | TYPE BAPIXMJOB-JOBNAME, " | |||
| lt_selinfo | TYPE STANDARD TABLE OF RSPARAMS, " | |||
| lv_step_number | TYPE BAPIXMJOB-STEPCOUNT, " | |||
| lv_allpripar | TYPE BAPIPRIPAR, " SPACE | |||
| lv_allarcpar | TYPE BAPIARCPAR, " SPACE | |||
| lv_free_selinfo | TYPE RSDSRANGE_T_SSEL, " | |||
| lv_return | TYPE BAPIRET2, " | |||
| lv_jobcount | TYPE BAPIXMJOB-JOBCOUNT, " | |||
| lt_priparext | TYPE STANDARD TABLE OF BAPIXMPRIPAREXT, " | |||
| lv_temp_variant | TYPE BAPIXMREP-VARIANTNAM, " | |||
| lv_external_user_name | TYPE BAPIXMLOGR-EXTUSER, " | |||
| lv_abap_program_name | TYPE BAPIXMREP-REPORTID, " | |||
| lv_abap_variant_name | TYPE BAPIXMREP-VARIANTNAM, " SPACE | |||
| lv_sap_user_name | TYPE BAPIXMSTEP-AUTHCKNAM, " SY-UNAME | |||
| lv_language | TYPE BAPIXMSTEP-LANGUAGE, " SY-LANGU | |||
| lv_print_parameters | TYPE BAPIXMPRNT, " SPACE | |||
| lv_archive_parameters | TYPE BAPIXMARCH. " SPACE |
|   CALL FUNCTION 'BAPI_XBP_JOB_ADD_ABAP_STEP' "Add Job Step with ABAP Program to a Job |
| EXPORTING | ||
| JOBNAME | = lv_jobname | |
| ALLPRIPAR | = lv_allpripar | |
| ALLARCPAR | = lv_allarcpar | |
| FREE_SELINFO | = lv_free_selinfo | |
| JOBCOUNT | = lv_jobcount | |
| EXTERNAL_USER_NAME | = lv_external_user_name | |
| ABAP_PROGRAM_NAME | = lv_abap_program_name | |
| ABAP_VARIANT_NAME | = lv_abap_variant_name | |
| SAP_USER_NAME | = lv_sap_user_name | |
| LANGUAGE | = lv_language | |
| PRINT_PARAMETERS | = lv_print_parameters | |
| ARCHIVE_PARAMETERS | = lv_archive_parameters | |
| IMPORTING | ||
| STEP_NUMBER | = lv_step_number | |
| RETURN | = lv_return | |
| TEMP_VARIANT | = lv_temp_variant | |
| TABLES | ||
| SELINFO | = lt_selinfo | |
| PRIPAREXT | = lt_priparext | |
| . " BAPI_XBP_JOB_ADD_ABAP_STEP | ||
ABAP code using 7.40 inline data declarations to call FM BAPI_XBP_JOB_ADD_ABAP_STEP
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single JOBNAME FROM BAPIXMJOB INTO @DATA(ld_jobname). | ||||
| "SELECT single STEPCOUNT FROM BAPIXMJOB INTO @DATA(ld_step_number). | ||||
| DATA(ld_allpripar) | = ' '. | |||
| DATA(ld_allarcpar) | = ' '. | |||
| "SELECT single JOBCOUNT FROM BAPIXMJOB INTO @DATA(ld_jobcount). | ||||
| "SELECT single VARIANTNAM FROM BAPIXMREP INTO @DATA(ld_temp_variant). | ||||
| "SELECT single EXTUSER FROM BAPIXMLOGR INTO @DATA(ld_external_user_name). | ||||
| "SELECT single REPORTID FROM BAPIXMREP INTO @DATA(ld_abap_program_name). | ||||
| "SELECT single VARIANTNAM FROM BAPIXMREP INTO @DATA(ld_abap_variant_name). | ||||
| DATA(ld_abap_variant_name) | = ' '. | |||
| "SELECT single AUTHCKNAM FROM BAPIXMSTEP INTO @DATA(ld_sap_user_name). | ||||
| DATA(ld_sap_user_name) | = SY-UNAME. | |||
| "SELECT single LANGUAGE FROM BAPIXMSTEP INTO @DATA(ld_language). | ||||
| DATA(ld_language) | = SY-LANGU. | |||
| DATA(ld_print_parameters) | = ' '. | |||
| DATA(ld_archive_parameters) | = ' '. | |||
Search for further information about these or an SAP related objects