How to create a structure statically in webdynpros

hi experts,
after creating structure when we run the structure the contents of the structure will be diplayed for the first time if we run once again the contents won't be displayed .
how to create structure so that elements should be as it is

hi experts,
after creating structure when we run the structure the contents of the structure will be diplayed for the first time if we run once again the contents won't be displayed .
how to create structure so that elements should be as it is

Similar Messages

  • Procedure to how to create a pop up in webdynpro

    hi all,
      will anybody guide me the procedure to how to create a pop up in webdynpro application..plz as am new to it and i had requirement of creating pop up window in starting the application.
    thanks in advance.

    hi suman,
    thanks for ur reply.
    i want my pop up when i clk on button ok on my 1st view.
    so i included the code in the method of ONACTION OK.
    but am not able to display any sort of pop up.
    my code is
    DATA lo_nd_node TYPE REF TO if_wd_context_node.
          data: lr_popup type ref to if_wd_window,
            lr_view_controller type ref to if_wd_view_controller.
    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.
    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            = 'WW_POP'
                      title                  = 'my first message'
                      close_in_any_case      = abap_true
                       message_display_mode   = if_wd_window=>co_msg_display_mode_selected
                      close_button           = abap_true
                       button_kind            = if_wd_window=>co_buttons_ok
                       message_type           = if_wd_window=>co_msg_type_none
                       default_button         = if_wd_window=>co_button_ok
    lo_window->open( ).
    will u help me out in this.

  • Regarding how to create organization structure in sap workflow

    hi Guru's
    i am new for wokflow i dont no how to create organization structure.
    pl any body help me
    regards
    vijay

    http://help.sap.com/saphelp_erp2005/helpdata/ru/05/dfba3692dc635ce10000009b38f839/frameset.htm

  • How to create new structure for SOP?

    How to create new structure for SOP? and transfer data for long term planning?

    hi dear
    For SOP there are two types
    1. Standard SOP : this the standard SOP  configured by SAP consider the Level by Level planning and planning done for product group .
    2. Flexible planning SOP: this option is given, so that Rough planning/SOP planning can be done as per the client requirement.e.g planning structure can be sales orgn., distribution channel, division, plant, material
    For configuring the flexible planning SOP follow steps
    1. Define info structure in IMG
    where u define the characteristic and Key field
    2. Set parameters for info structures and key figures
    Sales & Operations Planning >Master Data>Set parameters for info structures and key figures
    where u define  Planning method
    Consistent planning
    Level-by-level planning
    Delta planning
    and aggregation type
    1. Average calculated
    2. Total created
    3. No aggregation
    3. create Planning type with reference to info structure
    Regards
    Suresh

  • Step by step on how to create organizational structure(plan) for workflow?

    Hi Experts,
    Can anyone send me a step by step process on how to create organizational structure(plan) for workflow?
    Thanks a lot in advance.
    Rgds,
    TM

    Hi,
    You can use the following accessible transactions to process your organizational plan:
    Transaction     Name of Transaction
    PPO5                     Change Attributes
    PPO6                     Display Attributes
    PPOCE                      Create Organization and Staffing
    PPOCW                      Create Organization and Staffing (WF)
    PPOME                     Change Organization and Staffing
    PPOMW                     Change Organization and Staffing (WF)
    PPOSE                      Display Organization and Staffing
    PPOSW                      Display Organization and Staffing (WF)
    PP01                      Maintain Plan Data (Menu)
    PP01_DISP      Display Plan Data (Menu)
    PP03                       Maintain Plan Data (Actions)
    PP03                       Execute Action Directly
    Regards,
    Deepa Kulkarni

  • How to create custom structure in smart forms & use them in interface

    hi experts....
    can anyone tell me how to use  custom structure in
    form interface (parameters) without creating any structure
    in the dictionary.

    Hi Shrama,
    If you want to use the structure in interface. You have to create structure in dictionary.
    if you create in form or in report ..they won't recongnize the local structures.
    Thanks,
    Sunil

  • How to create the PDF file in WebDynpro?

    Hi.
           How to create PDF file in Webdynpro?
    I have one WD screen In there i have one File Download action. Once i click that it will open one PDF file which consisting of all details.
    Pls reply me.
    with regards,
    Gobintah.R

    Hi
    Check these links
    Re: Opening a PDF File from WebDynpro
    Re: Generating PDF file using FOP API in Web Dynpro
    http://help.sap.com/saphelp_nw04/helpdata/en/1a/ff773f12f14a18e10000000a114084/frameset.htm
    Thanks
    Edited by: Anup Bharti on Oct 16, 2008 11:51 AM

  • How I create a structure in the ABAP DICTIONARY?

    I need a structure for a FORM, how can I create a structure in the ABAP DICTIONARY?
    Thanks!!

    Hi Carlos,
    Go to SE11(ABAP Dictionary).
    Select the Data Type radio button.
    Specify the name for your structure.
    Note structure in customer namespace should start with Z or Y.
    Press the create button.
    Then in the next dialog box select the structure radio button.
    Then you will get in to the structure screen.
    Give a meaningful description for your structure.
    Add the relevant fields and finally activate.
    Regards,
    Abdul

  • How to create a table dynamically in webdynpro

    hai everybody
    in webdynpro we know how to create at design time
    but i want to create it at runtime that is dynmamically i want to set the rows and coloums of the table at run time
    Thanks & Regards
    sravan

    I guess this should work,
    Suppose you want to dynamically create a Table (say Category) having a column called Category Code, then in the wdDoModifyView() hook method, just add the following code snippet,
    if (firstTime) {
    //Create the Table UI Element
    IWDTable table = (IWDTable) view.createElement(IWDTable.class, null);
    //Set the Table Header
    IWDCaption tableCaption = (IWDCaption) view.createElement(IWDCaption.class, null);
    tableCaption.setText("Category Table Contents");
    table.setHeader(tableCaption);
    //Create and add a Column UI element for the above table     
    IWDTableColumn column = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);
    table.addColumn(column);
    //Set the required column header using the caption (Category Code here)                         
    IWDCaption caption = (IWDCaption) view.createElement(IWDCaption.class, null);
    caption.setText("Category Code");
    column.setHeader(caption);
    //Create a TableCellEditor and bind it to an attribute of the Category Node in the context     
    IWDTextView editor = (IWDTextView) view.createElement(IWDTextView.class, null);
    editor.bindText("tb_Category.cat_code");
    column.setTableCellEditor(editor);
    //Finally add the Table UI element to the view          
    IWDUIElementContainer root = (IWDUIElementContainer) view.getRootElement();
    root.addChild(table);
    You need to follow the same procedure for adding multiple columns to the table.
    Hope this answers your question!
    Regards
    Kishan

  • How to create a structure which can hold a dynamic table as a field in DDIC

    Hi ,
           I am designing a solution for a problem and have a unique requirement.  I need to create a structure which can hold a field where dynamic table data can be stored.  Let me illustrate with an example :
    My structure  ( say  Z_output_struc ) will have the fields
    Table_name  Table_Data
    My function module will have a table type of the above structure, so in effect ,my output can have multiple table names and related to each of them, there will be table data of that table name. The issue is how do I configure this in DDIC ?
    I tried creating table_data as "Type ref to Data"  but was stuck  inside the func module when I tried to transfer data to this.
    Any pointers as to how to think about this differently ? 
    Best Regards,
    Girish

    Hi Girish,
    you start directly from the ref to data. You assign it to a field symbol and cast this to the type of the destination of your select. So you can directly add the reference to the cache:
    I hope this example helps a bit (I took a form instead of a function module as it is easier to add here and used an hr table as kna1 is empty on my test system):
    REPORT  z_rwe_99_dyn_tab_cache.
    * type definition
    TYPES:
      BEGIN OF _s_cache,
        table TYPE        tabname16,
        cache TYPE REF TO data,
      END   OF _s_cache,
      _t_cache TYPE STANDARD TABLE OF _s_cache.
    * data declaration
    DATA:
      lv_table     TYPE tabname16,
      lv_condition TYPE string,
      lt_cache     TYPE _t_cache.
    * define table and condition
    lv_table     = 'HRP1000'.
    lv_condition = 'plvar = ''01'' and otype = ''S'' and objid = ''50000016'''.
    * get the result of a single table into the cache
    PERFORM get_dyn_table USING
                            lv_table
                            lv_condition
                          CHANGING
                            lt_cache.
    * form to read a single table
    FORM get_dyn_table USING
                         iv_table     TYPE tabname16
                         iv_condition TYPE string
                       CHANGING
                         ct_cache     TYPE _t_cache.
      FIELD-SYMBOLS:
        <lt_table> TYPE ANY TABLE.
      DATA:
        ls_cache TYPE        _s_cache,
        lr_data  TYPE REF TO data.
      CREATE DATA lr_data TYPE STANDARD TABLE OF (iv_table).
      ASSIGN lr_data->* TO <lt_table>.
      SELECT * FROM (iv_table) INTO TABLE <lt_table>
        WHERE
          (iv_condition).
      ls_cache-table = lv_table.
      ls_cache-cache = lr_data.
      APPEND ls_cache TO ct_cache.
    ENDFORM.                    "get_dyn_table
    If you have more questions just give another post.
    Best Regards
    Roman

  • How to create tables in Database when webdynpro project is deployed

    Hi
    I Created a project.in that i created stuctures using simpletypes.Based on structure  i created the Context,then created screens.Now how to create tables in database using this structures .Because i want to store the values in the database.Please help.this is very urgent.i will give good points
    thanks
    prasad

    Hi Prasad,
    You can write normal JDBC code in your controller.
    Check this Web Dynpro Java
    You can use the tool for generating the classes from your DB.Check this too
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/dfad6017-0301-0010-bdb8-a8b7d2006f36
    Best Regards, Anilkumar

  • How to create tree structure in abap

    hi,
       I am mohan. Please send the how to create the tree structure. how to insert the child nodes in  root node. actually our requirement is we have list transaction codes. We are planning to put all transaction codes in tree level.
    please tell me how to do the program in tree structure.

    Hi Mohan,
    Check the following program on ALV tree.
    REPORT zalvtree.
    CLASS cl_gui_column_tree DEFINITION LOAD.
    CLASS cl_gui_cfw DEFINITION LOAD.
    DATA: go_grid TYPE REF TO cl_gui_alv_grid.
    DATA: ro_grid TYPE REF TO cl_gui_alv_grid.
    DATA tree1  TYPE REF TO cl_gui_alv_tree.
    DATA mr_toolbar TYPE REF TO cl_gui_toolbar.
    DATA : gt_checked TYPE lvc_t_chit,
           gs_checked LIKE LINE OF gt_checked,
           l_part_key TYPE lvc_nkey,
           gt_node TYPE lvc_s_chit-nodekey.
    INCLUDE <icon>.
    INCLUDE zamit_alv_tree_toolbar_event.
    INCLUDE zbcalv_tree_event_receiver.
    *DATA: toolbar_event_receiver TYPE REF TO lcl_toolbar_event_receiver.
    DATA: gt_sflight      TYPE sflight OCCURS 0,      "Output-Table
          gt_fieldcatalog TYPE lvc_t_fcat, "Fieldcatalog
          ok_code LIKE sy-ucomm.           "OK-Code
    START-OF-SELECTION.
    END-OF-SELECTION.
      CALL SCREEN 100.
    *&      Module  PBO  OUTPUT
          process before output
    MODULE pbo OUTPUT.
      SET PF-STATUS 'MAIN100'.
      IF tree1 IS INITIAL.
        PERFORM init_tree.
    else.
                  CALL METHOD me->refresh_table_display
                    EXCEPTIONS
                      PROGRAM_ERROR = 1
                      others        = 2
                  IF sy-subrc <> 0.
                   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
                  ENDIF.
      ENDIF.
      CALL METHOD cl_gui_cfw=>flush.
    ENDMODULE.                             " PBO  OUTPUT
    *&      Module  PAI  INPUT
          process after input
    MODULE pai INPUT.
      CASE ok_code.
        WHEN 'EXIT' OR 'BACK' OR 'CANC'.
          PERFORM exit_program.
    *mrk
        WHEN 'MOVE'.
          PERFORM check_selection.
        WHEN 'MBAK'.
          PERFORM another_selection.
        WHEN 'ALL'.
          PERFORM select_all.
        WHEN 'CLEAR'.
          PERFORM clear_all.
        WHEN 'DELETE'.
          PERFORM delete_all.
        WHEN 'EXPAND'.
          PERFORM expand_all.
        WHEN 'COLLAPSE'.
          PERFORM collapse_all.
        WHEN OTHERS.
          CALL METHOD cl_gui_cfw=>dispatch.
      ENDCASE.
      CLEAR ok_code.
      CALL METHOD cl_gui_cfw=>flush.
    ENDMODULE.                             " PAI  INPUT
    *&      Form  build_fieldcatalog
          build fieldcatalog for structure sflight
    FORM build_fieldcatalog.
    get fieldcatalog
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'SFLIGHT'
        CHANGING
          ct_fieldcat      = gt_fieldcatalog.
    change fieldcatalog
      DATA: ls_fieldcatalog TYPE lvc_s_fcat.
      LOOP AT gt_fieldcatalog INTO ls_fieldcatalog.
        CASE ls_fieldcatalog-fieldname.
          WHEN 'CARRID' OR 'CONNID' OR 'FLDATE'.
            ls_fieldcatalog-no_out = 'X'.
            ls_fieldcatalog-key    = ''.
          WHEN 'PRICE' OR 'SEATSOCC' OR 'SEATSMAX' OR 'PAYMENTSUM'.
            ls_fieldcatalog-do_sum = 'X'.
        ENDCASE.
        MODIFY gt_fieldcatalog FROM ls_fieldcatalog.
      ENDLOOP.
    ENDFORM.                               " build_fieldcatalog
    *&      Form  build_hierarchy_header
          build hierarchy-header-information
         -->P_L_HIERARCHY_HEADER  strucxture for hierarchy-header
    FORM build_hierarchy_header CHANGING
                                   p_hierarchy_header TYPE treev_hhdr.
      p_hierarchy_header-heading = 'Hierarchy Header'.          "#EC NOTEXT
      p_hierarchy_header-tooltip =
                             'This is the Hierarchy Header !'.  "#EC NOTEXT
      p_hierarchy_header-width = 30.
      p_hierarchy_header-width_pix = ''.
    ENDFORM.                               " build_hierarchy_header
    *&      Form  exit_program
          free object and leave program
    FORM exit_program.
      CALL METHOD tree1->free.
      LEAVE PROGRAM.
    ENDFORM.                               " exit_program
    *&      Form  check_selection
          text
    -->  p1        text
    <--  p2        text
    FORM check_selection .
    create container for alv-tree
      DATA: l_tree_container_name(30) TYPE c,
            l_custom_container2 TYPE REF TO cl_gui_custom_container.
      l_tree_container_name = 'TREE2'.
      IF sy-batch IS INITIAL.
        CREATE OBJECT l_custom_container2
          EXPORTING
                container_name = l_tree_container_name
          EXCEPTIONS
                cntl_error                  = 1
                cntl_system_error           = 2
                create_error                = 3
                lifetime_error              = 4
                lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc <> 0.
          MESSAGE x208(00) WITH 'ERROR'.                        "#EC NOTEXT
        ENDIF.
      ENDIF.
      CREATE OBJECT go_grid
        EXPORTING
       I_SHELLSTYLE      = 0
       I_LIFETIME        =
          i_parent          = l_custom_container2
       I_APPL_EVENTS     = space
       I_PARENTDBG       =
       I_APPLOGPARENT    =
       I_GRAPHICSPARENT  =
       I_NAME            =
    EXCEPTIONS
       ERROR_CNTL_CREATE = 1
       ERROR_CNTL_INIT   = 2
       ERROR_CNTL_LINK   = 3
       ERROR_DP_CREATE   = 4
       others            = 5
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      PERFORM load_data_into_grid.
    *data: lt_nodes type LVC_T_NKEY,
         ls_nodes like line of lt_nodes,
         ls_checked like line of gt_checked.
    *loop at gt_checked into ls_checked.
    ls_nodes = ls_checked-nodekey.
    append ls_nodes to lt_nodes.
    *endloop.
    *CALL METHOD tree1->unselect_nodes
    EXPORTING
       it_node_key                  = lt_nodes
    EXCEPTIONS
       CNTL_SYSTEM_ERROR            = 1
       DP_ERROR                     = 2
       MULTIPLE_NODE_SELECTION_ONLY = 3
       ERROR_IN_NODE_KEY_TABLE      = 4
       FAILED                       = 5
       others                       = 6
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    ENDFORM.                    " check_selection
    *&      Form  another_selection
          text
    -->  p1        text
    <--  p2        text
    FORM another_selection .
    create container for alv-tree
      DATA: l_tree_container_name(30) TYPE c,
            l_custom_container2 TYPE REF TO cl_gui_custom_container.
      l_tree_container_name = 'TREE2'.
      IF sy-batch IS INITIAL.
        CREATE OBJECT l_custom_container2
          EXPORTING
                container_name = l_tree_container_name
          EXCEPTIONS
                cntl_error                  = 1
                cntl_system_error           = 2
                create_error                = 3
                lifetime_error              = 4
                lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc <> 0.
          MESSAGE x208(00) WITH 'ERROR'.                        "#EC NOTEXT
        ENDIF.
      ENDIF.
      CREATE OBJECT ro_grid
        EXPORTING
       I_SHELLSTYLE      = 0
       I_LIFETIME        =
          i_parent          = l_custom_container2
       I_APPL_EVENTS     = space
       I_PARENTDBG       =
       I_APPLOGPARENT    =
       I_GRAPHICSPARENT  =
       I_NAME            =
    EXCEPTIONS
       ERROR_CNTL_CREATE = 1
       ERROR_CNTL_INIT   = 2
       ERROR_CNTL_LINK   = 3
       ERROR_DP_CREATE   = 4
       others            = 5
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      PERFORM load_data_into_grid1.
      DATA: lt_unsel TYPE lvc_t_nkey,
            ls_unsel LIKE LINE OF lt_unsel.
      LOOP AT gt_checked INTO gs_checked.
        ls_unsel = gs_checked-nodekey.
        APPEND ls_unsel TO lt_unsel.
      ENDLOOP.
      CALL METHOD tree1->unselect_nodes
        EXPORTING
          it_node_key                  = lt_unsel
        EXCEPTIONS
          cntl_system_error            = 1
          dp_error                     = 2
          multiple_node_selection_only = 3
          error_in_node_key_table      = 4
          failed                       = 5
          OTHERS                       = 6.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *CALL METHOD tree1->unselect_all
    EXCEPTIONS
       CNTL_SYSTEM_ERROR = 1
       FAILED            = 2
       others            = 3
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
      DATA: text TYPE lvc_value,
       item TYPE lvc_t_layi,
       node TYPE lvc_s_layn,
       inode TYPE lvc_nkey.
      FIELD-SYMBOLS: <wa> TYPE ANY.
      DATA: l_dref_wa LIKE LINE OF gt_sflight.
      ASSIGN l_dref_wa TO <wa>.
      READ TABLE gt_checked INTO gs_checked WITH KEY nodekey = 3.
      inode = gs_checked-nodekey.
      CALL METHOD tree1->get_outtab_line
        EXPORTING
          i_node_key     = inode
        IMPORTING
          e_outtab_line  = <wa>
          e_node_text    = text
          et_item_layout = item
          es_node_layout = node
        EXCEPTIONS
          node_not_found = 1
          OTHERS         = 2.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      DATA: lt_layout TYPE lvc_t_laci,
            layout LIKE LINE OF lt_layout.
      layout-chosen = 'X'.
      layout-fieldname = tree1->c_hierarchy_column_name.
    ls_item_layout-chosen = 'X'.           "To give default checkbox value checked
      layout-class   = cl_gui_column_tree=>item_class_checkbox.
      layout-editable = 'X'.
    LAYOUT-U_CHOSEN = 'X'.
      APPEND layout TO lt_layout.
      CALL METHOD tree1->change_node
        EXPORTING
          i_node_key     = inode
          i_outtab_line  = <wa>
       IS_NODE_LAYOUT =
          it_item_layout =  lt_layout
       I_NODE_TEXT    =
       I_U_NODE_TEXT  =
        EXCEPTIONS
          node_not_found = 1
          OTHERS         = 2
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    *CALL METHOD tree1->change_item
    EXPORTING
       i_node_key     = inode
       i_fieldname    = gs_checked-FIELDNAME
       i_data         = <wa>
       I_U_DATA       = ''
       IS_ITEM_LAYOUT = layout
    EXCEPTIONS
       NODE_NOT_FOUND = 1
       others         = 2
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    *loop at lt_unsel into ls_unsel.
    *CALL METHOD tree1->update_checked_items
    EXPORTING
       i_node_key    = ls_unsel
       i_fieldname   = ''
       i_checked     = ''
    EXCEPTIONS
       PROGRAM_ERROR = 1
       others        = 2
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    *endif.
    ENDFORM.                    " another_selection
    *&      Form  select_all
          text
    -->  p1        text
    <--  p2        text
    FORM select_all .
      CONSTANTS: c_x(1) TYPE c VALUE 'X'.
    *********Check box modifications.
      CALL METHOD tree1->delete_all_nodes
        EXCEPTIONS
          failed            = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    clear l_part_key.
    create hierarchy
      PERFORM create_hierarchy USING c_x.
      CALL METHOD tree1->expand_node
        EXPORTING
          i_node_key          = gt_node
       I_LEVEL_COUNT       = 1
          i_expand_subtree    = 'X'
        EXCEPTIONS
          failed              = 1
          illegal_level_count = 2
          cntl_system_error   = 3
          node_not_found      = 4
          cannot_expand_leaf  = 5
          OTHERS              = 6
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    add own functioncodes to the toolbar
    perform change_toolbar.
    register events
    perform register_events.
    adjust column_width
    call method tree1->COLUMN_OPTIMIZE.
    ENDFORM.                    " select_all
    *&      Form  clear_all
          text
    -->  p1        text
    <--  p2        text
    FORM clear_all .
      CONSTANTS: c_x(1) TYPE c VALUE space.
    *********Check box modifications.
      CALL METHOD tree1->delete_all_nodes
        EXCEPTIONS
          failed            = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    create hierarchy
      PERFORM create_hierarchy USING c_x.
      CALL METHOD tree1->expand_node
        EXPORTING
          i_node_key          = gt_node
       I_LEVEL_COUNT       = 1
          i_expand_subtree    = 'X'
        EXCEPTIONS
          failed              = 1
          illegal_level_count = 2
          cntl_system_error   = 3
          node_not_found      = 4
          cannot_expand_leaf  = 5
          OTHERS              = 6
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " clear_all
    *&      Form  delete_all
          text
    -->  p1        text
    <--  p2        text
    FORM delete_all .
    *********Check box modifications.
      CALL METHOD tree1->delete_all_nodes
        EXCEPTIONS
          failed            = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " delete_all
    *&      Form  expand_all
          text
    -->  p1        text
    <--  p2        text
    FORM expand_all .
      CALL METHOD tree1->expand_node
        EXPORTING
          i_node_key          = gt_node
       I_LEVEL_COUNT       = 1
          i_expand_subtree    = 'X'
        EXCEPTIONS
          failed              = 1
          illegal_level_count = 2
          cntl_system_error   = 3
          node_not_found      = 4
          cannot_expand_leaf  = 5
          OTHERS              = 6
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " expand_all
    *&      Form  collapse_all
          text
    -->  p1        text
    <--  p2        text
    FORM collapse_all .
      CALL METHOD tree1->collapse_all_nodes
        EXCEPTIONS
          failed            = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " collapse_all
    *&      Form  load_data_into_grid
          text
    -->  p1        text
    <--  p2        text
    FORM load_data_into_grid .
      DATA:
      For parameter IS_VARIANT
          l_layout TYPE disvariant,
      gs_layout TYPE lvc_s_layo.
      DATA gi_sflight TYPE TABLE OF zsflight.
    Load data into the grid and display them
      l_layout-report = sy-repid.
      gs_layout-grid_title = 'Amits Test Program'.
      gs_layout-sel_mode = 'A'.
      SELECT *
       FROM zsflight
       INTO TABLE gi_sflight.
      CALL METHOD go_grid->set_table_for_first_display
        EXPORTING
          i_structure_name = 'SFLIGHT'
          is_layout        = gs_layout
          is_variant       = l_layout
          i_save           = 'A'
        CHANGING
          it_outtab        = gi_sflight.
    ENDFORM.                    " load_data_into_grid
    *&      Form  load_data_into_grid
          text
    -->  p1        text
    <--  p2        text
    FORM load_data_into_grid1.
      DATA:
      For parameter IS_VARIANT
          l_layout TYPE disvariant,
      gs_layout TYPE lvc_s_layo.
      DATA gi_sflight TYPE TABLE OF zapempl.
    Load data into the grid and display them
      l_layout-report = sy-repid.
      gs_layout-grid_title = 'Rams Test Program'.
      gs_layout-sel_mode = 'A'.
      SELECT *
       FROM zapempl
       INTO TABLE gi_sflight.
      CALL METHOD ro_grid->set_table_for_first_display
        EXPORTING
          i_structure_name = 'ZAPEMPL'
          is_layout        = gs_layout
          is_variant       = l_layout
          i_save           = 'A'
        CHANGING
          it_outtab        = gi_sflight.
    ENDFORM.                    " load_data_into_grid1
    *&      Form  build_header
          build table for html_header
    -->  p1        text
    <--  p2        text
    FORM build_comment USING
          pt_list_commentary TYPE slis_t_listheader
          p_logo             TYPE sdydo_value.
      DATA: ls_line TYPE slis_listheader.
    LIST HEADING LINE: TYPE H
      CLEAR ls_line.
      ls_line-typ  = 'H'.
    LS_LINE-KEY:  NOT USED FOR THIS TYPE
      ls_line-info = 'ALV-tree-demo: flight-overview'.          "#EC NOTEXT
      APPEND ls_line TO pt_list_commentary.
    STATUS LINE: TYPE S
      CLEAR ls_line.
      ls_line-typ  = 'S'.
      ls_line-key  = 'valid until'.                             "#EC NOTEXT
      ls_line-info = 'January 29 1999'.                         "#EC NOTEXT
      APPEND ls_line TO pt_list_commentary.
      ls_line-key  = 'time'.
      ls_line-info = '2.00 pm'.                                 "#EC NOTEXT
      APPEND ls_line TO pt_list_commentary.
    ACTION LINE: TYPE A
      CLEAR ls_line.
      ls_line-typ  = 'A'.
    LS_LINE-KEY:  NOT USED FOR THIS TYPE
      ls_line-info = 'actual data'.                             "#EC NOTEXT
      APPEND ls_line TO pt_list_commentary.
      p_logo = 'ENJOYSAP_LOGO'.
    ENDFORM.                    "build_comment
    *&      Form  create_hierarchy
          text
    -->  p1        text
    <--  p2        text
    FORM create_hierarchy USING p_x.
      DATA: ls_sflight TYPE sflight,
            lt_sflight TYPE sflight OCCURS 0.
    get data
      SELECT * FROM sflight INTO TABLE lt_sflight
                            UP TO 200 ROWS .
      SORT lt_sflight BY carrid connid fldate.
    add data to tree
      DATA: l_carrid_key TYPE lvc_nkey,
            l_connid_key TYPE lvc_nkey,
            l_last_key TYPE lvc_nkey.
           l_part_key TYPE lvc_nkey
      PERFORM add_carrid_line USING    ls_sflight
                              CHANGING l_part_key.
      gt_node = l_part_key.
      LOOP AT lt_sflight INTO ls_sflight.
        ON CHANGE OF ls_sflight-carrid.
          PERFORM add_carrid_line USING    ls_sflight
                                           l_part_key
                                  CHANGING l_carrid_key.
          PERFORM add_connid_line USING    ls_sflight
                                           l_carrid_key
                                  CHANGING l_connid_key.
          PERFORM add_complete_line USING  ls_sflight
                                         l_connid_key
                                         p_x
                                CHANGING l_last_key.
          CONTINUE.
        ENDON.
        ON CHANGE OF ls_sflight-connid.
          PERFORM add_connid_line USING    ls_sflight
                                           l_carrid_key
                                  CHANGING l_connid_key.
          PERFORM add_complete_line USING  ls_sflight
                                         l_connid_key
                                         p_x
                                CHANGING l_last_key.
          CONTINUE.
        ENDON.
        PERFORM add_complete_line USING  ls_sflight
                                         l_connid_key
                                         p_x
                                CHANGING l_last_key.
      ENDLOOP.
    calculate totals
      CALL METHOD tree1->update_calculations.
    this method must be called to send the data to the frontend
      CALL METHOD tree1->frontend_update.
    ENDFORM.                               " create_hierarchy
    *&      Form  add_carrid_line
          add hierarchy-level 1 to tree
         -->P_LS_SFLIGHT  sflight
         -->P_RELEATKEY   relatkey
        <-->p_node_key    new node-key
    FORM add_carrid_line USING     ps_sflight TYPE sflight
                                   p_relat_key TYPE lvc_nkey
                         CHANGING  p_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value,
            ls_sflight TYPE sflight.
    set item-layout
      DATA: lt_item_layout TYPE lvc_t_layi,
            ls_item_layout TYPE lvc_s_layi.
      ls_item_layout-t_image = '@3P@'.
      ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
      ls_item_layout-style   =
                            cl_gui_column_tree=>style_intensifd_critical.
      APPEND ls_item_layout TO lt_item_layout.
    add node
      l_node_text =  ps_sflight-carrid.
      CALL METHOD tree1->add_node
        EXPORTING
          i_relat_node_key = p_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = l_node_text
          is_outtab_line   = ls_sflight
          it_item_layout   = lt_item_layout
        IMPORTING
          e_new_node_key   = p_node_key.
    ENDFORM.                               " add_carrid_line
    *&      Form  add_connid_line
          add hierarchy-level 2 to tree
         -->P_LS_SFLIGHT  sflight
         -->P_RELEATKEY   relatkey
        <-->p_node_key    new node-key
    FORM add_connid_line USING     ps_sflight TYPE sflight
                                   p_relat_key TYPE lvc_nkey
                         CHANGING  p_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value,
            ls_sflight TYPE sflight.
    set item-layout
      DATA: lt_item_layout TYPE lvc_t_layi,
            ls_item_layout TYPE lvc_s_layi.
      ls_item_layout-t_image = '@3Y@'.
      ls_item_layout-style   =
                            cl_gui_column_tree=>style_intensified.
      ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
      APPEND ls_item_layout TO lt_item_layout.
    add node
      l_node_text =  ps_sflight-connid.
      CALL METHOD tree1->add_node
        EXPORTING
          i_relat_node_key = p_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          i_node_text      = l_node_text
          is_outtab_line   = ls_sflight
          it_item_layout   = lt_item_layout
        IMPORTING
          e_new_node_key   = p_node_key.
    ENDFORM.                               " add_connid_line
    *&      Form  add_cmplete_line
          add hierarchy-level 3 to tree
         -->P_LS_SFLIGHT  sflight
         -->P_RELEATKEY   relatkey
        <-->p_node_key    new node-key
    FORM add_complete_line USING   ps_sflight TYPE sflight
                                   p_relat_key TYPE lvc_nkey
                                   p_x
                         CHANGING  p_node_key TYPE lvc_nkey.
      DATA: l_node_text TYPE lvc_value.
    set item-layout
      DATA: lt_item_layout TYPE lvc_t_layi,
            ls_item_layout TYPE lvc_s_layi.
      ls_item_layout-fieldname = tree1->c_hierarchy_column_name.
      ls_item_layout-chosen = p_x.           "To give default checkbox value checked
      ls_item_layout-class   = cl_gui_column_tree=>item_class_checkbox.
      ls_item_layout-editable = 'X'.
      APPEND ls_item_layout TO lt_item_layout.
      l_node_text =  ps_sflight-fldate.
      CALL METHOD tree1->add_node
        EXPORTING
          i_relat_node_key = p_relat_key
          i_relationship   = cl_gui_column_tree=>relat_last_child
          is_outtab_line   = ps_sflight
          i_node_text      = l_node_text
          it_item_layout   = lt_item_layout
        IMPORTING
          e_new_node_key   = p_node_key.
    ENDFORM.                               " add_complete_line
    *&      Form  register_events
          text
    -->  p1        text
    <--  p2        text
    FORM register_events.
    define the events which will be passed to the backend
      DATA: lt_events TYPE cntl_simple_events,
            l_event TYPE cntl_simple_event.
    define the events which will be passed to the backend
      l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_checkbox_change.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_context_men_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_context_menu_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_header_click.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_item_keypress.
      APPEND l_event TO lt_events.
      CALL METHOD tree1->set_registered_events
        EXPORTING
          events                    = lt_events
        EXCEPTIONS
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
      IF sy-subrc <> 0.
        MESSAGE x208(00) WITH 'ERROR'.                          "#EC NOTEXT
      ENDIF.
    set Handler
      DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver.
      CREATE OBJECT l_event_receiver.
      SET HANDLER l_event_receiver->handle_node_ctmenu_request
                                                            FOR tree1.
      SET HANDLER l_event_receiver->handle_node_ctmenu_selected
                                                            FOR tree1.
      SET HANDLER l_event_receiver->handle_item_ctmenu_request
                                                            FOR tree1.
      SET HANDLER l_event_receiver->handle_item_ctmenu_selected
                                                            FOR tree1.
      SET HANDLER l_event_receiver->handle_checkbox_change FOR tree1.
    ENDFORM.                               " register_events
    *&      Form  change_toolbar
          text
    -->  p1        text
    <--  p2        text
    FORM change_toolbar.
    DATA: toolbar_event_receiver TYPE REF TO lcl_toolbar_event_receiver.
    get toolbar control
      CALL METHOD tree1->get_toolbar_object
        IMPORTING
          er_toolbar = mr_toolbar.
      CHECK NOT mr_toolbar IS INITIAL.
    add seperator to toolbar
      CALL METHOD mr_toolbar->add_button
        EXPORTING
          fcode     = ''
          icon      = ''
          butn_type = cntb_btype_sep
          text      = ''
          quickinfo = 'This is a Seperator'.                    "#EC NOTEXT
    add Standard Button to toolbar (for Delete Subtree)
      CALL METHOD mr_toolbar->add_button
        EXPORTING
          fcode     = 'DELETE'
          icon      = '@18@'
          butn_type = cntb_btype_button
          text      = ''
          quickinfo = 'Delete subtree'.                         "#EC NOTEXT
    add Dropdown Button to toolbar (for Insert Line)
      CALL METHOD mr_toolbar->add_button
        EXPORTING
          fcode     = 'INSERT_LC'
          icon      = '@17@'
          butn_type = cntb_btype_dropdown
          text      = ''
          quickinfo = 'Insert Line'.                            "#EC NOTEXT
    set event-handler for toolbar-control
      CREATE OBJECT toolbar_event_receiver.
      SET HANDLER toolbar_event_receiver->on_function_selected
                                                          FOR mr_toolbar.
      SET HANDLER toolbar_event_receiver->on_toolbar_dropdown
                                                          FOR mr_toolbar.
    ENDFORM.                               " change_toolbar
    *&      Form  init_tree
          text
    -->  p1        text
    <--  p2        text
    FORM init_tree.
    create fieldcatalog for structure sflight
      PERFORM build_fieldcatalog.
    create container for alv-tree
      DATA: l_tree_container_name(30) TYPE c,
            l_custom_container TYPE REF TO cl_gui_custom_container.
      l_tree_container_name = 'TREE1'.
      IF sy-batch IS INITIAL.
        CREATE OBJECT l_custom_container
          EXPORTING
                container_name = l_tree_container_name
          EXCEPTIONS
                cntl_error                  = 1
                cntl_system_error           = 2
                create_error                = 3
                lifetime_error              = 4
                lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc <> 0.
          MESSAGE x208(00) WITH 'ERROR'.                        "#EC NOTEXT
        ENDIF.
      ENDIF.
    create tree control
      CREATE OBJECT tree1
        EXPORTING
            parent              = l_custom_container
            node_selection_mode = cl_gui_column_tree=>node_sel_mode_multiple "node_sel_mode_single
            item_selection      = 'X'
            no_html_header      = ''
            no_toolbar          = ''
        EXCEPTIONS
            cntl_error                   = 1
            cntl_system_error            = 2
            create_error                 = 3
            lifetime_error               = 4
            illegal_node_selection_mode  = 5
            failed                       = 6
            illegal_column_name          = 7.
      IF sy-subrc <> 0.
        MESSAGE x208(00) WITH 'ERROR'.                          "#EC NOTEXT
      ENDIF.
    create Hierarchy-header
      DATA l_hierarchy_header TYPE treev_hhdr.
      PERFORM build_hierarchy_header CHANGING l_hierarchy_header.
    create info-table for html-header
      DATA: lt_list_commentary TYPE slis_t_listheader,
            l_logo             TYPE sdydo_value.
      PERFORM build_comment USING
                     lt_list_commentary
                     l_logo.
    repid for saving variants
      DATA: ls_variant TYPE disvariant.
      ls_variant-report = sy-repid.
    create emty tree-control
      CALL METHOD tree1->set_table_for_first_display
        EXPORTING
          is_hierarchy_header = l_hierarchy_header
          it_list_commentary  = lt_list_commentary
          i_logo              = l_logo
          i_background_id     = 'ALV_BACKGROUND'
          i_save              = 'A'
          is_variant          = ls_variant
        CHANGING
          it_outtab           = gt_sflight "table must be emty !!
          it_fieldcatalog     = gt_fieldcatalog.
      CONSTANTS: c_s(1) TYPE c VALUE space.
    create hierarchy
      PERFORM create_hierarchy USING c_s.
    add own functioncodes to the toolbar
      PERFORM change_toolbar.
    register events
      PERFORM register_events.
    adjust column_width
    call method tree1->COLUMN_OPTIMIZE.
    ENDFORM.                    " init_tree
    Award points if found useful.
    Regards
    Indrajit

  • How to create a calender view in webdynpro java EP 7.0

    Hi ,
    I want to create a calender view in webdynpro,
    Requirments are
    1. it should be current month view
    2. Below each day i want to show office in-time and out-time in two cloumns(these values will be coming tru RFCs).
    ie
    1
    10am | 4pm
    Is this possible in webdynpro java EP 7.0 ?
    Please help me
    Thanks
    Kumar

    Hi Kumar,
    If you are using EP7.0, there is no calendar UI element in webdynpro development. There is only date navigator UI element. This is demonstrated in the below article.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c059344a-1930-2d10-6e8a-dcec5f94993e?quicklink=index&overridelayout=true
    Regards,
    Ganesh N

  • How to create a Registration page in WebDynpro java

    Hi All,
    How to create a registration page in Web Dynpro java.Whatever i enter in the field of registration page should be stored in the pcd..So plz help me???
    Message was edited by: suman sahu

    Hi Suman,
        I have a similar kind of requirement , please let me know if you have got the solution for this??
    Regards,
    Ravi.

  • How to create a structure in a method

    Hi
    Would any please tell me how to delcare a structure in a method which contains a SAP defined structre in it . I have done it in normal ABAP but it not taking that syntax in ABAP objects method . Please tell me syntax for a method .
    Thanks
    Anita

    Hello Anita
    I assume you tried the statement
    DATA: begin of <struct>.
    In methods we have to use the following approach:
    TYPES: begin of ty_s_struc.
    TYPES:   field1   TYPE <fieldname>.
    TYPES:   field2   TYPE <struct-fieldname>.
    TYPES:   ...
    TYPES: end of ty_s_struc.
    DATA:
      ls_struc     TYPE ty_s_struc,
      lt_itab      TYPE STANDARD TABLE OF ty_s_struc
                   WITH DEFAULT KEY.
    I prefer to place my type definition in the "TYPES section" (see push button "Types" in SE24). However, all types defined within your class are <b>private</b> meaning you cannot use them in the interface of public methods.
    Regards
       Uwe

Maybe you are looking for

  • MMD Hard Drive issues

    I attempted to install a new PATA hard drive and was never able to get it to be recognized or mount, no matter I gave up on that and went back to my original configuration to find that my 3rd small drive was now unreadable. I erased that and remounte

  • Firefox won't close/  flashplayer won't download to desktop -- getting dizzy!

    Found a solution to this problem,  I hope, July 22,09 note from "eagleberry" firefox user,  but I can not download flashplayer to desktop: "use firefox to download the flash player setup fromfrom here to get the NPAPI version of flash, save it to you

  • What is the significance of Quantity reduced  in confirmation tab of a PO

    I have a PO created for a foreign vendor. after creating a PO ibd is done and then GRN. after GRN user found that he prepared grn against wrong IBD so he cancelled all the GRN he preapred and creates new grn. Now in po The open quantity showing as 85

  • Trouble with private wifi networking (remote desktop control) w/o Internet

    When in production, the mini won't have a connection to the internet.  I need to do this over a local private wifi net. My goal is to control the desktop of the mac mini with an iPad.  Right now I'm using a MBP and a hardwire ethernet connection.  Fo

  • Columns with same height in a repeating frame

    Hi!, In Report Builder I have a report with a repeating frame with three fields. Each field is a colum in frame. First field always have two lines and second and third only have one line. I want second and third fields have the same height as first,