Skip to Content
Hope you have your code handy from the {code:html}Creating Blackberry Apps with WebWorks and BSP – Part 1{code} of this blog series as you’ll reuse all or most of it. What we’ll be doing in this part is creating a BSP application and among other activities dumping the html pages there and then calling the BSP application from our app instead of calling the local html pages. I’d like to take a moment and emphasize on the fact the opportunities that this framework among others have opened; connecting to a SAP system through a Blackberry mobile device. In my opinion, Blackberry currently have an edge in the enterprise market compared to other smart phones, making it easier to roll out solutions to existing devices as compared to rolling out devices first and then the solutions and on top of it, providing a secure and dependable connection. Once the connection is established, most of ABAP techies will feel at home and can do almost everything within the BSP. Only sky (and the connection speed/page loading) is the limit! 🙂 Now let’s get started with the BSP application!

h3. Creating BSP application get_form_fields( changing fields = lt_fields ). read table lt_fields into ls_fields with key name =’assetnumber’. if sy-subrc = 0. move ls_fields-value to ls_assetdata-equnr. CALL FUNCTION ‘Z_EQUI_HANDLER’ EXPORTING IS_ZSEQUIDATA = ls_assetdata IV_ACTION = ‘READ’ IMPORTING ES_ZSEQUIDATA = ls_assetdata. * ES_BAPIRET = if sy-subrc = 0. lv_view = create_view( view_name = ‘AssetList.htm’ ). lv_view->set_attribute( name = ‘is_assetdata’ value = ls_assetdata ). call_view( lv_view ). else. lv_view = create_view( view_name = ‘MainView.htm’ ). call_view( lv_view ). endif. else. lv_view = create_view( view_name = ‘MainView.htm’ ). call_view( lv_view ). endif. Activate the controller class as well as the BSP application and test it out again in the browser. You should see similar results as we saw in {code:html}Creating Blackberry Apps with WebWorks and BSP – Part 1{code} of this blog.

h3. Preparing application launcher in Eclipse I would suggest you make a copy of the AssetTag app as we’ll be deleting most of the information off of it or create a new project under the name ‘AssetTagSAP’. All that we need in this new project is a html which calls our BSP application on ‘body’ tag’s ‘onload’ event, associate the icon and set permissions. For the sake of not worrying about manually typing in information and setting things over, I am copying the ‘AssetTag’ project and delete the objects which are not required. You only need to keep the ‘MainVeiw.htm’, ‘config.xml’ and ‘SAPIcon.png’ image. Do make sure all the entries in the ‘config.xml’ are copied over, especially in the permissions’ tab and while you are there change the domain ‘*’ to your SAP server (e.g. https://test.com (https://test.com/)) and check the ‘Apply access request to subdomains’ check box. The last thing to do here is to add ‘blackberry.ui.menu’ feature to this domain. After deleting objects from the new package, the final package should look like

To report this post you need to login first.

14 Comments

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

    1. Asim Mian Post author
      In most cases, when the BSP is called, it will prompt you for user name and password, just as you would call a BSP from a browser.

      Where are you calling the BSP from? Browser, Simulator or an actual BB device?

      Regards,
      Asim

      (0) 
      1. Ashok Dhayalaraj
        Hi Asim,

        I am calling from the Blackberry Simulator which is automatically called when we run the program from the Eclipse webworks application as you had told in part1.

        Thanks,
        Ashok

        (0) 
        1. Asim Mian Post author
          and it doesn’t prompt for a user name and password? What does it do? You need to explain a little bit more of the symptoms.

          Needless to say that you have to manually provide the user name and password when prompted for authentication credentials. Unless you have SSO, in that case you can load your certificate in the simulator and then call the BSP.

          If you see Part-3 of this series, I also talk about proxy settings that you need to set before you can access internet in general.

          (0) 
          1. Ashok Dhayalaraj
            Hi Asim,

            Sorry. I am unable to attach screen shots. When I run the html page generated in the browser, it prompts for the user name and password and I am able to see the BSP. But, when I am running the same application using the blackberry simulator, it does not prompt anything, but directly gives the message that call to the BSP URL failed due to logon data. I am not sure whether any specific settings are needed. This uses blackberry simulator 9550.

            If you can share with me your email address, I can also send a screen shot to you.

            Thanks and Regards,
            Ashok

            (0) 
          2. Ashok Dhayalaraj
            Hi Asim,

            Also, I am able to see any normal webpage on the simulator’s browser.

            Please let me know if I need the blackberry enterprise service on my corporate network to perform this activity.

            Thanks and Regards,
            Ashok

            (0) 
  1. Alejandro Willers
    Hi Asim,

    Very inspiring. Congrats!

    Question: Which ABAP class can I take as model for creating ZCL_BB_ASSETTAG class? Is there someone which implements all the exposed interfaces?

    Best Regards & Thanks.

    (0) 
    1. Asim Mian Post author
      Thanks Alejandro!

      If you start from within the BSP application, all you have to do is double click on the name of the controller class and it associates it with CL_BSP_CONTROLLER2 (less work) otherwise you can always start from SE24 and create a new class with superclass as CL_BSP_CONTROLLER2.

      Hope this answers your question.

      Regards,
      Asim

      (0) 
      1. Alejandro Willers
        Hi Asim,

        Thank you for your help. It was usefull and I could take some progress on your idea.

        By the way, I found an issue I’m not sure what’s about: I perform all mentioned in your blog. When I start the application the following message appears:

        “Could not select proper transport descriptor for: [nameserver].[domain]:8000/sap/bc/bsp/sap/zbb_assettag/main.do”

        Any idea? Does we need BES implemented, or why can connect directly through http?

        One clue: if I connect via browser I can connect.

        Thank you in advance!

        Alejandro

        (0) 

Leave a Reply