Skip to Content

In my first SDN blog I write about using ABAP RFC function modules in SAP NetWeaver Visual Composer and how to solve issues. In the last weeks there were a lot of threads in the SDN SAP NetWeaver Visual Composer Forum about RFC or BAPI issues. There were some threads about “BAPI/RFC does not work” or “There is BAPI available for…” and so on. That’s the reasons, why I decide to write a blog, where I demonstrate you how to build an Visual Composer application, which uses ABAP RFC function modules for displaying BI master data. Then I extend this application with a search function and the possibility of modifying the master data. I also use this application to show you, how useful it is to use external debugging. After I finished my blog I noticed, that this blog became a big blog, that’s why I split it into two parts. For an overview I add a table of contents and a list of the system requirements. You can download the whole blog as a PDF from our company website. The hyperlink is at the end of every blog.

Table of Contents

First Part of the SDN Blog

Connection Lifetime in the Visual Administrator
Create an InfoObject for our example
Create a RFC function module for displaying master data in Visual Composer
Adding example master data in the backend system
Create the Visual Composer Model for displaying master data
Search function

Second part of the SDN Blog

Create another RFC function module for modifying master data
Add “Modify master data” feature to the Visual Composer model
External debugging of RFCs or BAPIs

System requirements

SAP NetWeaver 2004s BI SP08
SAP NetWeaver 2004s EP SP08
Internet Explorer 6 SP2 with flash plugin
MSXML Parser 4
Adobe SVG Viewer 3

First Part of the SDN Blog

Connection Lifetime in the Visual Administrator

Everybody who has already worked with RFC function modules knows the issue, that after a changing of the import or export parameters in the backend system, Visual Composer doesn’t realize the changing in the backend system.

Also the modification of the setting in Visual Composer under Tools > Options > Compiler > Data service retrieval to “Do not cache data service (get latest)” has no effect. Other advices, like restarting the J2EE engine or renaming the function modules were not practicable. Therefore I contacted the SAP support and asked them for a better solution. Expecting that there must be a setting in the J2EE engine which defines when the metadata is read from the backend system. In the end, this was confirmed by the SAP support.

The following pictures illustrate the settings in the J2EE engine.

setting in the Visual Administrator
Click on the picture to enlarge it.

In the Visual Administrator you can change the “Connection Lifetime” as shown in the screenshot above. You can set an interval (in seconds) for updating the metadata of RFC function modules with the backend system. I tested it on our system, which is used by our R&D department and other users, so that I can say, I had tested the system with the new setting under stress. I set the connection lifetime to 60 seconds, so that we can use a changed RFC after approximately one minute. I recommend everybody developing Visual Composer applications with RFC function module to also change this setting, so that you have the latest function module available in your models after approximately one minute.

Create an InfoObject for our example

After logging into your BI system via SAP GUI, you can create new characteristics using the transaction “RSA1” (the screenshot shows the transaction RSA1).

create an infoobject / characteristic

The characteristic gets the technical name “ZZ_BLOG” and the long description “Characteristic for the SDN Blog”.

create an infoobject - technical name and description

For this example I use the Data Type NUMC with the length of 8 and an ALPHA conversion Routine.

general settings of the infoobject

Under the “Master data/texts” tab we change the settings as shown in the following screenshot, so that we have only a numerical key with short and medium length texts.

settings for master data / texts

To finish this action, you have to activate the InfoObject by clicking on the activate button (as shown in the symbol below) or by using the shortcut CTRL + F3 on your keyboard.

activate the infoobject

After activating the InfoObject you can look up the name of the table where the texts have been stored (red framed in the screenshot).

table name

Create a RFC function module for displaying master data in Visual Composer

The next step will show you, how to get data from a BI backend system into Visual Composer with using a RFC function module. Therefore, log on to your backend system and start the SE80 transaction.

In the Object Navigator navigate to “Local Objects”. Your user must have a function group, if not, then you create a new function group. Below the function group you can add function modules. Then create a new function module by right clicking on the function module folder as shown in the next screenshot.

creating a function module in SE80

You have to enter a technical name and a description. In this example our technical name is “ZZ_SHOWTEXT” and the description “SHOW BI TEXTS IN VC”.

Then go to the “Attributes” tab to the section ”Processing Type” and change the selection from “Normal Function Module” to “Remote-Enabled Module” as shown in the following picture.

change the attributes setting of the function module

Afterwards, click on the tables tab and enter a table parameter as shown in the following screenshot. The associated type is like the text table in the InfoObject.

image

Now we need a short and easy ABAP Coding to get the data into our T_TEXT_TABLE. Therefore change to the source code tab and enter the following code:

SELECT * FROM /BIC/TZZ_BLOG INTO CORRESPONDING FIELDS OF TABLE T_TEXT_TABLE.

That’s it! Now you have to activate it and it’s ready for usage in Visual Composer.

Adding example master data in the backend system

After activating this function module the first step is to enter data in the “RSD1” transaction. You have to enter the technical name of the InfoObject “ZZ_BLOG” and then you click on the display button.

transaction RSD1

Then select “Maintain” by clicking on the button or by using the shortcut F6.

Maintain button in RSD1

On the next screen, click on the clock or use the F8 button for the next screen.

F8 or the clock symbol

Now we add some data records by clicking on the create symbol (blank white sheet) or by using the shortcut F5.

add master data

As you can see in the picture below, I added six data records for our example application in the Visual Composer.

added master data

Now we have all the things we need to test our RFC in Visual Composer: The RFC function module and some example data in the SAP Netweaver 2004s BI backend system.

Before you can use the RFC in your Visual Composer you must connect to the BI system using the Enterprise Portal.

I assume that you have already configured your BI system in the portal, so that you have access to the RFCs and BAPI. If not, please refer to of the configuration documents and how-to’s addressing this topic..(You can also find them in the SDN)

There is also further information available under:

http://help.sap.com/saphelp_nw2004s/helpdata/de/9b/3ac52d74cf4c43b1cf3a71725c951f/frameset.htm

(Defining Portal Systems and Aliases)

Create the Visual Composer Model for displaying master data

Now we start the Visual Composer and test our ABAP RFC function module.

Login into Visual Composer and create a new model. Then create a new iView.

create an iView

Drill down into the iView. Select “Find Data” in the task panel toolbar. Then choose your system for RFCs and search for already the created service “ZZ_SHOWTEXT”.

use the RFC function module in the storyboard

Drag the service into the storyboard and add a table as shown in the following screenshot.

Add table view

The next step is to create an input form.

Add input form

Then select the input form as shown in the screenshot above. Now you can change the layout of your application as shown in the next screenshot.

Customize the layout of the application

After finishing this task, deploy your application by clicking on the deploy button.

deploy the model

In a new window of the Internet Explorer you get the result in the Enterprise Portal as shown in the next screen shot.

the deployed application

Now you get the data from backend system via RFC. If you have more then six records you get several problems as you need a long time finding the correct record. If you even have thousands of records you will reach the limit of Visual Composer or you will have a very bad performance. Therefore you can add a search function, which means changing the ABAP RFC (adding a search function).

Search function

For adding the search function I had to add an import parameter to my RFC function module. I go back to the transaction SE80 in the backend system and edit the function module “ZZ_SHOWTEXT”. I add an import parameter for our search string as shown in the next screenshot.

Import paramaters

Then I changed the coding as shown below for our search function:

Then I changed the coding as shown below for our search function: FUNCTION ZZ_SHOWTEXT. *"---------------------------------------------------------------------- *"*"Lokale Schnittstelle: *" IMPORTING *" VALUE(I_SEARCH_STRING) TYPE STRING *" TABLES *" T_TEXT_TABLE STRUCTURE /BIC/TZZ_BLOG *"---------------------------------------------------------------------- * we need a local variable for our serachstring data: l_condition type string. * Concatenate the search condition CONCATENATE '''' I_SEARCH_STRING '''' INTO l_condition. CONCATENATE 'TXTSH =' l_condition INTO l_condition SEPARATED BY SPACE. SELECT * FROM /BIC/TZZ_BLOG INTO CORRESPONDING FIELDS OF TABLE T_TEXT_TABLE WHERE (l_condition). ENDFUNCTION.

Now we go back to Visual Composer and replace the old function module with the modified function module. Therefore I select “Find Data” in the task panel toolbar. Then I choose the system and search for the modified function module. Then I put the modified function module on the storyboard and remove the old function module, because there is no refresh functionality available for function modules. After replacing the old function module, the function module on the storyboard must have an import parameter as shown in the screen shot below. Visual Composer realizes the modification of the RFC function module after a minute (if you have set your connection pool time as I described in the beginning of this blog).

replace the import parameters

Then add an input field in the input form for inserting the search value. Select the form and click on the plus button in the task panel toolbar. Choose an input field and enter a name for the field as shown below.

adding input field

Select the transition between the form and the RFC and select configure in the task panel toolbar. You have to assign the search value as import parameter as shown below.

assigning parameters

Finally, you have to customize your layout with the drag & drop functionality of Visual Composer this is quite easy.

customize the layout

After customizing the layout, I have to deploy the application with the new search function. When I search for my name I getonly the record with my name as the result (shown in the next screenshot).

the deployed application

This application demonstrated you how to use ABAP RFCs in your Visual Composer application. If there is no function available in the SAP standard you have to create it for example with ABAP, you can also use other technologies like a webservice.

That was the first part of my first SDN blog. The whole SDN Blog can also be downloaded from the IBSolution webserver as a PDF file. You can download it the blog here: Download the Blog from the IBSolution Portal

To report this post you need to login first.

15 Comments

You must be Logged on to comment or reply to a post.

  1. Kiran Kumar
    Hello Marcel,

    Thanks for the great blog! I am sure Visual Composer is becoming a hot favourite not just among Business Analysts, but also among Developers. We know that it was initially (I don’t know if it is still) intended for Business Analysts to create quick demos and not for a real productive application development. I don’t really know SAP’s current pitch in this area.

    I thought I’ll ask you since you seem to be involved with VC and looks like you are using it for a productive application. Can you please share what you think about versioning challenges for VC application? As per me, if there isn’t a versioning capability, then its not meant to be productive, what do you say about that?

    Does anyone hear of SAP working on versioning tool for VC applications?

    Thank you,
    Kiran

    (0) 
    1. Marcel Salein Post author
      Hi Kiran,

      I’m glad that you enjoy my first blog.
      You are right. I use Visual Composer for a procutive application. I think that I will post a part of this application in the BPX Community
      (SAP xApp Analytics: Composite Applications Resource Center).

      I’m agree with you, that Visual Composer need a versioning tool. At the moment it’s only possible with a workaround. Exporting and Importing the model, but this produces of course an overhead in the developement.

      I also think it’s a great issue that everyone on the system, which develops with Visual Composer can call its model like another existing model.
      On our education system you find a lot of models called “test”. You can imagine, that it’s not easy to find the correct model.

      There are of course some issues about developing with Visual Composer, but I think this is the tool of the future and that’s why I can recommend everyone to gain experience in developing Visual Composer applications.

      I hope I have any time in the future to post some application or blogs about my experience in developing Visual Composer application. I can hardly wait until the next release of Visual Composer!

      Best regards,

      Marcel

      (0) 
    1. Marcel Salein Post author
      Hi Vitaliy,

      thanks. I’m glad that you enjoy my blog.
      My experience with VC in the last half year is that the tool is very stable. There are some issues which makes me sometimes crazy like the 32k issue. But this should be fixed with the next release of Visual Composer. I got the information from Mario Herger, a former developer of SAP Visual Composer.

      I also think that the opportunities of Visual Composer are unlimited to build the business applications of the future, because you can connect all systems to the SAP Enterprise Portal resp. Visual Composer. Also the tool can be used from an expert or from a business analyst without knowledge of any programming knowledge.
      Visual Composer is since 2-3 years available and for this short time I think it works fine and is on a good way to replace the Web Application Designer in the next years.

      If you haven’t worked with Visual Composer yet, then do it now and I promise you: You will enjoy it.

      Best Regards,

      Marcel

      (0) 
      1. Witalij Rudnicki
        Hello again!
        Encouraged with your promise of the tool’s stability (I must admit it is:) and simplicity of your example, I started VC today *for the first time* on our Discovery Server (https://www.sdn.sap.com/irj/sdn/developerareas/esa/esadiscovery).
        Unfortunately, I was not able to follow your blog – I stucked with Function Module creation because … user Admin has no developer key yet in our system 🙂
        Nevertheles, comments:
        – It took me quite a while to find how to start Visual Administrator; it could be good to have a link to related page in help.sap.com (I am not able to find it again).
        – My BW system is shown as “SAP BI System” in Find Data Services, so not “Look for a service by name” appears, but “Find query”, “Display Roles” etc. I assume it should be defined somehow differently. Any hint how?
        Best Regards!
        Vitaliy
        (0) 
          1. Witalij Rudnicki
            Hello Marcel,
            Indeed, you mentioned this link in your weblog already (btw, it is in German 😉

            But from the new-bee to all this stuff I (and hope others like me) would really appreciate an appendix to your weblog (part III) on how to define BW system properly for Visual Composer.

            Because I tryed to follow your directions and tryed to understand by clicking, but at the end … removed existing BW portal system.

            Thank you for your time!
            Vitaliy

            (0) 
            1. Marcel Salein Post author
              Hi Vitaly,

              I noticed it and will work on the third part next in the next two weeks. Maybe I have some time in the evening at office to do that.

              Best Regards,

              Marcel

              (0) 
  2. Bhavik Devisha
    Hi,

    Here, this question is not related with Visual composer but its related with the system restart required when we re-import a model.

    This is a generic problem. In webdynpro application also whenever we re-import a model and there is any change in metadata, we have to restart J2EE Engine. for webdynpro applications, we use JCO Metadata and JCO modeldata for the connection with SAP system.

    Do we have any similar properties for JCO Metadata connection? Or can we re-use Connector container service available in visual administrator for RFC connection from webdynpro?

    Thanks in advance,
    Bhavik

    (0) 
    1. Marcel Salein Post author
      Hi Bhavik,

      I’m out of office. Maybe you can verify your expectation about the setting, when you try it out.

      If it works please let me know.

      Best Regards,

      Marcel

      (0) 
  3. Projet Oscar France Printemps
    Hello Marcel,

    and thanks for your excellent contributions.

    I had a question regarding a scenario where multiple users would maintain 0MATERIAL attributes at the same time. With the CL_RSDMD_UPDATE_MASTER_DATA class users can enter new data or update existing entries, however how would they activate these afterward?

    Have you ever handled such a scenrio?
    If so did you use
    CL_RSDMD_ACTIVATE_MASTER_DATA class to activate master data?
    and if so, how did you handle locks on master data table in case of multiple simultaneous activations?

    thanks in advance!
    Christian

    (0) 
    1. Marcel Salein Post author
      Hi Christian,

      there are several ways to do this and it depends on your data model as well. At the moment I’m very busy, that’s why I can give you only a short answer.
      There is a function module RSDMD_MD_ACTIVATE
      to activate master data.
      I hope this help!

      Best Regards,
      Marcel

      (0) 
  4. Raoul Shiro
    Hello Marcel,

    Thank you very much for your post.

    I have a question regarding impact in terms of performances of VC applications on the Portal.
    Our developers team will very soon deploy Visual Composer 7.0 applications on our Portal Production environnement.
    I have been asked to check whether the current portal configuration will be able to handle the additional worload …
    In my opinion, the only way to determine the impact on the portal of the iviews executed on the Visual composer Runtime is to perform a stress test.

    I’ve proposed the Microsoft Web Application Server Tool to our developement team, but I’ve been answered that this tool can’t help measuring user interaction

    Apparently, the MWAS tool is just simulating user interaction with a web application by crafting POST and GET HTTP requests. On the other hand, the flash application doesn’t care about HTTP requests it is just a Flash Virtual Machine hosted by a single web page.

    Unless we can emulate user interaction in the stress test, Ithe results of the tests will be meaningless.
    Do you know any other way (or tool) to measure user interaction and therefore to perform a relevant stress test ?

    Thank you for your attention.
    Best Regards.
    Raoul

    (0) 
    1. Luis Felipe Lanz
      Hi Raoul,

      There is a GoLive check procedure for Visual Composer applications, that include all the steps to perform the validation on application and confirm that it can be used without any impact.

      To request this service you must contact SAP Active Global Support.

      Regarding the tool, i’d recommend you to use the HP LoadRunner with your SAP Solution Manager system.

      Best Regards,
      Luis

      (0) 
    2. Marcel Salein
      Hi Raoul,

      as Luis mentioned there is the offer from SAP for a GoLive check. I know this from my projects, especially in big projects with a world wide bigbang we had also this go live checks from SAP.
      I can recommend you this go live check.

      Best Regards,
      Marcel

      (0) 

Leave a Reply