Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Clear context in Web Dynpro

Former Member
0 Likes
555

Hi,

I have created a table based on search crieteria.

The scenario is first time e.g user has given some selection, it will return 5 records. These 5 records will be displayed in the table.

Now, if user enter some selection, which does not return any record, in that case i'm displaying the error message.

For displaying the message, i'm using get_element_count method, if it's > 0, then it displays the table else display the error message. But the problem is even in second time, if there is no record return, get_element_count mehtod return 5 records of the first search.

How to clear the context, or how to proceed. I can change my condition for a temp solution, but pls let me know what is the best way to do this.

Thanks,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
442

HI,

remove context function removes all the contexts and gives the value under main nide.

where are change context we can explicitly specify under which context should the value should be...

Your problem will solve here

http://help.sap.com/saphelp_nw04/helpdata/en/ea/c1f1c4f47011d19a600000e8a4b41d/frameset.htm

For more information...

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/0f6991e5-0901-0010-e0b0-dc2...

Just check this one also...good blog on context handling...

Remove context is different from the Context change.

Remove context does, it removes all the upper nodes of that particular node

where as Context change is used to set the context for that particular fields to satisfy the conditions

Context Change

http://help.sap.com/saphelp_nw04s/helpdata/en/35/fb8c4057d5701de10000000a1550b0/frameset.htm

Remove Context

http://help.sap.com/saphelp_nw04/helpdata/en/1f/ea0fb12403844bbb6c4cbc8a00cda9/content.htm

else use the Invalidate() function

Thanks

Suresh

Hi,

I have created a table based on search crieteria.

The scenario is first time e.g user has given some selection, it will return 5 records. These 5 records will be displayed in the table.

Now, if user enter some selection, which does not return any record, in that case i'm displaying the error message.

For displaying the message, i'm using get_element_count method, if it's > 0, then it displays the table else display the error message. But the problem is even in second time, if there is no record return, get_element_count mehtod return 5 records of the first search.

How to clear the context, or how to proceed. I can change my condition for a temp solution, but pls let me know what is the best way to do this.

Thanks,

1 REPLY 1
Read only

Former Member
0 Likes
443

HI,

remove context function removes all the contexts and gives the value under main nide.

where are change context we can explicitly specify under which context should the value should be...

Your problem will solve here

http://help.sap.com/saphelp_nw04/helpdata/en/ea/c1f1c4f47011d19a600000e8a4b41d/frameset.htm

For more information...

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/0f6991e5-0901-0010-e0b0-dc2...

Just check this one also...good blog on context handling...

Remove context is different from the Context change.

Remove context does, it removes all the upper nodes of that particular node

where as Context change is used to set the context for that particular fields to satisfy the conditions

Context Change

http://help.sap.com/saphelp_nw04s/helpdata/en/35/fb8c4057d5701de10000000a1550b0/frameset.htm

Remove Context

http://help.sap.com/saphelp_nw04/helpdata/en/1f/ea0fb12403844bbb6c4cbc8a00cda9/content.htm

else use the Invalidate() function

Thanks

Suresh