Sometimes, we might want to use jquery in our bsp applications to create some pretty views with animation. But if you couldn't load it correctly, it might be very annoying. Thanks to SAP's Automatic Delta Handling (ADH) in BSP applications, when the page loads We can load it multiple times unnecessarily and call respective functions multiple times, after you might end up with a messed up view. Here are some tips to use jquery correctly, to keep you out from these troubles.
- First of all, we need a pyhsical path to our jquery library in our sap systems. To do that;
- Download the latest jquery library: here.
- Create a new BSP Application through transcation SE80.
- Create a Subfolder under standart MIMEs folder.
- Upload your library file
We need to check if the library is already loaded into bsp file.
So let's have a look at that bsp application that we want to use jquery:
- Check the library is already loaded.
- If it is not; create a script tag in html and set the attributes, respectively for you MainJS file.
- Afther the loading is finish, call the function whic is in MainJS file and load the jquery library.
For the last thing, You need to disable ADH (Automatic Delta Handling) for your bsp application to run everything smoothly. To disable ADH you can check this wiki page and learn more.
So now, you can use jquery in this bsp without messing up the view itself.