Becoming an SAP Web Developer, Part III
So, were are we now? Well we’ve still got to find the information we need and get the information we want. So where did we start and where did we look?
Here’s some of the searches and websites we found in the hope of finding what we needed.
I know it must seem a little sacrilegious to show SDN last, but in all honestly it’s not been until recently that I’ve been finding information to help here.
Back to our primary question…
How to get data dynamically from a system without having to create several FMs and do a lot of transporting. Here is another approach we took, now granted this one is very very DANGEROUS and I would recommend a serious dicussion with your security people before implementing it at all. The FM we found is called “RFC_ABAP_INSTALL_AND_RUN”, now I won’t go into great details of using it as I don’t want to encourage it too much. However, if you find that you are running out of choices like we were, see note 514998. So combining the use of this function or the other one (“RFC_READ_TABLE”) that is not authorized and a table listing all of our SAP systems (ZSYSTEMS) we were then able to make the BSP work similiar to the JSP page and we found that it was actually a bit easier with the BSP than the Java. Especially since our system table was not available to the Java program.
I know that at some point I said something about sample code, however, due to the comments this Web log series generated regarding the use of non-authorized FM modules I could not simply hand out the code samples, sorry I just wouldn’t feel right about it.
However, I can share with you the final result of our application. Perhaps not in code samples but in description. Of course the problems that came with it as well 😉
Final solution to the user list application.
We created a very simple FM module that retrieved a very simple table structure using the CLIENT SPECIFIED option consisting of the mandt, bname,and trdat. This FM module was called for each system in our ZSYSTEMS table during a loop. We then did a loop on the results of this FM call. The loop of course then output the information we wanted and determined the graphical view based on TRDAT.
To determine the date information we simply did the following.
style=”left:50px;width:350px;font-size:9pt;background-color:#C0C0C0″> DATA: myGreen type i,
myYellow type i,
myRed type i,
myDate6W type sy-datum,
myDate3M type sy-datum,
myDate6M type sy-datum.
myGreen = 0.
myYellow = 0.
myRed = 0.
myDate6W = sy-datum – 42.
myDate3M = sy-datum – 90.
myDate6M = sy-datum – 180.
followed by a simple IF ELSE for the output and the incrementing of a counter to then show totals at the bottom of the page.