cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger SAP Job through Javascript

former_member730404
Participant
0 Kudos

Is it possible to trigger a job through an external webpage? I have found this, but I am not sure it is what I am looking for. I am new to SAP and ABAP, so my knowledge is limited, however, it seems to me the post I linked would need to be created internally through SAP/ABAP, correct? Am I able to just have a standalone program/index.html file trigger a job? For example, through pressing a button on the page.

Thanks

Sandra_Rossi
Active Contributor

You're correct, both approaches use BSP (for CRM Web UI), which execute in ABAP backend (generate Web page and process user actions).

One solution would be to create a Web service In the ABAP backend to trigger this job.

But could you explain what kind of job do you want to trigger?

former_member730404
Participant
0 Kudos

Hi sandra.rossi ,

This is more so a proof of concept stemming from this post I made a little back. Essentially what needs to be done is I need to allow the user to trigger a job through SAC without giving them elevated perms. One way this could be accomplished would be to insert a link into the SAC story, wherein the user could press a button to trigger the job in SAP BW. I am not 100% sure what you mean by 'kind' of job, but I think right now it is ambiguous. As long as a specific job gets triggered, then I would consider it a success. If it is important, then I can inquire further on the kind of job needed. Hope this helps.

Thanks,

Alex

Sandra_Rossi
Active Contributor

Maybe SAP BW has special features but generally speaking, creating a Web Service which calls ABAP which triggers a job can be done in several ways:

  1. create a RFC-enabled function module which launches whatever you want, a job, etc., wrap it into a SOAP Web service (http://.../sap/bc/soap/rfc)
  2. or create your own ICF service with any ABAP code (called via http://.../what-you-want)
  3. or use RFC wrapper (http://.../sap/bc/soap/rfc) with BAPI_XBP* function modules

(http aliases can be created to change the path)

former_member730404
Participant
0 Kudos

Hi sandra.rossi,

Thank you! This is very helpful. Would you be able to elaborate on the 2nd option a little bit for me? I am having a little trouble figuring out where to start.

Thanks,

Alex

Sandra_Rossi
Active Contributor

Sure.

Concerning option 2 - ICF service:

  • Create a class which implements IF_HTTP_EXTENSION, and implement its method HANDLE_REQUEST. The parameter SERVER contains the HTTP request you receive and the answer you need to fill.
  • Create a new ICF service (node) via transaction code SICF at any path you want, attach your class as handler, then activate the ICF service.

There must be many resources about this topic in the Web.

former_member730404
Participant
0 Kudos

Okay, I think I understand now. Thank you for your help!

Accepted Solutions (0)

Answers (0)