Additional Blogs by SAP
Showing results for 
Search instead for 
Did you mean: 
Community Administrator
Community Administrator
As we finished up in the How I Started with SAP Web Development, Cont'd from this series, we see we're once again down, I do believe we stand at SAP 2 and Web Developer 0. You are probably like me and asking yourself why bother continuing, the program is finished now and works. Well, remember it does use a FM that is not supposed to be used. Again, this is the tiring learning phase where you decide what way you want to develop. So back onto the BSP, you know the one that works perfectly well using the FM you are told not to use.

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.

Web Searches: Sites: 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.

So needless to say we all know that searching the Net can be at times tedious and down right boring so how do you filter the data? Well I prefer the classic - click open every window and see what comes up - approach. But I have a pretty fast connection and a pretty powerful PC so this works for me, you however, might want to start trying to refine the searchs and/or focus more on the message forums. I would also recommend using some sort of journal or knowledge base to start adding the interesting tidbits you come across. I've got a rather nice Lotus Notes Journal database with several code snippets, website links and documents stored in it.

There were a lot of forums out there, and you could conceivably find everything you need to know there but I do recommend looking through the rest as well; and seriously recommend starting your own journal or knowledge base.

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.