Skip to Content

Inter window communication

Hi all @SAPforums,

shortly: we created a custom web dynpro that is opened from a standard SRM 7 web dynpro to manage some custom data.

We access to this custom wd by pressing a button:

* get a reference of window from component
  l_cmp_api = wd_comp_controller->wd_get_api( ).
  l_window1 = l_cmp_api->get_window_manager( ).

* get a reference of window of target component
  result = l_window1->create_external_window(
      url        = w_url
      ).

* Open the target Window
  result->open( ).

where w_url is build previously in the code and is populated also with the input parameters necessary in our custom wd.

It works fine; now I have to manage the following requirement:

- the caller (standard) wed dynpro should know IF even just one field has been modified.

Could you please help me with the requirement?

I can easily check if any data has been changed in the custom web dynpro; how can I return this information to the standard web dynpro of the caller window (so that change badi could be then triggered) ?

Please provide example or documentation reference. Thanks !

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Jan 14, 2011 at 04:45 AM

    hi Matteo,

    data flow in web dnpro is dne by using the context.......now the data which you want to check in second application of yours should also be checked using the context node/ attribute ...rite?

    now inorder to do that that particular same node must be availiable in the second application also...to make it so you must make that particular node as an interface node.....making this node as an interface ...you will be able to get it visible in second application also providexd you have declared the name of first application in the property tab under component usage......

    the change in the data will automatically be reflected ...but dont use set_static_attributes or get_static_attributes as static values will only be visible if you are in the same application as soon as you leave your application and reach the second one you will find that vaklues are not reflected there ...so i suggest you to use the get_attribute/s.......set_attribute/s.....hope this information will help you...inform after trying it.

    thanks and best wishes,

    sahai.s

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member L0rd TH

      Hallo Matteo,

      External_window is window which runs on its own session. You need URL to start external window. Examples would be starting a iView in a separate window. Opening a URL like ''Google' or any external sites.

      Window and popup window are with reference to opening your interface View of the component. From your component, using a ALV is achieved in this category. In this case there is only once session and because of that you can have a assistance class with static atrribute to share the context.

      Coming back to your requirement. If you are able to make your custom WDA as used component in SRM then you can use the popup window with Shared Context concept meaning like acessing alv, or sharing same OO class etc.

      If you cannot use as used component then you left with the choice of calling URL of the WDA application.

  • avatar image
    Former Member
    Jan 13, 2011 at 02:20 PM

    >

    > Hi all @SAPforums,

    > shortly: we created a custom web dynpro that is opened from a standard SRM 7 web dynpro to manage some custom data.

    > We access to this custom wd by pressing a button:

    >

    * get a reference of window from component
    >   l_cmp_api = wd_comp_controller->wd_get_api( ).
    >   l_window1 = l_cmp_api->get_window_manager( ).
    > 
    > * get a reference of window of target component
    >   result = l_window1->create_external_window(
    >       url        = w_url
    >       ).
    > 
    > * Open the target Window
    >   result->open( ).

    >

    > where w_url is build previously in the code and is populated also with the input parameters necessary in our custom wd.

    > It works fine; now I have to manage the following requirement:

    > - the caller (standard) wed dynpro should know IF even just one field has been modified.

    > Could you please help me with the requirement?

    > I can easily check if any data has been changed in the custom web dynpro; how can I return this information to the standard web dynpro of the caller window (so that change badi could be then triggered) ?

    > Please provide example or documentation reference. Thanks !

    Hi,

    You are accessing the WDA in a external window.

    You have established 2 sessions independently each other. They have no knowledge of each other in their own session.

    If you wan to communicate from WDA to the caller SRM then you have to try something like the Shared Memory object.

    Shared memory would be an option if there is not any load balancing among the Web application server.

    The template solution would be like this.

    Use a custom Shared memory OO class,

    create a event in this object,

    Fire this event from the WDA application,

    Subscribe to this event in SRM.

    Add comment
    10|10000 characters needed characters exceeded

    • >So to have some kind of communication (with all the restriction Shared Objects bring) Shared objects are an option.

      Be careful with the usage of Shared Objects when opening an external window. If your system has multiple application servers and load balancing configured, the new user session of the external window might not be created on the same application server as the parent window. Shared Memory Objects only exist on a single application server. You would either need to propagate your Shared Memory Object data to all application servers via RFC (which is what we do with the WDA Notification Service in 7.02) or use a database entry approach like server cookies.

  • May 06, 2011 at 09:12 AM

    Thanks a lot, I will try to implement a different approach as suggested in the thread.

    Add comment
    10|10000 characters needed characters exceeded