cancel
Showing results for 
Search instead for 
Did you mean: 

SAP RFC - Get steps for a Job

Former Member
0 Kudos

Hi,

I wonder if you have some code sample to get Steps for an existing Job?

Preferably I would like the code to include any details about which type (ExternalCommand, ExternalProgram etc), name of command, variant, parameter and target server and any step order.

Is this possible?

Thank you!

Accepted Solutions (0)

Answers (1)

Answers (1)

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Henrik,

please clarify, which kind of Jobs you are referring to.

Best regards,

Markus

Former Member
0 Kudos

I am referring to a SAP Job (container of steps) like I can create with code below:

Dim jobCount As String = Me.OpenJob(jobName, jobPriority)

rfcRepository = Dest.Repository

Dim rfcFunction As IRfcFunction = rfcRepository.CreateFunction("BAPI_XBP_ADD_JOB_STEP")

rfcFunction.SetValue("JOBNAME", jobName)

rfcFunction.SetValue("JOBCOUNT", jobCount)

rfcFunction.SetValue("EXTERNAL_USER_NAME", ExternalUser)

Dim JobStep As IRfcStructure = rfcFunction.GetStructure("STEP")

JobStep.SetValue("TYP", "C")

JobStep.SetValue("PROGRAM", commandName)

JobStep.SetValue("PARAMETER", parameters)

JobStep.SetValue("AUTHCKNAM", Me.username)

JobStep.SetValue("LANGUAGE", Me.language)

rfcFunction.Invoke(Dest)

Now, I wonder if it possible to retrieve all list of al  the the steps with the job id (JOBCOUNT).

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Henrik,

This is actuallly not an NCo question, but a question about BAPI_XBP_ADD_JOB_STEP and whether the jobs modifed with this function module can be analyzed remotely. Therefore, I'd recommend that you have a look at function group SXBP. In this group, there are all related function modules, e.g. also BAPI_XBP_JOB_DEFINITION_GET, which I think is the one for getting the information you desire.

Best regards,

Markus