Monday 29 June 2015

Dump (System_name : is not a valid attribute type) in starting the Webdynpro Application

During one of the development, I did some changes and tried testing the application when it started givinig below dump. It was not even going into the first screen.

 ST22  was showing the issue in method _GET_ATTRIBUTE_RTTI of class CL_WDR_CONTEXT_NODE_INFO======CP. Putting break point there was of no help as it was in the middle of one standard code. Somethign was realted to a node's attribute but which node, which attribute and how come it was working till 2 minutes ago?

I quickly revised what exactly I have changed very recently. I was adding a couple of extra fields in a table, and after that it stopped working. I went into component and started checkiing each node throughly and there it was.

That table, where I was adding extra fields, is being used as dictionary structure in one of the node and that node's attribute was coming from that table only. I have not done the "Update Mapping" like below and that was the point.

Once I updated the mapping of that node, my application was running as usual.


Saturday 13 June 2015

Disable empty rows coming in Webdynpro ALV

We all have came across the disable empty rows that come at the end of ALV. There may be the case that you are getting values only in 2 rows in ALV, but along with that 8 empty rows are coming.



That, at times can be annoying for customer. Here is the solution.

We have to take help of interface IF_SALV_WD_TABLE_SETTINGS. This has methods named SET_DISPLAY_EMPTY_ROWS (Defines Whether Empty Rows Are Displayed). The parameter for this method is of ABAP_BOOL. So we have to pass ABAP_FALSE as the value in order to restrict the disable rows coming into picture. The default value passed to this parameter is ABAP_TRUE, hence disable empty rows.


Class CL_SALV_WD_CONFIG_TABLE uses the interface IF_SALV_WD_TABLE_SETTINGS. We can get the object of this class using the below code snippet in our hook method WDDOMODIFYVIEW.

Now we can test our WD application again.







Friday 5 June 2015

Default lead selection in ALV in ABAP webdynpro

When we create a ABAP WD application and try to display an ALV, one thing we most commonly see is at the time of display, the first row of ALV comes as selected. This is what we called Default Lead Selection. How we can avoid it ? There can be customer requirement where customer doesn't want to have a default row selected. Below is the answer.

We create nodes in context of Webdynpro component. The properties of that nodes has one attribute named "Initialization Lead selection". That property is responsible for the behaviour explained above. One can check that property and can have default lead selection in ALV/Table or can uncheck it and can avoid the default lead selection. Find below the example.




When we check the “Initialization Lead Selection”



Modify statement going into dump

Weired thinigs happen to you and you are left clueless on the root cause. This happens to me when I was doing routine coding and all ofa sudden Modify statement starts giving dump.


Lots of head scratching finally got to know the reason.

Below is my coding.



The reason is that I was doing loop on one internal table and was trying to upadte the other internal table inside that loop.
The Purpose of MODIFY statement is to modify the internal table content with in the particular loop of the internal table.
The reason for dump is I was trying to modify the unknown internal table directly.
So when I change the coding like in below screen shot, it works.


Deploy ABAP Webdynpro application in SAP Enterprise portal


Requirement: Requirement in one line is to deploy the ABAP webdynpro application in SAP enterprise portal so that any user, who has access to enterprise portal, can access the application.

We achieve this by creating iView (Integrated View) in enterprise portal.

Prerequisite:
  • We need to have an already developed Webdynpro application handy.
  • A connection must be in place between enterprise portal and the ECC server which has your webdynpro application.
  •  You must have the necessary authorization in enterprise portal so that you can see the tabs, folders shown in below figure.
Now follow the below mentioned steps.


Choose the respective system which has the webdynpro application in “search in” field, give application name in “Search for ” field and click on “Go”.

Select the searched application and click on “start Upload”.

Click on “Finish”.

After clicking finish, if you see in left hand side panel in “Portal content”, you can see your iView on last.

Right click on the iView and select properties.



You can see all the properties related to that iView/WD app here.

I got a problem once, when my WD app was not a Z app but it was on some namespace, say /ABC/WD_APP is my WD app. This is not the conventional WD app which starts with Z. In such case we have to search here the “Namespace” property and set our namespace there like below and click on “Save”.
Now test the iView