Add a Transparent Container dynamically in wddomodifyview

Hi All,
I have added UI Elements to views before. Now, I am trying to add a Transparent Container to a Group, which does not work. I am using the same procedure as I have used it for other UI Elements before, but I keep receiving the dump:
The following error text was processed in the system JIL : Access via 'NULL' object reference not possible.
The error occurred on the application server SV-SAP-2_JIL_01 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: CREATE_NW7_BY_VIEW_ELEMENT of program CL_NW7_VIEW_ELEMENT_ADAPTER===CP
My code is as follows:
lo_group ?= view->get_element( 'GROUP' ).
    lo_tc = cl_wd_transparent_container=>new_transparent_container( id = 'TC_SECOND_ELEMENT' ).
    cl_wd_matrix_head_data=>new_matrix_head_data( element = lo_tc ).
    lo_group->add_child( the_child = lo_tc ).
Why does the coding above not work?? How is the proper coding to add a Transparent Container to my group?
THANKS, Johannes

Hi,
Your coding seems to me fine. Though i am not sure if this line causes the error.
cl_wd_matrix_head_data=>new_matrix_head_data( element = lo_tc ).
I normally get this error when the UI element property is not binded correctly. How sure are you that this error is coming  because of this TransparentContainer ?.
You can comment out the whole and check if this is working.
Then enable one by one and see if you get it worked.

Similar Messages

  • Short dump while creating transparent container dynamically

    Hi experts!
    I want to create a transparent container dynamically, but I get a Short Dump (
    Note
    The following error text was processed in the system NSP : Access via 'NULL' object reference not possible.
    The error occurred on the application server Datatrain_NSP_00 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: CREATE_BY_VIEW_ELEMENT of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP)
    while doing so. Below my code...
    Can somebody please advise I don't know what I did wrong....
    Thanks in advance!
    Points will be rewarded
    METHOD wddomodifyview .
    DATA: lr_container TYPE REF TO cl_wd_uielement_container,
            lr_matrix_head TYPE REF TO cl_wd_matrix_data,
            lv_hlp_str TYPE string VALUE 'DYNCONT_1',
            lr_trans_cont TYPE REF TO cl_wd_transparent_container.
        lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
    CALL METHOD cl_wd_transparent_container=>new_transparent_container
      EXPORTING
        enabled                  = ABAP_TRUE
        id                       = lv_hlp_str
        is_layout_container      = ABAP_TRUE
      receiving
        control                  = lr_trans_cont
        lr_matrix_head = cl_wd_matrix_head_data=>new_matrix_head_data(
                            element = lr_trans_cont ).
        lr_trans_cont->set_layout_data( lr_matrix_head ).
        lr_container->add_child( lr_trans_cont ).

    Hi Felix,
    You need to set the layout first and then set the layout data. Use the method cl_wd_matrix_layout=>new_matrix_layout. Do a set_layout on the container and then do set_layout_data. That should solve your problem.
    Regards
    Nithya

  • Dynamic programming: Add transparent container to root container

    Hi all,
    I'm trying to add a transparent container to the root container,
    but I´m getting this error: 'ASSERT condition was violated'
    METHOD WDDOMODIFYVIEW .
      DATA: LR_ROOT       TYPE REF TO CL_WD_UIELEMENT_CONTAINER,
            LR_TCONTAINER TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.
      LR_ROOT ?= VIEW->GET_ROOT_ELEMENT( ).
      LR_TCONTAINER = CL_WD_TRANSPARENT_CONTAINER=>NEW_TRANSPARENT_CONTAINER( ).
      CL_WD_FLOW_DATA=>NEW_FLOW_DATA( LR_TCONTAINER ).
      LR_ROOT->ADD_CHILD( LR_TCONTAINER ).
    ENDMETHOD.
    Is something wrong with this code?
    Thank you.
    Regards,
    Thomas

    >
    Giscard Rous wrote:
    > I have the same problem.
    > I am getting the error "The ASSERT condition was violated".
    >
    > I have reduced my code to just simply add a transparent container to the rootuielement and I am getting the error.
    >
    > I could not figure out why.  Does anyone have info on this?  Thanks.
    >
    > Giscard
    My problem was the layout, after I added it, the problem was solved.
    METHOD WDDOMODIFYVIEW .
      DATA: LR_ROOT       TYPE REF TO CL_WD_UIELEMENT_CONTAINER,
                 LR_TCONTAINER TYPE REF TO CL_WD_TRANSPARENT_CONTAINER.
      LR_ROOT ?= VIEW->GET_ROOT_ELEMENT( ).
      LR_TCONTAINER = CL_WD_TRANSPARENT_CONTAINER=>NEW_TRANSPARENT_CONTAINER( ).
      CL_WD_FLOW_DATA=>NEW_FLOW_DATA( LR_TCONTAINER ).
      CL_WD_FLOW_LAYOUT=>NEW_FLOW_LAYOUT( LR_TCONTAINER ).
      LR_ROOT->ADD_CHILD( LR_TCONTAINER ).
    ENDMETHOD.
    Hope it helps you.
    Regards,
    Thomas

  • Dynamic Transparent Container

    Hi,
    I am new to Web Dynpro. I have the following problem.
    How to set Streched horizontal property in Transparent Container dynamically?
    Thanks,
    Peter,

    hi
    hope it will be very helpful
    IWDTransparentContainer transNew=(IWDTransparentContainer)view.createElement(IWDTransparentContainer.class,"TranName");
    transNew.createLayout(IWDMatrixLayout.class);
    transNew.destroyAllChildren();
    IWDMatrixLayout gl=(IWDMatrixLayout)transNew.createLayout(IWDMatrixLayout.class);
    gl.setStretchedHorizontally(false);
    gl.setStretchedVertcally(false);
    if you give gl.setStretchedVertcally(false);
    it will be very compact structure in your view
    Regards
    Dhinakar J

  • Generate a dynamic Transparent container in WD

    Hi all,
    i' ve created a Transparent conatiner in where i will write my text, i also created a Button (ADD)
    what i want now is, after clicking on the (Add) Button, a new Transparent container will appear, 
    how can' I do this dynamically??  i dont want to create 10 or 20 transparent container in my main view, i want to create  only one, and after clicking on the Add Button, an other one will appears,
    is there a way or any method to do this?
    thank you all for your help

    Hello Thomas,
    You could refer the below thread. [thread|Re: How to dynamically generate a transparent container ?]
    all the code required to do things dynamically has to be inside wddomodifyview method of that particular view.
    Since you want that on a click of a button you would like to add a new transparent container, you could create a varible of type wdy_boolean under attributes tab of the view and onaction associated with the button you change that value and you write the code for transparent container in wddomodifyview, and before that could you could have a if statement if variable value is true you would run the below code.
    Regards
    Anurag Chopra

  • Dynamic Programming: Adding Transparent Container to Root Element

    Hi,
    I simply am adding a Transparent Container to the Root Element dynamically and I am getting the error "The ASSERT condition was violated".
    Does anyone have an idea what the problem is.
    Below is my VERY MUCH simplified code:
    method WDDOMODIFYVIEW .
      DATA:
        LR_ROOT TYPE REF TO CL_WD_UIELEMENT_CONTAINER,
        LR_TCONTAINER TYPE REF TO CL_WD_TRANSPARENT_CONTAINER,
        LR_FLOW_DATA TYPE REF TO CL_WD_FLOW_DATA.
      LR_ROOT ?= VIEW->GET_ROOT_ELEMENT( ).
      LR_TCONTAINER = CL_WD_TRANSPARENT_CONTAINER=>NEW_TRANSPARENT_CONTAINER(
        id = 'TCONTAINER_01' ).
      LR_FLOW_DATA = CL_WD_FLOW_DATA=>NEW_FLOW_DATA( LR_TCONTAINER ).
      LR_TCONTAINER->SET_LAYOUT_DATA( LR_FLOW_DATA ).
      LR_ROOT->ADD_CHILD( LR_TCONTAINER ).
    endmethod.

    Found the answer on this link:
    Creating dynamic tranparent container

  • ABAP: Dynamic creation of transparent container

    Hello,
    I have this code and it fails (null pointer exception):
    transparent_container = cl_wd_transparent_container=>new_transparent_container( ).
      cl_wd_grid_data=>new_grid_data( element = transparent_container ).
      ui_container->add_child( transparent_container ).
    What is the problem? Do I need to create transparent container and pass some parameters?
    Thank you.

    Hello Armin,
    yes it is.
    I have some code like this:
      "create a transparent container
      transparent_container = cl_wd_transparent_container=>new_transparent_container( ).
      cl_wd_grid_data=>new_grid_data( element = transparent_container ).
      ui_container->add_child( transparent_container ).
      "create a dropDown with figures
      drop_down_figure = cl_wd_dropdown_by_key=>new_dropdown_by_key( bind_selected_key = 'REPOSITORY.FIGURES' on_select = 'GET_OPERATOR' ).
      cl_wd_grid_data=>new_grid_data( element = drop_down_figure ).
      ui_container->add_child( drop_down_figure ).
    If I comment out code where I create transparent container it works fine and creates dropDown.
    However, as soon as I add transparent container I get NullPointer exception.
    Thank you.

  • Programatically hide a transparent container

    Hi Experts,
    i am using select options in my application.
    i have made two block for the selec options (transparent container 1 and transparent container 2) by using add_block method of select option.So i cant do the normal context binding as containers are created programatically.
    Now i have a requirement to hide one of the block on click of an event so that the select options inside is also hidden.
    DATA lo_ui_element      type ref to CL_WD_UIELEMENT.
          DATA lo_container       TYPE REF TO cl_wd_uielement_container.
          DATA lo_transc           TYPE REF TO cl_wd_view_element.
    " get root container
         lo_container ?= view->get_root_element( ).
    *" get button reference
         lo_transc ?= lo_container->get_child() // Get the tray which container the view container of select options.
    then inside this i have the transparent container which has the selec options.
    Please help
    Tashi

    Hi Tashi,
    1. Add your Select-Options screen elements(Your blocks) to UI View Container element and bind the context to WDUI_VISIBILITY. Set the visibility depends on your requirement.
    2. You have REMOVE_SELECTION_SCREEN_ITEM method from Interface IF_WD_SELECT_OPTIONS to remove the fields at runtime.
    Please follow the below link
    Creation and Deletion of selection screen elements based on user action
    Hope it helps you
    BR,
    RAM.

  • Transparent Container Cell Background design

    Hi All,
    I have a scenario where in on click of a link, I'm needed to highlight a transparent container. In Webdynpro JAVA i used to achieve this using Transparent Container -> cellBackGroundDesign -> WDCellBackgroundDesign.BORDER
    What is the equivalent of this in WD ABAP. I do not find any such attribute in particular.
    Any pointers on this will be of great help.
    Thanks & Regards,
    Gayathri Shanbhag

    Hi All
    On switching from flow to matrix layout I found the property cellBackGroundDesign, but it is not bindable to an attribute, in my scenario I'm needed to set the border/highlight dynamically. Please suggest if there is an alternative.
    Thanks & Regards,
    Gayathri Shanbhag

  • Move transparent container from tab to new view

    Hi
    I have a scenario where I wish to move the whole layout structure from a tab to a new view.
    Essentially I want to move from a tabstrip to a roadmap type of development.  My issue is that if I copy the transparent container that houses the whole structure, when I paste the structure all my elements have _CP. Is there any way to paste without have this suffix?
    Cheers
    Ian

    >
    Thomas Jung wrote:
    > I can't think of any offical way of doing this. 
    >
    > I have one suggestion - but it is totally not supported by SAP and if anyone asks you didn't get it from me.
    > You could use SAPLink to export the component to XML.  Once in XML on your desktop, use a text editor to do a mass find and replace.  Then reimport the same object back into your system via SAPLink.
    > [http://code.google.com/p/saplink/|http://code.google.com/p/saplink/]
    >
    > Just curious however - why worry about the _CP on the UI elements at all?  It is just that you don't like the prefix?  I agree it makes things look messy, but if you are correcting binding UI to your context instead of directly coding against the UI elements (with the rare exception of really dynamic stuff) the IDs of the element shouldn't break anything in your application.
    PS:  Obviously monkeying around with the component using find and replace on the XML and importing via SAPLink could be dangerous. I just thought after I posted I should stress the warning a little more.  You probably want to copy your entire component before attempting this - just incase it completely screws things up.

  • How to add a checkbox to dynamic itab  so that i can select some records

    How to add a checkbox to dynamic itab  so that i can select some records in the alv and can display them in another alv using a button
    I have requirement where i have to display the dynamic itab records in an alv ....Some records from this alv output has to be selected through checkbox  provided in the first column .( I will get to know the structure of the itab only at runtime ,so iam using dynamic itab)

    Hi,
       I tried and finally i got it , Just try for it.
    type-pools : slis.
    PARAMETERS : p_tab type dd02l-tabname.
    data : ref_tabletype  type REF TO cl_abap_tabledescr,
           ref_rowtype TYPE REF TO cl_abap_structdescr.
    field-symbols  : <lt_table>  type   standard TABLE ,
           <fwa> type any,
           <field> type abap_compdescr.
    data : lt_fcat type lvc_t_fcat,
           ls_fcat type lvc_s_fcat,
           lt_fldcat type SLIS_T_FIELDCAT_ALV,
           ls_fldcat like line of lt_fldcat.
    data : ref_data type REF TO data,
            ref_wa type ref to  data.
    ref_rowtype ?= cl_abap_typedescr=>DESCRIBE_BY_name( p_name = p_tab ).
    TRY.
    CALL METHOD cl_abap_tabledescr=>create
      EXPORTING
        p_line_type  = ref_rowtype
      receiving
        p_result     = ref_tabletype.
    CATCH cx_sy_table_creation .
    write : / 'Object Not Found'.
    ENDTRY.
    *creating object.
    create data ref_data type handle ref_tabletype.
    create data ref_wa type handle ref_rowtype.
    *value assignment.
    ASSIGN ref_data->* to <lt_table>.
    assign ref_wa->* to <fwa>.
    loop at ref_rowtype->components ASSIGNING <field>.
      ls_fcat-fieldname = <field>-name.
      ls_fcat-ref_table = p_tab.
      append ls_fcat to lt_fcat.
    if lt_fldcat[] is  INITIAL.
        ls_fldcat-fieldname = 'CHECKBOX'.
        ls_fldcat-checkbox = 'X'.
        ls_fldcat-edit = 'X'.
        ls_fldcat-seltext_m = 'Checkbox'.
        append ls_fldcat to lt_fldcat.
      endif.
      clear ls_fldcat.
      ls_fldcat-fieldname = <field>-name.
      ls_fldcat-ref_tabname = p_tab.
      append ls_fldcat to lt_fldcat.
    endloop.
    loop at lt_fldcat into ls_fldcat.
      if sy-tabix = 1.
        ls_fldcat-checkbox = 'X'.
        ls_fldcat-edit = 'X'.
    modify lt_fldcat FROM ls_fldcat
        TRANSPORTING checkbox edit.
    endif.
    endloop.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog           = lt_fcat[]
      IMPORTING
        ep_table                  = ref_data.
    assign ref_data->* to <lt_table>.
    select * FROM (p_tab) into table <lt_table>.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       IT_FIELDCAT                       = lt_fldcat[]
      TABLES
        t_outtab                          = <lt_table>.
    Thanks & Regards,
    Raghunadh .K

  • How to hide a transparent container and its fields in webdynpro abap

    Hello Friends,
    I am trying to create a view where i want to show some fields based on some other field.
    What i exactly need is When i enter some data in 1 input field .
    Corresponding to that input field few text fields wud be opened automatically in the same view.
    No Pop-ups allowed.
    What i am doing is !!
    i have created another Transparent container for my  text view fields.
    But i  am unable to hide this fields..
    Kindly help..
    At the runtime..
    After entering the value in the input field..
    This transparent container should become visible with the textview fields...
    Gaur Mayank

    Hi,
    Create A Context Attribute (Say  Visible_Hide )of Type WDUI_VISIBILITY with initial value as 01.
    Goto your Container, Bind the Visible Property with Above Created Attribute(Visible_Hide).
    In the Input Field,Use the OnEnter Event and Set the Value to Visible_Hide as 02.
    Then the Container will be Visible.
    Thaks.
    Uma

  • Add a data series dynamically in charts

    I am trying to add a data series dynamically in a chart but
    it does not seems to work. Here is the sample code. Any idea?
    var line1:LineSeries=new LineSeries();
    line1.dataProvider=[something];
    line1.displayName="New data";
    chart.secondSeries.push(line1);
    It works if I do the following but I don't want to remove
    other series already there.
    var arr = new Array();
    chart.secondSeries=arr;
    var line1:LineSeries=new LineSeries();
    line1.dataProvider=[something];
    line1.displayName="New data";
    arr.push(line1);

    I see...i don't know why the chart is not refreshing itself
    in the next keyframe after you added another series. You can also
    try to put the statement:
    [myChart.series[(myChart.series as Array).length] = your new
    ColumnSeries object goes here.]
    in a new frame by doing doLater();
    Apparently an asigninment statement on the series array does
    the trick. If you don't like that approach, you can also try to
    invalidate the display object, so that a refresh is forced.
    -george

  • Transparent Container UI Element

    Hi
    I am new to Web Dynpro for ABAP and have been tasked with the creation of a complex input screen with a tabbed strip of 12 tabs with 7 columns on each tab.  Each column also has multiple input fields on it. 
    My question is in the design of the screen.  I am currently equating the Transparent Container as an (X)HTML DIV tag for my screen formatting.
    Would this be a fair assumption?
    Are there any documents on screen design?
    Regards
    Ian

    Ian,
    For HTML client TransparentContainer is in fact rendered as DIV element. Though, it may be changed.
    Anyway, this is quite safe analogy.
    For your task you may use either:
    1. Matrix/Grid layout of Tab content and no Transparent containers at all. You may get columns effect using layout only.
    2. Matrix layout with 7 columns (one row) and transparent container in every cell. Use this only if [1] is not suitable, i.e. when layout in every column differs too much.
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • How to add new field into dynamic internal table

    Hello Expert.
    how to add new field into dynamic internal table.
    PARAMETERS: P_TABLE(30).    "table name
    DATA: I_TAB TYPE REF TO DATA.
    FIELD-SYMBOLS: <TAB> TYPE standard TABLE.
    *Create dynamic FS
    create DATA I_TAB TYPE TABLE OF (p_table).
      ASSIGN I_TAB->* TO <TAB>.
    SELECT * FROM (p_table) INTO TABLE <TAB>.
       here i want to add one more field into <TAB> at LAST position and my 
       Field name  =  field_stype     and
       Field type    =  'LVC_T_STYL'
    could you please helpme out .

    Hi,
    Please find the code below.You can add the field acc to your requirement.
    Creating Dynamic internal table
    TYPE-POOLS: slis.
    FIELD-SYMBOLS: <t_dyntable> TYPE STANDARD TABLE,  u201C Dynamic internal table name
                   <fs_dyntable>,                     u201C Field symbol to create work area
                   <fs_fldval> type any.              u201C Field symbol to assign values 
    PARAMETERS: p_cols(5) TYPE c.                     u201C Input number of columns
    DATA:   t_newtable TYPE REF TO data,
            t_newline  TYPE REF TO data,
            t_fldcat   TYPE slis_t_fldcat_alv,
            t_fldcat   TYPE lvc_t_fcat,
            wa_it_fldcat TYPE lvc_s_fcat,
            wa_colno(2) TYPE n,
            wa_flname(5) TYPE c. 
    Create fields .
      DO p_cols TIMES.
        CLEAR wa_it_fldcat.
        move sy-index to wa_colno.
        concatenate 'COL'
                    wa_colno
               into wa_flname.
        wa_it_fldcat-fieldname = wa_flname.
        wa_it_fldcat-datatype = 'CHAR'.
        wa_it_fldcat-intlen = 10.
        APPEND wa_it_fldcat TO t_fldcat.
      ENDDO. 
    Create dynamic internal table and assign to FS
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = t_fldcat
        IMPORTING
          ep_table        = t_newtable. 
      ASSIGN t_newtable->* TO <t_dyntable>. 
    Create dynamic work area and assign to FS
      CREATE DATA t_newline LIKE LINE OF <t_dyntable>.
      ASSIGN t_newline->* TO <fs_dyntable>.
    Populating Dynamic internal table 
      DATA: fieldname(20) TYPE c.
      DATA: fieldvalue(10) TYPE c.
      DATA: index(3) TYPE c. 
      DO p_cols TIMES. 
        index = sy-index.
        MOVE sy-index TO wa_colno.
        CONCATENATE 'COL'
                    wa_colno
               INTO wa_flname. 
    Set up fieldvalue
        CONCATENATE 'VALUE' index INTO
                    fieldvalue.
        CONDENSE    fieldvalue NO-GAPS. 
        ASSIGN COMPONENT  wa_flname
            OF STRUCTURE <fs_dyntable> TO <fs_fldval>.
        <fs_fldval> =  fieldvalue. 
      ENDDO. 
    Append to the dynamic internal table
      APPEND <fs_dyntable> TO <t_dyntable>.
    Displaying dynamic internal table using Grid. 
    DATA: wa_cat LIKE LINE OF fs_fldcat. 
      DO p_cols TIMES.
        CLEAR wa_cat.
        MOVE sy-index TO wa_colno.
        CONCATENATE 'COL'
                    wa_colno
               INTO wa_flname. 
        wa_cat-fieldname = wa_flname.
        wa_cat-seltext_s = wa_flname.
        wa_cat-outputlen = '10'.
        APPEND wa_cat TO fs_fldcat.
      ENDDO. 
    Call ABAP List Viewer (ALV)
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          it_fieldcat = fs_fldcat
        TABLES
          t_outtab    = <t_dyntable>.

Maybe you are looking for

  • HP C5180 AIO: W7-x64 / HP AIO_CDA_Net_Full_Win_WW_130_140 pack installed, but does not function

    Given: 1. local home network (wired) 2. HP C5180 attached to home network 3. Windows 7 Workgroup: WORKGROUP 4. other PC's Windows 7 x86/x64 can all print and scan via AIO C5180 5. IP address: 192.168.xx.yy is allocated to AIO 6. Installation of all H

  • Moving DataSources between source systems

    Hi Gurus, I'm facing problems when trying to move a datasource between two source systems. Here are some details about the situation: - I created a DataSource based on a DB-Connect source system (Oracle DB) - I moved this DS to test system where it h

  • How do I change which media player adobe reader X uses when I click a link that directs me to a vid

    There is a link in a pdf file I use, and when I click on it i receive this message: "This media requires an additional player. Please click 'Get Media Player' to download the correct media player. To play the media, you will need to close and restart

  • No Games category in AppStore

    I just got my "new iPad" and was browsing trough the appStore (on the iPad). There i noticed that i didn't have a "games" category in the Categories tab, but instead i have two Newsstand categories?? I have tried a complete reset of the iPad, and hav

  • What mp3 player would you recomme

    It seems like my Zen is about to die, so I'm wondering what some of you might suggest as a replacement. I really don't want an iPod 'cause I'm in NY and everyone and their dog has one. The specs I'm looking for, in order of importance, are: . Stabili