cancel
Showing results for 
Search instead for 
Did you mean: 

Table view - Approve Button - Popup

Former Member
0 Kudos

Hi Gurus,

I have a table view which is having a button called "Approve". Once its clicked, a popup should be opend with OK and CANCEL. If I click on OK, it has to take the particular row, which is selected from the table view, and update the Dictionary table. It is working fine without popup ( like once the approve button is clicked am taking the row values thru get_static_attributes, and updating the ztable.) But If I put the same statement in OK event handling of POPUP, its not wokring and throwing an error "Access via 'NULL' object reference not possible. " Please suggest me how can I fix it.

Thanks,

David.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi david......

hope you will know the process of the pop up window. consider you are in a view 'A'. one you call a pop up, the window will be called but at the same time, the other methods like 'wddomodifyview' will be run in the background... so this method might be containing the coding which has to be processed only after you press the 'OK' button in the pop up window. that is why you are getting' Access via 'NULL' object reference not possible' error. so make sure that your logic works fine.

---regards,

alex b justin

Former Member
0 Kudos

Hi Alex,

Do you mean the mdmodify code should be like this?

method WDDOMODIFYVIEW .

onclickok( ). (Here do I need to code for click on OK??)

endmethod.

Please let me know in detail if I'm wrong.

Message was edited by:

david santi

Former Member
0 Kudos

Hello David,

Why don't you try debugging your code to find out the exact place where you are getting this error. It would help us understand your problem better.

Regards,

Neha

Former Member
0 Kudos

Hi Neha,

The error is coming at

Elem_Plan->get_static_attributes(

IMPORTING

static_attributes = stru_order ).

I have put this code in OK event handling of Popup view. But the table view is in different view. I think am getting the error bcaz of this as the above statement is expecting rows in that view itself. I just wanted to know how to access the details of other view being in popup window. Please help me.

tina_yang
Explorer
0 Kudos

David,

From what you described, you should create this context node on the component controller, map this context node to the table view and have the table bind to this mapped context node. Also you should create a method on the component controller to retrieve the selected context element from this context node then update DDIC. This way, when popup view's ok button is clicked, you can call wd_comp_controller-><the update method> to update the data.

Hope this helps,

Tina Yang

Former Member
0 Kudos

David, is the context node ORDER present in your popup view?

Former Member
0 Kudos

Yes, Andre

Former Member
0 Kudos

David, can you post more details of this node (cardinality, Initialize Lead Selection, etc), as well as the code where the error is happening.

By the way, you said you put the "OK" handler in your popup. I believe it would be better if this code were in the caller view, as described in <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40794172-b95a-2910-fb98-b86d8a0918b4">Quick Tips and Tricks on Web Dynpro for ABAP - How to use ALV and Pop Ups</a>. At the end of page 8, it explains how you can handle the "OK" and "CANCEL' button clicks.

Hope this helps.

Andre

Former Member
0 Kudos

Thanks all. its working fine.

David.

Former Member
0 Kudos

Hello David,

Where is the code for the event handler located? It should be in the controller where the context nodes are defined. 'Acces via NULL object reference' could in your case mean that you are trying to access a context node which was not found in the context of your controller.

Regards,

Neha

mohammed_anzys
Contributor
0 Kudos

Hi David,

The problem may be coz of the view name which you have mentioned while calling the pop up or the view method name ( for the action OK,Cancel ).Please

write your code here so that we can debug

Thanks

Anzy