Custom Controller Issue

Dear Friends,
I have add a custom assignment block on the overview page to show the data of a custom table. To add assignment block, I have
created a new view and have added value node with the attributes as per requirement. I have also added edit, insert and delete buttons there. All the things are working fine but Save is not working. To save data, I have used custom controller and trying to fetch data in the overview page controller class, but the custom controller is not reflecting the new value(added/modified), it only shows the previous value. So I am not able to save the changes in the custom table and I want to save the changes only though the save button on overview page..
Please help in this regard.
Thanks a lot !

Hi John,
To fetch the values of a view in overview you can use the following method.
In the method of the overview page fetch the value of the view controller.
Data: lr_viewctrl TYPE REF TO cl_bsp_wd_view_controller.
lr_viewctrl = me->get_subcontroller_by_viewname( 'BT231H_ACQC/Contractview' ). "Here give your view name
Now you can get the values of the view.
Regards,
Pooja

Similar Messages

  • Issue in Binding Custom controller to Component Controller

    Dear All,
    I have enhanced a standard component ERP_H.
    I created a custom controller with context nodes BTSTATUS, BTSTATUSH
    I enhanced the component controller with context node BTSTATUS, BTSTATUSH
    Now when i try to bind the custom controller to component controller using this code in the context class of my custom controller
    bind to component controller
      owner->do_context_node_binding(
               iv_controller_type = CL_BSP_WD_CONTROLLER=>CO_TYPE_COMPONENT
               iv_target_node_name = 'BTSTATUS'  " component controller context node
               iv_node_2_bind = BTStatus ).
    its not working since this context node in component controller is not the standard one but the custom added one.
    Am i missing something, or is there any way to bind customer context node in custom controller to customer context node in component controller.
    regards,
    pradeep

    Hi pradeep,
        Try the other way round go to the context class in the component controller and paste the following code in the
    create_contextnode( context node = name of the node to be linked).
    *owner->do_context_node_binding(
            iv_controller_type = cl_bsp_wd_controller=>co_type_custom   <-----linking from component to custom
            iv_target_node_name = 'BUILHEADER' "target node: component controller node
            iv_node_2_bind = BUILHEADER ). "source node: current node.
    See if this works.
    Thanks

  • Custom controller iue in OOPS ALV

    Hi All,
    I have created a ALV report by OOPS. I have used custom controller. In my sytem the outpout creen are id different and in other system the output screen area is different. How to avoid this issue? I want the report output should be system independent and it should take complete screen area?
    Please help..
    Regards,
    Jeetu

    Hi Jeetu,
    You should not drag-drop & create a container in screen layout.
    Instead you need to declare docking container using class cl_gui_docking_container.
    Sample code below:
      CONSTANTS: lc_height TYPE i VALUE 1200.
      IF sy-batch IS INITIAL.
        CREATE OBJECT go_container
          EXPORTING
            repid                       = sy-repid
            dynnr                       = sy-dynnr
            side                        = 2             " Top
            extension                   = lc_height
            metric                      = 1             " Pixel
          EXCEPTIONS
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            OTHERS                      = 6.
      ENDIF.
    Regards,
    Nisha Vengal.

  • Method in custom controller not getting called from view

    Hi experts,
    I have a very strange problem. My web dynpro application works fine on the development portal. i am in the process of deploying to the production portal there is no issue it deploys perfectly without any problems. However i have noticed that some methods in my custom controlller which are called from the view do not run. there is no error message or anything data just doesnt get picked because the execute function which fills the context are in the custom controller methods.
    For some reason the method in the custom controller does not get called even though i'm calling it for the view. I have this problem with two methods. the other methods work without any issue.
    Now i overwrote what i have on production at the moment so am stuck and in need for a solution.
    I have tried undeplying, restarting and re-deploying to no avail. what could be wrong?
    thanks and regards,
    dilanke

    Deal all
    This is the code. basically im calling it from the plug on the detail screen.
    This is the method that doesnt get called anymore.
    wdThis.wdGetGetPurchaseOrderCustController().getPODetail();
    The reportSuccess() works fine.
    regards,
    Dilanke
      public void onPlugFromListView(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onPlugFromListView(ServerEvent)
         try
             String po = wdThis.wdGetGetPurchaseOrderCustController().wdGetContext().currentContextElement().getPO_Id();
              wdContext.currentZGETPODETAILS_INPUTElement().setI_Ebeln(po);
              wdThis.wdGetGetPurchaseOrderCustController().getPODetail();
              wdComponentAPI.getMessageManager().reportSuccess(po);
              String fileName = "F://XML_Downloads//" + po + ".xml";
              IWDResource resource = WDResourceFactory.createResource(new FileInputStream(new File(fileName)),fileName,WDWebResourceType.XML,true);
              wdContext.currentContextElement().setXml_Resource(resource);
         catch(Exception e)
              e.printStackTrace();     
        //@@end

  • BP_CONT: not getting the contact person email value from custom controller

    Hi Experts
    not able to find the email address in any of the context node, actually my requirement is while creating the BP contact , get the email address  BP_ADDR/StandardAddress STRUCT.E_MAILSMT . take this email id and check whether this email id exists in system if exists throw the error while saving . for this I did the codin in BP_CONT component on save method but while saving some times my custom controller is getting initiated some times it was not containing any value , kindly let me know how can I get the email value of contact person in BP_CONT  component in view BPCONTOverview .
    here is my code on method eh_onsave
    lr_curo_bpcont_custcntrlr ?= me->get_custom_controller( controller_id = 'BP_CONT/BPCont' ).
      IF  lr_curo_bpcont_custcntrlr IS BOUND.
        TRY.
            lr_entity_privstdaddr ?= lr_curo_bpcont_custcntrlr->typed_context->privstdaddr->collection_wrapper->get_current( ).
            lv_privstdaddr_e_mailsmt = lr_entity_privstdaddr->get_property_as_string('E_MAILSMT'). " Get runtime email value of contact person
            lr_entity_bpcategory ?= lr_curo_bpcont_custcntrlr->typed_context->builheader->collection_wrapper->get_current( ).
            lv_partner_category = lr_entity_bpcategory->get_property_as_string('BP_CATEGORY'). " Get Partner Category value
          CATCH cx_sy_ref_is_initial cx_sy_move_cast_error cx_crm_genil_model_error.
        ENDTRY.
      ENDIF.
    here the problem is some times I'm getting the value and some times I'm not getting value the related objects also through get related entities contact person emial is not getting populated any where
    kindly help what is going wrong
    Thanks & Regards
    Rajasekhar

    Hello Rajasekhar,
    Could you please share how you resolved this issue? I have the exact same requirement (duplicate check based on email).
    Kind regards

  • C# Parsing JSON data within Mobile project OR via Controller Issue

    When I invoke the following to a custom controller to return data to my client (Windows Phone 8.1 app):
    var _lines = await App.MobileService.InvokeApiAsync<List<Tfl.Api.Presentation.Entities.Line>>("lines", System.Net.Http.HttpMethod.Get, new Dictionary<string, string>
    {"url", "http://api.tfl.gov.uk/Line"}
    I received the following Exception:-
    FileNotFoundException was caught
    Could not load file or assembly 'System.Runtime.Serialization,
    Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one
    of its dependencies. The system cannot find the file specified.
    However, I successfully parse the JSON data via the controller [I did have an image here displaying the data, but not enough rep to post!] and I also have no references to the above dll in my Windows Phone application.
    Any ideas?
    Note: Occurs using either local parsing within the mobile app or via controllers in a service app; also running VS Ultimate 2013 with Update 4

    Hi James,
    The data is deserializing using System.Runtime.Serialization 4.0.0.0 on the client side (which is targeting .NET 4.5). I am using a third party DLL found here (api.tfl.gov.uk) which contains all of the data transfer objects required to map the data from
    the JSON into an object structure.
    I have tested this DLL also within a console application and runs as expected, deserializing and mapping data etc; could the issue be that the DLL I'm using containing DataContract and DataMember annotations cannot be used as a reference within the Windows
    Phone 8.1 app?
    I say this because I have a solution whereby I 'copy' the DTO modes in the DLL into plain models using the same code (minus Serialization annotations) and the JSON then is able to deserialize and map to those in the phone.
    So the solution are present is to create my own models, however if you've any other ideas/workarounds that would be great to know in the future where I can just reference the third party DLL.
    Thanks for the response!
    --David

  • Should i Map thecommon bapi's to component controller or custom controller?

    Hey Can any body give the clarification for this doubt
    we have one web dynpro component , It contains some views. Created some BAPIs. Now we have two different applications in the same component. So we have created the two controllers for each application. the created BAPI's are mapped to o each controllers with respect to application.   . Now we have a small doubt, the Bapis  which common are common to both application not binding to any of that two controllers. so the common bapis should be map to the component controller or created one more controller like util Controller.
    Once bapis  mapped to any of this we can add this controllers to views. Please suggest which one is better, either mapping bapi's to component controller or custom controller.
    vijay

    Hi Raj, thks for the quick responce again.  I made small mistake in the sentence.Plz look at now again
    In my webDynpro project , under that i have created only single WebDynpro component with two applications .I have two modules(applications) one is DirectCustomer and another one is InDirectCustomer. so i have set of RFS's in a single RFC model. In this RFS's some are common to both the views. some are independent to each other. so i have created two custom controllers one for directCustomer another for Indirectcustomer.Then i mapped the RFC' model objects to each custom controller seperately . But now the RFC's which are common to both views to map, Better, should i map common RFC model objects  to existing Componentcontroller(which comes by default when create the webDynpro component) or should i create new customcontroller (like commoncontroller).
    which i option is better, can u suggest me. I feel that, The common RFC's will be mapped to component controller, bcz, it the Base controller for the both customcontroller , indrectly to the viewcontroller.
    Wht is your suggestion on this disign issue?

  • Signature Capture- Custom controller NWDS

    Hi all,
    We have developed a custom controller to capture signature on mobile device. And we are using .GIF format to capture the signature image. It is working on NWDS simulator but when deloyed on Windows Mobile emulator is giving following error:
    org.eclipse.swt.SWTException: Unsupported or unrecognized format
    Please tell if anyone faced this issue.
    Thanks
    Nitin Sikka
    Edited by: nitinsikka86 on Mar 16, 2011 6:01 AM

    Hi,
    unfortnately our issue was in a different area. We had done it as a browser applet and it did not work on PDA, but it did on Laptop. It is a behaviour of creme to not show any error if a codeline is not known - it simply ignores this line of code. So we used a shareware code source to create GIF files. I am not 100% sure about the name of this. But if you have access to MAM - check how they solved it code wise - this should help you to understand how SAP has solved this issue.
    Hope this helps.
    Regards,
    Oliver

  • Doubt regarding custom controller binding

    Hi,
    I have an issue with Account plan after upgrading to CRM 7.0.
    Certain fields are not populating in the overview page after inputing values in the edit page and when clicking on the 'BACK' button.I think its related to custom controller binding.I tried  custom binding also.Still Its not working.
    Can anyone help?
    Regards,
    Pooja

    Hi,
    Lets think of it logically. If you want to see something in lr_entity, then obviously the BOL entity must filled in first. Where is this happening? Check the context initialization methods where this is getting populated.
    Regards
    Prasenjit

  • How to get my custom controller updated with the global custom controller?

    Hi all,
    I'm new to CRM Web UI and need some advice from the expert. Currently I'm working on component ICCMP_BT_DATES and noticed something weird with this component. When this component is first launch it display the dates of a service ticket correctly. However when I navigate to another screen, save a new ticket and back, the dates are not reflected. When I went in and debug the component, I noticed that the context is still tied to the previous ticket. I think the custom controller is not updated with the latest from the global custom controller.
    My question is how do I get my custom controller updated with the latest.
    Regards,
    Ricky

    You have to bind your custom controllers context node to the event NEW_FOCUS of the collection wrapper on the global custom controller.
    Best place to do this might be the CONNECT_NODES of the context of your custom controller.
    Get the global CuCo with GET_CUSTOM_CONTROLLER() and then the appropriate context node. Now:
    SET HANDLER yourMethod for lr_global_cuco->typed_context->thecontextnode->collection_wrapper activation iv_activate.
    Of course you have to implement a method similar to ON_NEW_FOCUS as it is on many other nodes.
    cheers Carsten

  • Can i Bind more than one Model object to the Custom controller or not

    Hi All, I trying to bind more than one model object to the custom controller, Both the model objects contains same attribute name called ( output). Both model objects created on to top of the BAPI. So when i bind first model object to the custom controller will work fine. When i am trying to bind the second model object to the same controller. This second model object also having the same attribute name called "output" . So it is giving an error of "Duplicate context element "Detail". Rename or uncheck duplicate elements.
    can i assign more than one model object to the single controller or not?
    But in the reference document, it has given that , we can create model object with more than one bapi.So in this case if both the bapis contains any element with the same name will also be problem. Any body give me the solution.
    Initially we have created one custom controller for each model object. But later i realized that, why con't we use same controller for all the model object. Because, the custom controller context is the public context. this context shared across all the view controllers.
    The concept which I am trying to do is right or wrong?

    Hi Vishal,
    of course, you can bind one controler to many models. When the same name occours you can simply RENAME binded node in controler.
    Regards
    Bogdan

  • How to read the details in the context node of the custom controller

    Hi friends,
        My requirement is i enhanced the component ICCMP_BP_DETAILS , now on EH_ONSAVE i want to read the details of the Context node in the Custom COntroller .
    In custom controller from ICCMP_BP_DETAIL/CuCoBPDuplicate  From this in context node CUSTOMER is there in that attributes first name last name is there i want to read those details
    so can u pls provide the logic for this how can i get the values.
      am very new to the BSP programming
    Regards
    Yogesh

    Hi Suchitha,
    when i am following the above code the lr_entity is not Bound, so can u pls suggest is there any thing is missing
    i used the below mention code but lr_entity is not bound
    DATA: lr_cuco type ref to CL_ICCMP_BP_CUCOBPDUPLICA_IMPL.
                lr_entity type ref to cl_crm_bol_entity.
    lr_cuco ?= me->get_custom_controller( 'ICCMP_BP_DETAIL/CuCoBPDuplicate') .
    CHECK lr_cuco IS BOUND.
    lr_entity ?= lr_cuco->typed_context->customer->collection_wrapper->get_current( ) .
    CHECK lr_entity IS BOUND .
    lr_entityIF_BOL_BO_PROPERTY_ACCESSGET_PROPERTY_AS_VALUE( iv_attibute =  'FIRST_NAME' ev_attribute = lv_firstname ) .
    Please correct the code if any thing is missing
    Regards,
    Yogesh

  • Error when creating custom controller

    I have a non-visual WebDynpro DC that contains a single data model.  The model has been added to the public part of the DC.
    I have another visual WebDynpro DC that makes use of the data model in the first DC.  If I explicitly reference the model in the first DC, everything works just fine.  I can input data, invoke the model, and see the response displayed on the page.
    However, I'm trying to create a custom controller that hides the data model.  When in the data modeller for the visual WD DC, I right click on the 'Custom Controllers' pane, and select 'Apply Template'.  I create a Service Controller, and select the model that's been imported (actually, that's been referenced as a used component) from the first DC.  I then select the data elements from the context that I want bound into this custom controller.  Click next, give a more descriptive method name, and then click Finish.  I get an internal error as follows:
    Source controller implementation file is not accessible (D:/src/.dtc/LocalDevelopment/DCs/example.com/test-wd-view/_comp/gen_wdp/packages/com/example/wd/AdderModelCust.java)
    Exception: java.lang.NullPointerException
    Am I doing this correctly, or am I missing a step or two?

    Hi Ken,
    you didn't miss some steps, this seems to be a bug in the tools. Please open a OSS message with the following information:
    - which Studio version you use (NW04/04s? SP?)
    - description of how to reproduce the effect
    - Studio's error log attached (.log file in <YourWorkspaceFolder>/.metadata)
    In the meanwhile to circumvent the error you should try to
    - create a new custom controller manually in WD explorer and launch Service Controller template from this controller (context menu in WD explorer)
    - if this fails as well, manually create the context definitions and method implementation that the template would produce.
    Regards
    Christian

  • How to get the reference of the View controller in from Custome controller

    Hi friends,
    From one of the Custome controllers in my Component,I am raising a popup based on conditions.
    I want to subscribe to popup buttons.
    Following is the code that I have written.
    IF LT_RECEIPTS_T[] IS not INITIAL.
        data lo_window_manager type ref to if_wd_window_manager.
        data lo_api_component  type ref to if_wd_component.
        data lo_window         type ref to if_wd_window.
    *BREAK-POINT.
        lo_api_component  = wd_comp_controller->wd_get_api( ).
        lo_window_manager = lo_api_component->get_window_manager( ).
        lo_window         = lo_window_manager->create_window(
                           window_name            = 'W_PERSONALCARDPOPUP'
                           message_display_mode   = if_wd_window=>co_msg_display_mode_selected
                           button_kind            = if_wd_window=>co_buttons_okcancel
                           message_type           = if_wd_window=>co_msg_type_none ).
        lo_window->open( ).
        DATA: view_controller TYPE REF TO if_wd_view_controller.
        view_controller = wd_this->wd_get_api( ).
        CALL METHOD lo_window->subscribe_to_button_event
          EXPORTING
            button      = if_wd_window=>co_button_ok
            action_name = 'OK'
            action_view = view_controller.
    as I am In Custome controller,wd_get_api is returing of type if_wd_controller,but the subscribe_to_button_event
    requires action_view of data type if_wd_view_controller.
    but,my problem is that I can keep the view only Custome controller.
    when I pass the 'VIEW_CONTROLLER' variable to method subscribe_to_button_event,I am getting the error  as type missmatch.
    Please suggest how I can rectify this error.
    Regards,
    Xavier.P

    Hi Xavier,
    You try this
    1. Define an attribute in your custom controller to hold your popup window reference for e.g lr_popup of type if_wd_window
    2. Store the popup window reference in lr_popup when calling your popup
    lo_api_component = wd_comp_controller->wd_get_api( ).
              lo_window_manager = lo_api_component->get_window_manager( ).
              wd_this->lr_popup = lo_window_manager->create_window(
                              window_name = 'W_PERSONALCARDPOPUP'
                              message_display_mode = if_wd_window=>co_msg_display_mode_selected
                              button_kind = if_wd_window=>co_buttons_okcancel
                              message_type = if_wd_window=>co_msg_type_none ).
             wd_this->lr_popup->open( ).
    3. Define the custom controller usage in the properties of your popup view
    4. In WDDOINIT of your popup view write the following
    DATA lr_custom_controller TYPE REF TO ig_<Custom Controller>.
            lr_custom_controller = wd_this->get_<Custom Controller>_ctr( );
            lr_custom_controller->lr_popup->subscribe_to_button_event(
         button = if_wd_window=>co_button_ok
         action_name = 'OK'
         action_view = wd_this->wd_get_api( ) ).
    5. Define the event handler for OK in your popup view
    Best Regards,
    Loveline

  • How to call a custom controller method from view

    Hi,
    I ve created a simple web service and consumed it in a model. Mapped the input & output parameters to custom controller context which in turn mapped to component controller's context which in turn to view's contexts.
    How to call a custom controller method from view?
    Please explain the syntax.
    Regards,
    Manoj.

    Hi Patralekha,
    Give some idea for the below scenario:
    I ve created a simple web service and consumed it in a model. What I did was
    1) for the input parameters, mapped the node from view->custom controller->model
    2)for the output parameter, mapping from model->custom controller->view.
    It works fine.
    But I don't want to access model nodes directly, rather I want to set the input param in somewhere else (like custom controller) before calling the appropriate method, same for the response also.
    Share me your thoughts.
    Regards,
    Manoj.

Maybe you are looking for

  • LSMW For Converting Open Sales Orders (not working for more than 1 item)

    Hi, I am using following standard object for Open sales orders . Object               0090   Sales documents                    Method               0000                                      Program Name         RVINVB10                              

  • Data Migration from existing legacy to SRM

    Hello All , We are preparing for cutover of our SRM implementation. Version in SRM 5.0 tech scenario - Classic. The business scenario is Sourcing with Bid Invitation. At our client's place existing legacy is working where they have many open Bid Invi

  • What is the latest version of sql server has been supported by forms 6i (patch 2)

    I am trying to connect to sql server 2000 from forms 6i (patch 2) using sql odbc drivers version msql odbc-03.80.0194 with oracle open client adapter version 6.0.5.29.0 by using the following command at command prompt plus80 <username>/<password>@odb

  • My itunes not able to download the latest iOS firmware

    everytime i want to download a new iphone iOS firmware .. it stops right at the end . it goes like this, i download it and everythings perfect .. i wait until its almost done, it says processing and then it stops and says could not download, internet

  • Using Text Variable for Query Description

    hi all, I am currently trying to include this text variable in the query properties of the query. This text variable should be able to grab the 0CALMONTH as filter to be included into the query properties. but currrently  cannot grab the particular i