Binding Controller context nodes to two (RFC)models

Hi group,
i have an table, which is based on an BAPI_GET.
This table is editable - and I want to update the data in R/3 with another bapi BAPI_SET.
BAPI_GET and BAPI_SET have the same structure T_DATA as "table".
Unfortunately I cannot bind the elements of the context (which are created from BAPI_GET) to BAPI_SET. Message is:
<b>Invalid model relation. The corresponding model class does not match the model class of the associated parent context node</b>
Any suggestions would be great, thanks alot,
Simon

Hi Matthias,
thanks very much for this idea.
I'm gonna try that!
Unfortunately my second models isn't executable (not "execute" method). Maybe some idea for that as well?
Thx,
Simon
P.S:
(Another idea would be: creating an additional controller with one context between the "BAPI Controller" (with the two contexts) and the UI to "bundle" the mapping..)
P.P.S:
Sorry Matthias - somehow the rewarding <b>in this particular post</b> doesn'nt work.
If you see another post of mine - just drop in - i'm gonna get you the points, you deserve.
Message was edited by: Simon Prinzleve

Similar Messages

  • How to use two RFC models in one Data Source for a Interactive Form UI Elem

    Hi
    I want to use two RFC models (two Function Modules from a SAP Backend system) in one context node of a View Controller in order to pass it as the data source to a Interactive Form UI element. Can I use the data binding mechanism directly or have I to copy the data into a Value Node within the view controller.
    Thanks for helping
    René Morel
    SAP (Schweiz) AG

    Rene,
    You can create a local context node in component controller and copy the data from both the RFC's to this node, then bind it to the view controller. Then you can make this view context node as the datasource of the interactive form.
    Regards,
    Anand

  • Nullpointer exception in SAP code (RFC model related)

    Hi,
    Some threads have already been opened on this issue, but none of them give me a solution.
    The problem is that a Nullpointerexception is thrown when I create a new Input element (to bind it to the input node of my rfc model).
    As you can see in the stack trace, the nullpointerexception is thrown in SAP code.
    This happens for all function modules I've created myself (even the simplest ones with no parameters/no code), but for the SAP BAPIs it works???
    So this is not an issue related to Javaconnectors/my java code because it works for BAPIs (I'm doing exactly the same).
    I've already restarted the J2EE server, recreated the whole application, tested with new applications (to avoid any caching problems) but nothing works.
    I've been trying to resolve this issue for several hours without success. It's really frustrating.
    Any help appreciated!
    Jeroen
    java.lang.NullPointerException
         at com.sap.tc.webdynpro.modelimpl.dynamicrfc.AiiModelClass.createNewBaseTypeDescriptor(AiiModelClass.java:220)
         at com.sap.tc.webdynpro.modelimpl.dynamicrfc.AiiModelClass.descriptor(AiiModelClass.java:186)
         at com.eozen.aif.ce5solman.Z_Jver_Create_Infosheet_Input.<init>(Z_Jver_Create_Infosheet_Input.java:51)
         at com.eozen.jver.aif.Infosheets.wdDoInit(Infosheets.java:98)
         at com.eozen.jver.aif.wdp.InternalInfosheets.wdDoInit(InternalInfosheets.java:181)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.doInit(DelegatingComponent.java:95)

    I suddenly realized there is one last option and it works: I managed to sidestep the problem by doing the rfc via an R/3 SAP system that forwards the call to the CRM system. (The CRM 5.0 system is the one causing the nullpointerexception).
    Maybe some incompatibilities between J2EE/WDP SP14 & CRM 5.0?

  • Dynamic Tables: TableCellEditor depending on Context node value

    Dear community,
    I'm creating a dynamic table containing all the neccessary fields to display my context node in Java code but I have one requirement that I can not resolve by myself:
    Depending on the value of a cell the TableCellEditor should be of type IWDTextView or LinkToURL. So if the context node value is e.g. the String "abc" I want to display a LinkToUrl containing a Target - such as http://www.abc.com - depending on the value, if the context node value is "def" I want to do nothing but display the value in a TextView.
    As I am creating the dynamic table in advance and binding my Context node to it later, I don't know how to change the TableCellEditor at that point of time.
    Right now I have the choice to either display all cells of the column as LinkToUrl TableCellEditor or display all cells as TextView - the dynamic table generation itself is no problem for me.
    Does anyone have an idea on how to do that? Maybe it is not possible in WDJ right now?
    regards,
    Christian

    Hi Christian
    Try this:
    IWDTable theTable=(IWDTable)view.createElement(IWDTable.class,"table");
    IWD TableColumn aColumn=(IWDTableColumn)view.createElement(IWDTableColumn.class,"col");
    if(str.equal("abc"))
    IWDTextView aField=(IWDTextView)view.createElement(IWDTextView.class,"TextView");
    aField.bindText(str);
    aColumn.setTableCellEditor(aField);
    else if(str.equal("def"))
    IWDLinkToURL aField=(IWDLinkToURL)view.createElement(IWDLinkToURL.class,"LinkToURL");
    aField.bindtarget("http://www."str".com");
    aColumn.setTableCellEditor(aField);
    theTable.addColumn(aColumn);
    Best regards,
    Sangeeta

  • Initializing (or invalidating?) of Context Node by changing Tabs (Tabstrip)

    Hi Experts,
    I have 4 Tabs on a Tabstrip. Two of these Tabs have two tables with one Context Node. Two other Tabs have also two tables with One Context.
    The combination is similar to this:
    Table A (on Tab A) and Table B (on Tab B) are bound to Context Node 1,
    Table C (on Tab C) and Table D (on Tab D) are bound to Context Node 2.
    By changing the Tabs, the content of the tables with the same context stays the same.
    Where and what is the best Place/way for initializing (or invalidating) the Nodes by changing the Tabs?
    Thank you for any help
    Kind regards, Haleh
    Edited by: Haleh Mir Ashrafi on Oct 8, 2009 11:03 PM

    hi ,
    u wud also like to refer this article Link: [Working with Tabstrips in WDA |http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/000334e2-f34d-2c10-dd8c-94194607e888&overridelayout=true]
    As Radhika depicted , u can use the method onSelectEvent of ur tabstrip.
    here u can take reference of the node and cn invalidate it
      DATA lo_nd_cn_sapsystem TYPE REF TO if_wd_context_node.
        DATA lo_el_cn_sapsystem TYPE REF TO if_wd_context_element.
        DATA ls_cn_sapsystem TYPE wd_this->element_cn_sapsystem.
    *   navigate from <CONTEXT> to <CN_SAPSYSTEM> via lead selection
        lo_nd_cn_sapsystem = wd_context->get_child_node( name = wd_this->wdctx_cn_sapsystem ).
    lo_nd_cn_sapsystem->invalidate( ).
    regrds,
    amit

  • Sending controller context value attributes to web service model

    Hi,
    I have put some parameters (value Attributes) in controller context and mapped to different views. Is there any way by which i can send the values to the web service model , each time the web service is called? like through header or some thing like that??

    Hi Sujesh,
    Read those value attributes in your controller using following code:
    wdcontext.currentContextElement().get<attribute>();
    and then set these value in your web service model.
    <model name> model = new <model name>();
    model.set<attribute>(<value>);
    wdcontext.node<nodename of your web service model>().bind(model);
    wdcontext.current<nodename of your web service model>element().modelobject().execute();
    Regards,
    Bhavik

  • Interface Controller context model attribute error

    I am trying to create a controller interface as such:  I created a DC that goes out and retrieves SAP ID using a RFC call.  My controller context is bound to a RFC model.  I'd like to expose the SAP ID that comes back from that call within a model attribute to other components.  I try to create a model node and corresponding model attribute within the Interface Controller, setting the isInputElement = true.  However, as soon as I do this I get a number of compile errors:
    "The context model node has not been bound to a model class", "The context model attribute has not been bound to a model property". 
    Are you not allowed to map model nodes to an interface?

    Karla,
    First, set isInputElement to false. Think again, you are exposint "result" outside but not collecting "input" from outer component.
    Next, calculated attributes to the rescue here.
    Say, in component controller you have 1..1 / 0..1 model node <i>SapIdQuery_Input</i> with 1..1/0..1 child <i>SapIdQuery_Output</i> that holds <i>System_Id</i> attribute, type <i>string</i>.
    Now create in component controller context (right below root node) attribute <i>System_Id</i> of type <i>string</i>, set read-only to true and calculated to true. Switch to source editor and write the following for generated attribute "getter":
    if (wdContext.currentSapIdQuery_InputElement() != null &&
        wdContext.currentSapIdQuery_OutputElement() != null)
      return (String)wdContext
        .currentSapIdQuery_OutputElement()
          .getAttributeValue("System_Id");
    else
      return null;
    Now add controller usage (of component controller) in interface controller and map attribute in interface controller to calculated attribute in component controller.
    If you expirienced problems with mapping, try to create calculated attribute in 1..1 subnode of root context node.
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • Binding of different context nodes in BSP WD Workbench

    Im creating a new View .
    How can i bind a new attribute node in this view to  context node of <U>component controller</u>( not of custom controller)?
    Edited by: Oleg Agranovich on Oct 27, 2008 3:07 PM

    HI,
    just like you would with a custom controller. It is the same method call in the CREATE_XXX method of the context class.
    Just substitute the iv_controller_type variable with CL_BSP_WD_CONTROLLER=>CO_TYPE_COMPONENT
      owner->do_context_node_binding(
            iv_controller_type = CL_BSP_WD_CONTROLLER=>CO_TYPE_COMPONENT
            iv_target_node_name = '<<CUCO_NODE>>'
            iv_node_2_bind = <<node>> ).
    cheers Carsten

  • How to populate context node of component controller

    Dear People,
    Is there any way i could access my custom context node of component controller in the context node class of my custom controller.
    I am navigating from one component to another, Upon initial launch everything is working fine, however if i go to home page and come back. the assignment block is coming empty.
    In WD_USAGE_INITIALIZE i m binding my custom controllers context node with the component controller's context node of the other component and it works fine when i load the UI. however if i go to home page and come back. the assignment block is coming empty.
    Following code is in method of DO_VIEW_INIT_ON_ACTIVATION of the other componenet.
    METHOD do_view_init_on_activation.
      DATA:   lv_btstatus_parent TYPE REF TO cl_crm_bol_entity,
            lv_comp_ctrl      TYPE REF TO cl_btstatus_bspwdcomponen_impl.
      CONSTANTS:
            lc_us_header      TYPE crmt_relation_name VALUE 'BTStatusHUserAll',
            lc_us_item        TYPE crmt_relation_name VALUE 'BTStatusIUserAll'.
      lv_comp_ctrl ?= me->comp_controller.
    check if relationname has been passed from outside
        gc_relation_name = lv_comp_ctrl->get_relation_name( ).
      IF gc_relation_name IS INITIAL.
      check type of parent to determine relationname
        *lv_btstatus_parent ?= lv_comp_ctrl->typed_context->btstatusparent->collection_wrapper->get_current( ).*
       check lv_btstatus_parent is bound.
        CASE lv_btstatus_parent->get_name( ).
            WHEN 'BTStatusH'.
              gc_relation_name = lc_us_header.
            WHEN 'BTStatusI'.
              gc_relation_name = lc_us_item.
        ENDCASE.
      ENDIF.
    CALL METHOD super->do_view_init_on_activation.
    ENDMETHOD.
    Here lv_btstatus_parent is bound during initial launch, however after navigating back to the same page, its blank leading to exception.
    any suggestions would be helpful.
    regards,
    pradeep

    solved myself

  • Should i Map thecommon RFC Model to component contrl or custom controller?

    In my webDynpro project , I have two modules one is DirectCustomer and InDirectCustomer. so i have set of RFS's in a single RFC model. In this  RFS's some are common to both the modules. some are independent to each other. so  i have created two controller component one for each module.Then i mapped the independent RFC'c to each controller seperately. But now the RFC's which are common to both modules to map, Better, should i map to  existing Componentcontroller 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.
    Can any body give me the suggestion on this

    Hi Vishal,
    As far as I know it's recommended to use a custom controller for every RFC. This makes sense because if the RFC changes some day you only have to do changes in the specific custom controller.

  • 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

  • How to bind UI Element with Context Node Attribute Element

    Hi,
    I'm building my view dynamically in the wdDoModifyView method.
    Is it possible to bind a "TextView" element to a specific element of an attribute node?
    Scenario:
    Node_Employees
    |
    +- Attribute_Code
    |
    +- Attribute_Name
    Node Contents:
    Employees
    |
    +- Code: 1, Name: Employee 1
    |
    +- Code: 2, Name: Employee 2
    |
    +- Code: 3, Name: Employee 3
    I need to do something like binding a TextView UI element to the "Name" attribute of the element #2, what would result to show "Employee 2" on my view.
    How can I do this?
    Thanks in advance,
    Geraldo.

    Hi Saravanan,
    First I populate the context node and it won't change during view's lifecycle.  After that, I build my view and bind the TextView UI elements to the node context attributes elements.
    If the node has 10 elements, I will build 10 TextView UI elements and bind them to each attribute element.
    Regards,
    Geraldo Brígido.

  • Error by binding a table to context node

    Hello Experts,
    If I try to bind a table of strings, there comes the error:
    "Dynamic type conflict during the assignment of references."
    Here is my coding:
    METHOD fill_cssref_data .
      "Stores the references to the css
      DATA: lt_cssref TYPE TABLE OF string,
            wb_cssref LIKE LINE OF lt_cssref.
      DATA: lo_nd_cssref TYPE REF TO if_wd_context_node.
      DATA: wb_messages LIKE LINE OF lt_messages.
      lo_nd_cssref = wd_context->get_child_node( wd_this->wdctx_cssref_data ).
      LOOP AT lt_messages INTO wb_messages.
        CONCATENATE 'https://gtp.wdf.sap.corp/sap/bc/webdynpro/qce/msg_gui_edit?sap-language=E&csinsta='
                      wb_messages-installno '&mnumm=' wb_messages-problemno '&myear=' wb_messages-pyear
        INTO wb_cssref.
        APPEND wb_cssref TO lt_cssref.
      ENDLOOP.
      lo_nd_cssref->bind_table( lt_cssref ).
    endmethod.
    The node "CSSREF_DATA" contains just one attribute "CSSREF" type string, so I don't know why there's a problem binding a table of strings to this node.
    I also tried the method "lo_nd_cssref->bind_elements( lt_cssref )", but the result was the same.
    Does anybody know where my mistake is?
    Best regards,
    Lennart

    Hello,
    the problem was, that the string table had not the same name as the context node.
    Best regards,
    Lennart

  • 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

  • Bind Dynamic Table To a Context Node

    Hello,
    I created an internal dynamic Table. I want to show this table in an ALV-Table. So I want to bind it to a context node.
    I create the context node attributes by this:
    lr_node_info ?= lo_nd_template_exp->get_node_info( ).
    *Type of table type and context type have to be the same
    LOOP AT lt_plchar INTO ls_plchar.
      clear lv_text.
      lv_text = ls_plchar-plchar.
      TRANSLATE lv_text TO UPPER CASE.
      ls_fieldcatalog-fieldname = lv_text.
      ls_fieldcatalog-inttype  = 'C'.
      ls_fieldcatalog-intlen   = '10'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      ls_attribute-name = lv_text.
      ls_attribute-type_name = 'CHAR10'.
      lr_node_info->add_attribute( EXPORTING attribute_info = ls_attribute ).
    ENDLOOP.
    So I create a fieldcatalog and the attributes at once.
    Then I generate the table with  this:
    CALL METHOD cl_alv_table_create=>create_dynamic_table
           EXPORTING
             it_fieldcatalog = lt_fieldcatalog
           IMPORTING
             ep_table = <fs_data>
           EXCEPTIONS
             generate_subpool_dir_full = 1
             OTHERS = 2  .
      IF sy-subrc <> 0.
      ENDIF.
    * So  now points to our dynamic internal table.
      ASSIGN <fs_data>->* TO <fs_1>.
    * Next step is to create a work area for our dynamic internal table.
      CREATE DATA new_line LIKE LINE OF <fs_1>.
    * A field-symbol to access that work area
      ASSIGN new_line->*  TO <new_line>.
      Data: copy_table type ref to data.
      field-symbols: <copy_table> type standard table.
      create data copy_table like table of <new_line>.
      assign copy_table->* to <copy_table>.
    ok, nice. when i now bind the table to  <copy_table> to lo_nd_template_exp it all works fine. But i also want to but the data into the table.
    This also works. When I debug, I can see the table filled with the values. But then there's always this error:
    Invalid operand type for the MOVE-CORRESPONDING statement.
    Ok, I have read, that the types may be  not fit. But I don't know why and how i can solve it.
    Do you have any ideas?

    Hi,
    I've the same problem: I must create all attribute of my node at run-time and then create alv.
    I use the method:
    DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
    DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
      lo_cmp_usage =   wd_this->wd_cpuse_alv( ).
      IF lo_cmp_usage->has_active_component( ) IS INITIAL.
        lo_cmp_usage->create_component( ).
      ENDIF.
    Pass context node to ALV
      lo_interfacecontroller =   wd_this->wd_cpifc_alv( ).
      lo_interfacecontroller->set_data( node_lenght ).  " node_lenght is my dynamic node
    But I receive this message error:
    Invalid operand type for the MOVE-CORRESPONDING statement.
    Method: IF_WD_CONTEXT_NODE~GET_STATIC_ATTRIBUTES_TABLE of program CL_WDR_CONTEXT_NODE_VAL=======CP
    Method: GET_REF_TO_TABLE of program CL_SALV_WD_DATA_TABLE=========CP
    Method: EXECUTE of program CL_SALV_BS_SERVICE_MNGR_TABLE=CP
    Method: EXECUTE of program CL_SALV_WD_SERVICE_MANAGER====CP
    Method: APPLY_SERVICES of program CL_SALV_BS_RESULT_DATA_TABLE==CP
    Method: REFRESH of program CL_SALV_BS_RESULT_DATA_TABLE==CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE_DATA of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_DATA~UPDATE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_VIEW~MODIFY of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    What can I do??? My node doesn't static attribute....
    Thank,
    Federica.

Maybe you are looking for

  • How do I make iTunes recognise album/ artist names?

    I had to format my computer and so backed up my iTunes collection, all 25gb ripped with all correct information tags. I backed up my music using a program called syncback pro which backed up my files as I added them instead of using the iTunes backup

  • Forms and reports server characterset aix

    My database is in UTF8 mode and is displaying all characters correctly. However when I run a report using the forms and reports server it uses Western European Character Set. I have tried re-installing forms and reports server in order to fix this ch

  • Folio showing in Content Viewer, but not when published in Custom Content Viewer... please help...!

    I shared a folio to review it in the Content Viewer and everything looks ok, but when published (public / free) custom viewer (v24) doesn't show it. What could be the problem? Thanks, and excuse my english...

  • Re-run face detection

    Hi, I jumped from 06 to 11 so faces is a new things for me. I tried to search for a way to re-run the face detection after matching 500+ photos. Is there a way to use existing database to work on the rest of the photos? Thanks in advance. Cheers,

  • Installation of SharePoint 2013 three-tier farm installation

    Is it an actual requirement that WFE1 and APP1 be separate servers (virtual or physical), or is recommended best practice? And more than that, I was going to make DC1, WFE1, and APP1 all reside on the same virtual server.  I'll take the spitballs, bu