Web Dynpro

Home / Posts tagged "Web Dynpro"

Web Dynpro – Initial Challenges

Wow, I have to admit, I thought after going through a book and doing some exercises, I’d have no problem converting a BSP application to Web Dynpro.  Was I ever wrong!!!  The learning curve is steeper than I expected.  It is very different, and admittedly, I haven’t wrapped my head around all the concepts of how it works.  But, if you know me, you know that I just keep plugging till I figure it out =)

Initially, I set the goal of “simply” creating the initial login page.  Even that has been a challenge.  I haven’t quite figured out how I can layout a page the way I want.  For example, I’ll have a common header and footer for every page.  I found an application that seems to do just that (or close enough for my initial go-around), but digging through it to figure out what’s happening has been challenging.  I’ve been battling a cold as well, so that certainly makes my brain a little more foggy than usual, but I expected it would just fall into place…  well, not there yet, but I’m still hacking away.

Second was to recreate my navigation tree on the left side of the application.  This again is used for every single page, and pretty much drives the entire application.  This again I thought would be simple.  I did it in BSP, how hard could it be?  Well, pretty hard it turns out.  I’m working to understand the “Context” right now, which if I understand it correctly, is like variables, so my next mission is figure out how to populate the Context variables I created.  The funny thing is that once I grasp the Web Dynpro concepts, it should be a piece of cake because I’ll be able to reuse all of the ABAP methods I originally created for the BSP, just move the data to Web Dynpro…  This will be an ongoing post topic for me, so if you happen to be a Web Dynpro guru, and you recognize something, throw me a bone in the comments.  I’d really appreciate it.

Anyway, that’s all for today.  Thanks for reading,


Web Dynpro Browsers – Not everything is available

One of the biggest frustrations I’m encountering with Web Dynpro (and especially BSP’s) is that they don’t work on web browsers.  So far, I’ve been able to get my simple applications working just fine on Internet Explorer (version 9), but nothing works on Firefox (version 15), I can’t get anything to work on Safari (5.1.7), and only my BSP has been able to run on Google Chrome.  So today I wanted to discuss some of my finding when it comes to Web Dynpro browsers and what is supported.  There are numerous OSS Notes that I’m still sorting through, including:

In addition:  service.sap.com/PAM talks about the availability matrix.  If you navigate to the netweaver, and punch in your specific version (7.01, etc), you’ll see the web browsers that are supported.

I’m still sorting through all these notes, but to provide an application that can be given to your customer is increasingly difficult.  How do I tell a customer, please use my web application, but you can only use internet explorer.  In addition, there are a number of people (myself included) that upgrade to the latest browser when it comes up.  So this means, there will always be a percentage of time that someone won’t be able to access my application.  I welcome any experiences that people have had with this.  Maybe I just don’t have the right support parks.  For example, I’m using ERP 6.0 EHP4, on Netweaver 7.01.  So far, this states that I can use Internet explorer (up to version 9), and Firefox (up to version 10).  Now, if I was using Netweaver 7.3, EHP1, I’d have access to safari & chrome.  Again, this is subject to being on the latest netweaver support pack.  Short story, I’m a little concerned  with selling a Web Dynpro application, because I’m afraid I’ll spend all of my time troubleshooting what releases are supported for the given clients.

Just to throw it out there…  BSP’s are even worse.  Since SAP has stopped supporting the technology.  My Rapier application works fine in internet explorer and Google chrome, but apparently the functionality is too complicated and Firefox & Safari do not support it.  My problem is that I don’t even know what functionality isn’t supported.  I do a lot of dynamic things in my BSP, so it’s a lot areas to focus on.  The question for me becomes, do I focus on correcting the old technology, or just convert it to web dynpro (easier said than done… but that’s another story).

Oh well, gotta do it, but at least I’m getting a better idea of what is and what isn’t supported.

Web Dynpro – Select-Options – Putting Select Options on Multiple Tabs in the Same Window

Well, after spending some actual working on my Web Dynpro application, I’ve already come across my first little challenge.  In my selection screen, I have multiple tabs, each with a set of select-options.  So this ran into my first extension of my skills…

So, it’s not rocket science, but why not share it, just in case it might be able to help you in your endeavors.
So, for more details, check out my other posts on Web Dynpro.  They talk about using select-options, and how to setup the basics.

Building on this concept, I’m going to walk you through the process of adding multiple selection blocks.
First step, go back to the web dynpro component and add multiple component usages.
Now the biggest change is that we will use multiple views.  We will setup one view for each tab (or each selection option).  We will still do all of the same steps, however, the steps take place at a view that will dropped into the main view.
In my example, I have a view for selection screen that contains multiple tabs.  I then have a view for each of the tabs.  This allows me to use a separate component usage in each tab.  This allows me to put different fields on each one and still keep the functionality I want.
Now, the last of the work happens again at the Window.  Now, instead of just embedding the WDN_SELECTION_SCREEN, we will be embedding the single tab view into the ViewContainer, then the WDN_SELECTION_SCREEN inside of that view.

It’s actually pretty slick.  I’m enjoying the flexiblity of Web Dynpro and what it lets me do.  Now if I could just figure out how to get it working in Firefox & Safari.  I have a feeling it has to do with the version of each of those browsers being relatively new.  Either way, I’m still researching, and you can be sure when I figure it out, I’ll let you know…

of course, if you already know the answer, I don’t “need” to struggle… I’ll happily learn from your hard work.  ha ha ha.

Thanks again for reading,


Web Dynpro – Select-Options – writing the code

Here’s the code to do  SELECT-OPTIONS in ABAP Web Dynpro:

* Adding a block (type Tray) to the select-options
i_id         = `COM2`
i_block_type = if_wd_select_options=>mc_block_type_tray
i_title      = `Sales Selection` ).

As promised, I’ll talk about what I leaned in doing the actual method to put the select-options together for a full screen.  Everything I talk about deals with the add_selection_fields (notice the plural).  I had a bunch of fields, so I chose to do them all at once.

Here’s the basics, based on the name of the usage component.  I don’t know all the details on this portion…  but trust me, it works.  it came from SAP.  =)

* reference to the item table for multiple lines.
* reference to the select option usage controller
lo_ref_cmp_usage TYPE REF TO if_wd_component_usage.

* instantiate the usage component, if necessary
lo_ref_cmp_usage = wd_this->wd_cpuse_usage_so_comm( ).
IF lo_ref_cmp_usage->has_active_component( ) is INITIAL.
lo_ref_cmp_usage->create_component( ).

* determine referece to the interface controller
wd_this->go_ic_so_com = wd_this->wd_cpifc_usage_so_comm( ).
* initialize selection screen
wd_this->go_so_com = wd_this->go_ic_so_com->init_selection_screen( ).

If you want to turn off the default buttons that show up for select options.  I wasn’t a fan, but I may change my mind in the future.  Either way, you can turn it off with the following code:

* Hide the standard select-options components.
i_display_btn_cancel = abap_false
i_display_btn_execute   = abap_false
i_display_btn_check  = abap_false
i_display_btn_reset  = abap_false ).

If you want to add a block, here’s the code to do so.  One of the things to note, be sure to capitalize all the letters.  I also found that it worked better being 4 digits.  I tried comsel_1, and it failed, then comsel1, and it also failed.

* Adding a block (type Tray) to the select-options
i_id         = `COM2`
i_block_type = if_wd_select_options=>mc_block_type_tray
i_title      = `Sales Selection` ).

This little code snippet shows you the basics of adding a field.

*** begin building selection screen
*This is the field name
wa_fields-m_id = ‘SRV_MAT’.
* generate range table for data element.  Be sure to make this equal to the data element.
wa_fields-mt_range_table = wd_this->go_so_com->create_range_table(
i_typename = ‘MATSV’ ).
* if you choose to embed the field inside of a context block (box) you can add it here.
wa_fields-m_within_block = ‘COM1’.
* use this line to turn on the drop down for the field
wa_fields-m_value_help_type = if_wd_value_help_handler=>co_prefix_searchhelp.
* here is the search help to use for the field
wa_fields-m_value_help_id = ‘MAT1’.
append wa_fields to lt_fields.
CLEAR wa_fields.

Finally, once you have all of your fields entered, you can call the method.  If you followed all of the steps in my previous post, you should be able to see your select options showing up on the screen.

* generate field in selection screen
it_fields = lt_fields ).

Next up, I’ll talk about adding multiple Select-Options onto the same screen (if you have multiple tabs, this could come in handy).

Thanks for reading,


Web Dynpro – Select-Options – Overview of the process

Finally, I get around to my first post about Web Dynpro.  I’m starting simple and replicating the selection screen for Broadsword, my service dashboard.  So any good selection screen usually has some select options.  So I wanted to pass along my lessons learned and a little bit of code too.  For starters, how do you create the select-options.  There isn’t an object that you can drop onto the screen for SELECT-OPTIONS.  You need to put a little more effort into adding it.

1. Create a create a component on the Used Component Tab of the Web Dynpro Component.  component use:  usage_so (for example) Component: WDR_SELECT_OPTIONS
2. Add the component to the view (properties tab).  Be sure to add both options (one with the controller, one without the controller).
3.  On the layout of the View, add a ViewContainerUIElement to the screen where you want to place it.
4.  Create a method for the View, INIT_SELECT_OPTIONS.  this method is where you will define the actual fields and layout.  We’ll discuss this in more detail tomorrow.  You can use the following methods:  add_selection_field or add_selection_fields.
5.  Update the WDDOINIT method, add the line:    wd_this->init_select_options( ).
6.  Attach the component to the ViewContainerUIelement in the window.  You will embed the WND_SELECTION_SCREEN to the ViewContainer in order to make the connection.

Alright, that’s enough for this post.  Tomorrow I’ll talk about the code for INIT_SELECT_OPTIONS.  Hope this information on SELECT-OPTIONS is useful.


Configuring Web Dynpro in SAP ERP

Well, since creating my new EHP4 system, I’ve had to do a lot of activities.  For me, the most important was getting Web Dynpro working.  I created this whole system with the intent of using it for webdynpro development.  Anyway, again, no straightforward documentation that talks about what needs to happen.  So, here’s my notes on configuring web dynpro in SAP.
First, you need to implement an OSS note:
After applying the note, go to transaction SICF and activate the following services.
Now, you can use the layout designer for Web Dynpro.  It’s that easy.
Hope this helps,

Networking your SAP Virtual Server to the outside world

What can I say?  this one has been on my wish list for a VERY long time, and thanks to a new friend of mine, Brent Brunner, I can finally see my BSP’s/web applications somewhere beyond my local machine.  It is so cool, for first time I know that my Rapier BSP doesn’t work on the Safari browser (not great, but now I can address it).  So for anyone out there, here are the basic steps to accomplish this:

On the Virtual Machine
1.  be sure the network is setup as a bridged adapter.
2.  for that adapter, you need to set the network to be a static IP address.  It doesn’t really matter what address you pick, but you don’t want it changing.  So go into your network adapter and specifically enter the IP address/gateway/etc…  If not sure of all these values, use the CMD prompt and the command:  ipconfig -all  This will give you all the network numbers you need.
3.  find out what port SAP is expecting for <HTTP Port>.  You can use transaction SMICM.  by default, the value is 8000.

On your router settings:  (I’m not going into much detail here since very router is different).
1.  find your primary machine.  You need to set this as a static IP address.  It should match the IP address you chose on the virtual machine.  On my AT&T Uverse box, I went to LAN–>IP Address Allocation.  I found my actual computer, and set it to the IP address from step 2 above.
2.  you need to define some exception ports.  Is should be the same port you found in transaction SMICM.  For this I went to Firewall–>applications and I clicked add a new application.  Then I filled in TCP/IP and the ports I wanted to exempt.  Then I selected my main system, and attached the applications.

Find your public IP address
1.  You can use the website:  www.whatismyIP.com  this is now the IP address that the outside world can use to connect to your system.

On your hosting site (for me it was hostgator).
1.  create a subdomain = to your virtual system name.
2.  Create a DNS entry for your subdomain.domain = your public IP Address
3.  Wait 12 – 24 hours for the changes to propogate through the web.  (this was the part I hated, because I didn’t know if it was working).

Accessing your stuff.
now any BSP’s or anything like that, you’ll need to first give the server, so it will be the subdomain.domain:<HTTP port>/sap/bc/…

I hope I’m not forgetting any steps.  I don’t pretend to be an expert about this, but I’ve spent the last 24 hours learning from Brent and trying to make it all work.  Now as of tonight, it’s all working.  Very exciting to a geek like me.  Here’s my disclaimer.  I’m fairly sure my network is still secure, but like anything, when you open doors, someone could get in.  Make sure your anti-virus software is up to date, and keep on the lookout for anything strange.  Who knows?  I might have to turn it off at some point and pay the $$$ for a VPN to do the same stuff, or other such fancy networking stuff.

Thanks for reading…

And a special thanks to Jeremy Meier…  without your connection, i’d still be stuck with a local machine 🙂