Clear context in Web Dynpro

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,

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
Context Handling and User defined Functions
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-dc2a26cc0389
Just check this one also...good blog on context handling...
Introduction to Context Handling in Message Mapping
Introduction to Context Handling in Message Mapping
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

Similar Messages

  • Clearing Context in Web Dynpro applications

    Hi All,
    I am using a view that is called from multiple places based on different criteria. This view has a table that is fed from the custom controller. Some of the context data for this custom controller are being set from the other views.  I need to clear the resultset of the custom controller and retain the input data from the other views. Is there any simple way of clearing data in the context node?  I tried invalidating the node, context but nothing seems to work. Any suggestion what I might be doing wrong?
    Thanks and regards,
    Hemanth

    hi Hemanth,
    Where are u trying to invalidate the node. What is the exact scenario.If u want the custom controller to be updated in different views... u can say
        wdThis.wdGet<contr name>Controller().wdGetContext().node<name>().invalidate();
    in the init of the view where the value of the custom controller is updated.
    Is the problem with invalidate or with the updation in values.Invalidate will always work if u set the lead selection properly.
    If u cud elobarate more on the problem someone could really help u out...
    Regards
    Bharathwaj

  • Clear context in Web Dynpro View

    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,

    Hi
    you can use the method invalidate method of interface if_wd_context_node to clear all the elements of a node.
    Regards
    Naresh

  • Context from Web-Dynpro-Component-Interface & Customer Extention Fields

    Hello all,
    A main component uses a Web-Dynpro-Component-Interface and defines an external maping to it. Web-Dynpro-Component-Interface has a context and a window. At runtime implementaion of Web-Dynpro-Component-Interface is provided.
    All works fine, but how can i create an implementation with view which contains customer extention fields? Unfortunately only fields from context of Web-Dynpro-Component-Interface are visible. I can not even extend the context of Web-Dynpro-Component-Interface via enchancement framework.
    I assume, it is possible with dynamic programming, but why is it not possible in declarative way?
    thanks
    regards
    Paul

    Hello,
    I found this documentation:
    Implementation of Interfaces for Customer Developments
    Using interfaces in a Web Dynpro component benefits customers by giving them a clean basis for their own further developments. When creating a local development, you can implement a used interface in a separate component and add your own aspects to an application delivered by SAP.
    http://help.sap.com/saphelp_nw70/helpdata/en/a9/19eebc1e2943dbb2d443095d017ae9/content.htm.
    I think it must be a correct way to extend SAP programms with customer fields. Please reply, issue is very important.
    Regards
    Paul

  • How to get Portal User Context  in Web Dynpro application

    I have successfully integrate a web dynpro app into SAP Netweaver Portal.
    Within my web dynpro app, how can I get portal user context information such as first name, last name, job title or some newly created ume attibutes.
    Is there any programmatical approach to get portal user context in my web dynpro. I not sure whether I can use the following codes in web dynpro?
    IUserContext userContext = request.getUser();
    String firstName = userContext.getFirstName();
    String lastName = userContext.getLastName();
    If yes, can someone point me the name of the jar file I have to import.
    Note : The SAP Netweaver installation that runs my web dynpro app is same with the SAP Portal.

    Hi ,
    you can use the below code to get User details and  add com.sap.security_2.0.0 > lib > com.sap.security.api.jar
    try
              IWDClientUser clientUser = WDClientUser.getCurrentUser();
    String firstName = clientUser.getFirstName();
    String lastname = clientUser.getLastName();
    catch (WDUMException e) {
                wdComponentAPI.getMessageManager().reportException("Error Retrieving User"+e.toString(),true);
    Regards,
    Sunitha Hari

  • Dynamic context in web dynpro abap: recursion node is possible?

    Hi,
    i'm working with web dynpro ABAP and I need to create a dynamic recursion node. Is possible?
    thank you.
    Regards.
    Al

    Hello Saravanan,
    this is my code that creates a context node with recursion node, but supply_method i never called. why? could you help me?
          CALL METHOD lr_root_info->add_new_child_node
            EXPORTING
              name                         = y_name
              is_mandatory                 = abap_false
              is_multiple                  = abap_true
              is_mandatory_selection       = abap_false
              is_multiple_selection        = abap_true
              is_singleton                 = abap_true
              is_initialize_lead_selection = abap_true
              is_static                    = abap_true
              supply_method                = 'SUPPLY_NAV_LIST'
            RECEIVING
              child_node_info              = lr_node_info.
          ls_attribute-name = 'TEXT'.
          ls_attribute-type_name = 'STRING'.
          CALL METHOD lr_node_info->add_attribute
            EXPORTING
              attribute_info = ls_attribute.
          ls_attribute-name = 'ENABLED'.
          ls_attribute-type_name = 'WDY_BOOLEAN'.
          CALL METHOD lr_node_info->add_attribute
            EXPORTING
              attribute_info = ls_attribute.
          lr_node_info->add_recursive_child_node( child_name = y_name_nav child_info = lr_node_info is_static = abap_false ).
    Thank you.
    Al

  • Map context node  web dynpro to context DATA of  interface controller ALV

    Hi Experts,
    I have started creating simple ALV by following the example in the below mentioned link.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/3439404a-0801-0010-dda5-8c14514d690d
    I have completed 95% development but stuck with last bit of
    Set data to ALV for display (via reverse context mapping).
    When Click on the Controller Usage button. The component controller of your Web Dynpro component DOES NOT appears on the right side of the screen.
    Therefore I can not  Map context node NODE_FLIGHTTAB of your Web Dynpro component to context DATA of the interface controller of the ALV component.
    Could you please shed me light on this.
    Your time and help much appreciated.
    Best Regards
    CB

    Hi Chandra,
    You need to add component controller first. Just go to the property tab of interface controller of the alv component and click on create button and then add the component controller. After that you'll be able to see the node in the context tab.
    Regards
    Arjun

  • How to get a r/3 file using web dynpro

    Hello Experts.
    Actually I have a new request, I hope you can help me please.
    I'm a web dynpro programmer (java), so my company need to take a r/3 file to download at the local pc. In fact, the file is en r/3 already.
    The matter is, i have no idea how to get that file since my web dynpro app. to download it. the file is a compressed file may be a .ZIP file... so any of you can let me see the light in this??
    thak you all.
    walex

    Hi Walex,
    You will first need a RFM that returns the file that you need.
    Then you can create a Adaptive RFC model in Web Dynpro to access this RFM and store the file in the Web Dynpro context. Web Dynpro provides APIs to save files to the local system
    You can check this article for downloading the file.
    http://wiki.sdn.sap.com/wiki/display/Snippets/WebDynproJava-ExportingTableDataUsingOn-DemandStreams-SAPNW+7.0
    Best Regards,
    Supriya

  • Why Web services are used to send data not HTTP in Web dynpro for Java?

    Is Web Dynpro for Java supports Web service , RFC as communication to other systems why http cannot be used in Wweb dynpro for java.........
    Thanks and Regards,
    CSP

    Hi Pradeep,
    Yes, Web Dynpro java supports web service, you can expose your web service as RFC Model to
    communicate with others system. As per as HTTP is concern we don't have any
    supportive method in web Dynpro. Insted of HTTP we use context in web dynpro to communicate.
    Thanks
    Anup

  • Using Web Dynpro to bypass a r/3 selection screen

    Hello,
    Very new to portal development and looking to see if there is a way to do this.
    Overview: I created a WebDynpro to display R/3 information in a table via an iView. This information
    contains R/3 report variants based on user security. The user can then select a line within the table and hit execute which will run a r/3 report using the information from the table without displaying the selection screen.
    KEYNOTE: We do not want the user to be able see the report selection screen.
    It contains secure information that the business does not want the user to be able to view.
    Within the portal content I created two pages, The first page contains one iView with my WebDynpro. Which is filled and displays the table when selected. The second page contains two iView's WebDynpro and the window for viewing the R/3 report.
    The problem is that when the execution button is hit on the first page, it then moves to the second page. However does not run the report. It displays the selection screen of the report. They can hit the execution button again and it worked fine.
    Is there a way around this or is they a better way of doing this/
    Thanks,
    Chris

    Hi Walex,
    You will first need a RFM that returns the file that you need.
    Then you can create a Adaptive RFC model in Web Dynpro to access this RFM and store the file in the Web Dynpro context. Web Dynpro provides APIs to save files to the local system
    You can check this article for downloading the file.
    http://wiki.sdn.sap.com/wiki/display/Snippets/WebDynproJava-ExportingTableDataUsingOn-DemandStreams-SAPNW+7.0
    Best Regards,
    Supriya

  • Clear/refresh(F5) fields in web dynpro application view

    How to clear or refresh(F5) fields in web dynpro application abap while redirecting to another view? I have tried using "context_node->invalidate()" but it's not working for all the fields, some are getting initialised and some not. Is there any other method to refresh all the fields in the view all at once. Please guide.

    Hi,
    For the Context node( to which the drop down is bound) create a supply function as shown below:
    Now populate the drop down in supply function method instead of WDDOINIT method.
    Go to methods tab and write the below code in supply function method:
    DATA lo_nd_drop TYPE REF TO if_wd_context_node.
        DATA lt_drop TYPE wd_this->elements_drop.
        DATA ls_drop TYPE wd_this->element_drop.
    *Fill Drop down
        ls_drop-val = 'ABC'.
        APPEND ls_drop to lt_drop.
        ls_drop-val = 'DEF'.
        APPEND ls_drop to lt_drop.
    * bind all the elements
       node->bind_table(
         new_items            =  lt_drop
         set_initial_elements = abap_true ).
    Now once you call invalidate( ) the drop down will automatically be initialized( since the supply function will be called again) And you don't have to write the code again to populate the drop down.
    hope it's clear now.
    Regards,
    Kiran

  • Cannot see Ecatt option in context menu in web dynpro abap in SE80 ECC 6.0

    Hi ,
    I saw a presentation by Thomas in which there is option of recording ecatt script on context menu in web dynpro abap application.we are on ECC 6.0 we are trying to record WDA applications and test them by using Ecatt but I am unable to see the option of recording the ecatt script in SE80 editor.
    Why could this be happening

    Thanks ,
    I saw that disappointing note ...any other way to automate web dynpro abap testing ? please advise.

  • Upload File in Web Dynpro Java CO and store it in the context

    Hi Guys!
    I have developed a web dynpro CO form, and I need to be able to upload a file in an action and then be able to download that file in further actions.. I have evaluated saving the file in the backend via RFC, in KM and also creating a CAF project.. but I think there must be a simpler way : saving it in the context of GP.
    Does someone knows if it is possible to do that?
    best regards,
    Marco.

    Hi Marco
    In webdynpro java, there are UI elements File Upload and File Download. You can use these UI's to upload and download attachments. From NetWeaver 7.0 onwards, you have IWDResource interface which can be used to upload attachments. But in GP if you want to pass attachment to another action you must use Binary as a data source. Bind the File upload UI element to Binary. In addition, you should define input and out parameters in getDescription method.
    Thanks
    Ghazanfar

  • Web Dynpro context field limitation for the form

    Hello,
       I have created a Web Dynpro with the context fields for Adobe form data from a structure (about 51 fields). When the form is created with reference to the context, the context is not transferred to the Adobe form.
    Similarly created another Web Dynpro context with only 2 fields from the structure for Adobe data, in such case the context fields are transferred to the Adobe form.
    Any limitation on the number of fields to be transferred from Web Dynpro Context to the Adobe form?
    NOTE: Using ABAP Web Dynpro.
    Thanks,
    Anjali
    Message was edited by: Anjali Joglekar

    Hello,
      I think I found the issue. The structure I was using had many fields with data type declared has STRING (with no definite length), in such cases the context is not copied over to the form.
    After modifying the structure fields, with appropriate length data elements, the same structure fields are carried over from Web Dynpro Context to the form.
    Any idea why such limitation is there for the structure field length?
    Thanks,
    Anjali

  • Context not updated from adobe from fields to ABAP web dynpro every time

    Hi,
    I work through a turtorial for interactive adobe form in web dynpro. The turtorial link is as following:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/c766e918-0b01-0010-99b1-c2b78cd059b3?prtmode=navigate
    I use Active X adobe form display type and submit button. Basically, it works.
    My problem is the 1st time I change the out_amount in adobe form and click 'Submit'. Everything OK. The corresponding context field in Web Dynpro is updated and showed in my own web dynpro field.
    Then, I change the out_amount again in Adobe form and click 'Submit' again. The context is not updated.
    The interesting thing is when I click 'Submit' the 3rd time, it works again. Same situation happens for 4 and 5 times click 'Submit' and so on.
    It seems I need to click 'Submit' two times and the web dynpro context is then  updated.
    Is there anyone have any clue about my problem?
    Thank you in advance!
    Trey

    Please provide the solution.......

Maybe you are looking for

  • Error in account determination: table T030K key CNFX MWS

    Hi,      i have a issue when releasing the billing document .i have a issue like "Error in account determination: table T030K key CNFX      MWS".  Actually iam trying to map the scrap process. User requirement is , when upload the non valuated materi

  • Question about weblogic-cmp-rdbms-jar.xml

    WinNT 4.0 SP6, Weblogic 5.10 In the online documents, it says: ---- digest from the online documents ---- The following example finds all the EJBs in a table. It uses the sample finder method signature: public Enumeration findAllAccounts() throws Fin

  • How do you load itunes onto PS3?

    Hello. I've seen on the internet that you can load itunes onto the PS3, but not how. Does anyone know if there is a special download you need? Thanks for your help.

  • Creating a  calculated total field in BIP

    Hi, Hope this isn't a stupid question. I have have a SQL data model in BIP (BI Publisher) which displays a percentage of the number of withdrawn students at our university against the total number of students. The report is broken down by department.

  • HT4623 i cant find the software update option in between about and usage?

    Hello am useing a Apple i phone 3GS , i want to upgrade the option from 4.2 to any new versions? plz support me to get it