Editing a single cell at node level in Alv tree

Hi ,
I  am a beginner in ALV tree.Can u please let me know if its possible to edit a single cell at the node level ?
Thanks in advance.
Archna

Check the Standard Program may it helpful BCALV_TREE_ITEMLAYOUT.
Kanagaraja L

Similar Messages

  • How to set a single cell editable in alv Webdynpro Abap

    I am trying to edit a single cell on lead selection. here the steps i did to achive this.
    1. I added a Attribute READ_ONLY  inside my node of type WDY_BOOLEAN.
    2. i am conditionally making this Attribute - READ_ONLY = 'X'.
    3. i am binding my node with new values.
    4. for ALV here is the code i have added.
    DATA :lo_cmp_usage TYPE REF TO if_wd_component_usage,
            lr_column    TYPE REF TO cl_salv_wd_column,
            lr_table_settings TYPE REF TO if_salv_wd_table_settings,
            lt_columns TYPE salv_wd_t_column_ref,
            ls_columns TYPE salv_wd_s_column_ref,
            lr_input_field TYPE REF TO cl_salv_wd_uie_input_field,
            lo_interfacecontroller TYPE REF TO iwci_salv_wd_table ,
            lv_value TYPE REF TO cl_salv_wd_config_table.
    *Taking reference of the Component Usage
      lo_cmp_usage =   wd_this->wd_cpuse_cu_alv( ).
      IF lo_cmp_usage->has_active_component( ) IS INITIAL.
        lo_cmp_usage->create_component( ).
      ENDIF.
      lo_interfacecontroller =   wd_this->wd_cpifc_cu_alv( ).
      lv_value = lo_interfacecontroller->get_model( ).
      CALL METHOD lv_value->if_salv_wd_column_settings~get_columns
        RECEIVING
          value = lt_columns.
      LOOP AT lt_columns INTO ls_columns.
        lr_column = ls_columns-r_column.
        CASE ls_columns-id.
          WHEN 'USR_ACT_RT'.
            CREATE OBJECT lr_input_field
              EXPORTING
                value_fieldname = ls_columns-id.
            lr_column->set_cell_editor( value = lr_input_field ).
            lr_input_field->set_read_only_fieldname( value = 'READ_ONLY' ).
        ENDCASE.
      ENDLOOP.
      lr_table_settings ?= lv_value.
      lr_table_settings->set_read_only( abap_false ).
      lv_value->if_salv_wd_column_settings~delete_column( id = 'READ_ONLY' ).
    but instead of changing the particular cell where i have marked READ_ONLY = 'X' it is changing whole column 'USR_ACT_RT'  data as editable .
    If anybody can  please help ASAP

    Hi Tashi,
    Thanks for your reply,i have did the same way u are doing here for setting the READ_ONLY Attribute conditionally.
    here is my code for setting the read only attribute .
    IF NOT lo_nd_nd_cost_rate IS INITIAL.
        lo_nd_nd_cost_rate->get_static_attributes_table( IMPORTING table = lt_nd_cost_rate ).
      ENDIF.
      IF NOT lo_el_nd_cost_rate IS INITIAL.
    * get all declared attributes
        lo_el_nd_cost_rate->get_static_attributes(
          IMPORTING
            static_attributes = ls_nd_cost_rate_sel ).
      ENDIF.
      lv_datum = sy-datum.
      lv_month = lv_datum+4(2).
    ** @TODO handle non existant child
      LOOP AT lt_nd_cost_rate INTO ls_nd_cost_rate WHERE quarter = ls_nd_cost_rate_sel-quarter.
        IF ls_nd_cost_rate-quarter = 'Q1'.
          IF ( lv_month  EQ '01' OR lv_month  EQ '02' OR lv_month  EQ '03' ).
            ls_nd_cost_rate-read_only = 'X'.
          ELSE.
            ls_nd_cost_rate-read_only = ''.
    *   report message
            CALL METHOD lo_message_manager->report_warning
              EXPORTING
                message_text = lv_text.
          ENDIF.
        ELSEIF ls_nd_cost_rate-quarter = 'Q2'.
          IF ( lv_month  EQ '04' OR lv_month  EQ '05' OR lv_month  EQ '06' ).
            ls_nd_cost_rate-read_only = 'X'.
          ELSE.
            ls_nd_cost_rate-read_only = ''.
    *   report message
            CALL METHOD lo_message_manager->report_warning
              EXPORTING
                message_text = lv_text.
          ENDIF.
        ELSEIF ls_nd_cost_rate-quarter = 'Q3'.
          IF ( lv_month  EQ '07' OR lv_month  EQ '08' OR lv_month  EQ '09' ).
            ls_nd_cost_rate-read_only = 'X'.
          ELSE.
            ls_nd_cost_rate-read_only = ''.
    *   report message
            CALL METHOD lo_message_manager->report_warning
              EXPORTING
                message_text = lv_text.
          ENDIF.
        ELSEIF ls_nd_cost_rate-quarter = 'Q4'.
          IF ( lv_month  EQ '10' OR lv_month  EQ '11' OR lv_month  EQ '12' ).
            ls_nd_cost_rate-read_only = 'X'.
          ELSE.
            ls_nd_cost_rate-read_only = ''.
    *   report message
            CALL METHOD lo_message_manager->report_warning
              EXPORTING
                message_text = lv_text.
          ENDIF.
        ENDIF.
        MODIFY lt_nd_cost_rate FROM ls_nd_cost_rate INDEX sy-tabix TRANSPORTING read_only .
        CLEAR ls_nd_cost_rate.
      ENDLOOP.
      lo_nd_nd_cost_rate->bind_table( lt_nd_cost_rate ).
    please see in the below sceen shot the last two cells are editable in the User Actual Rate Column whlie the selected rows cell is not editable. Please revert if u have any input for same.

  • How to make editable cell in ALV TREE?

    Hi all,
    I have a problem to make the cell in item row (I mean not  the cell in hierarchy columns and not in the node row) in ALV tree editable.
    I know to make it in "normal" ALV, but my ALV is type class: cl_gui_alv_tree and the nodes are calculated in a sum.Can anyone help me to set the cell editable in ALV tree?
    Thank you a lot!
    Best regards,
    Danijela Zivanovic
    Message was edited by: Danijela Zivanovic

    HI,
    To make a column editable, it will be sufficient to set the field “<b>EDIT</b>” in the field catalog. The ALV Grid perceives if there are some editable fields and adds buttons for editing purposes. If you do not need these new buttons
    <u><i>if you want it in the Classes</i></u>
    For this procedure; add the name of the field to the field “FIELDNAME”, and pass “cl_gui_alv_grid=>mc_style_enabled” to make a field editable and “cl_gui_alv_grid=>mc_style_disabled” to make a field non-editable,
    <b>Example:</b>
    FORM adjust_editables USING pt_list LIKE gt_list[] .
    DATA ls_listrow LIKE LINE OF pt_list .
    DATA ls_stylerow TYPE lvc_s_styl .
    DATA lt_styletab TYPE lvc_t_styl .
    LOOP AT pt_list INTO ls_listrow .
    IF ls_listrow-carrid = 'XY' .
    ls_stylerow-fieldname = 'SEATSMAX' .
    ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled . APPEND ls_stylerow TO lt_styletab .
    ENDIF .
    IF ls_listrow-connid = '02' .
    ls_stylerow-fieldname = 'PLANETYPE' .
    ls_stylerow-style = cl_gui_alv_grid=>mc_style_enabled . APPEND ls_stylerow TO lt_styletab .
    ENDIF .
    INSERT LINES OF lt_styletab INTO ls_listrow-cellstyles . MODIFY pt_list FROM ls_listrow .
    ENDLOOP .
    ENDFORM
    Thanks
    Sudheer

  • Quick Info on ALV Tree node

    Hi All,
    I have this requirement.
    On ALV Tree node, when user places cursor then i should display some text as quick info.
    while create node i have used ICON &lt;- left arrow, i cannot use other ICOn as functional person need this icon only.
    During Add_Node, if I pass icon through node layout then its showing nothing, Instead if I pass icon through item layout, then its showing SAP standard ICON text left arrow , but i need custom text write text  there.
    I tried using Context_menu_req as well, even that didnt worked. Any ideas/views will be highly appreciated.
    Thanks n Regards

    Hi Mr A.
    You can try the following:
    DATA: l_node_text TYPE lvc_value.
    DATA: ls_item_layo TYPE lvc_s_layi,
                 lt_item_layo TYPE lvc_t_layi.
            l_node_text             = 'UR Text'
            ls_item_layo-style      = gs_detail-color_code.
            ls_item_layo-t_image    = gs_detail-icon.
            APPEND ls_item_layo TO lt_item_layo.
    After the above mentioned statement, you may call 'Add Node' method of ALV Tree.
    Regards
    Waz

  • Multiple pages that edit a single row

    I have searched on tabs and editing a single row using multiple pages and I am confused. I don't want to use java as I am trying to not learn that too...
    What I am trying to do sounds like it has been explained before but let me do this again...
    I have a record that is too large to fit on a single screen. This makes for a cumbersome entry process. The record is actually broken into four "logical" chunks. Main, Sub1, Sub2 and Sub3.
    I have made a list that will allow the record to be selected and call the first logical page... L1.
    I have made tabs that show all the pages and allow me to navigate between them quickly.
    When I get to L1 all the data is there. I may not change any data on that page and go directly to L2 through L4. However the record is not brought forward onto those pages. So the pages are not related (and I don't have the terminology right I know :) and I could "link" the pages. So here is what I would like the application to do;
    1. Display a list and allow the user to select the record to edit.
    2. Upon edit go to the first page (tab).. this works
    3. Allow the user to select a tab and the page displays the data for the record selected
    4. Allow the user to complete the edits and save the record. Upon save the user is returned to the list in step 1.
    I was thinking there are several ways to do it... but I was hoping someone could save me a bunch of trial and error (emphasis on the error) ...
    1. When navigating off the page save the record, pass the key and re-read the record... ugly huh?
    2. Pass all the session data for the record over to the next screen. Is that possible? e.g pxx_field1 = pyy_field1
    The the question was does a template with two level tabs keep the record data between tabs?
    Any help is greatly appreciated.
    Sam

    I think this works... kinda
    1. I have a "list" that allows the selection of the item to edit.
    2. That list opens a page that is the "header" page for a tab set.
    3. Each page in the tab set uses the same "ID" to read the record and display the columns. That is how it would work if the list called each individual page.
    4. I modified the "slave" tabs to have the "ID" of the "header" page.
    This displays the correct data on each page. And it looks like the "apply changes" button saves the changes on the page.
    Caveats inlclude (I think as I haven't done exhaustive testing"
    1. "apply changes" must be done at each page where there were changes or they would be lost.
    2. The first dispaly of the page is blank. Clicking on the tab a second time displays the data. This is true if it is the first time a user selects a record in a session (the "slave" tabs are blank) or if it is a subsequent record update (the "slave" tabs have the last records data.
    Thoughts... is this really boring to everyone but me?
    Sam

  • How could I insert just a single cell in a table (not an entire extra row or column)?

    I am having trouble making an easy edit. I need to insert an a 'CELL', but I am only being given the option to insert an entire 'ROW' or 'COLUMN'. I would like to just insert a cell and have the rest of the content below it move accordingly. Please help!

    There's no way to set it so that you're just inserting a cell and everything moves along after that cell?
    Simple answer is "No." Sorry.
    InDesign tables are not good for juggling data. If you have a project that requires single-cell-insertion on a regular basis, I suggest doing your table outside of InDesign in an app with easier table-cell-juggling tools (Excel comes to mind here) and then perfecting you use of table and cell styles so that it's easy to update. It'll always be a hassle of some kind, of course, but the hassle can be minimized.

  • Editable / Non editable input field CELL (individually) on ALV dynamically

    Hi again,
    I need more help with an issue.
    I have an ALV table with three columns that is necessary put values into input field cell editors, but these cells should be editable or not depending of business logic. I've got make editable or non in entire ROW LEVEL (method set_read_only_fieldname( 'READ_ONLY' )., but ¿how can I set editable or non at individual cells?
    Any idea to do that?
    Regards
    Edited by: vanbelal on Mar 24, 2010 3:33 PM

    Can you paste any example source code?
    I don't know how can I bind enabled property dynamically to individual CELL, I'm setting properties to whole column.
    lt_columns = lr_column_settings->get_columns( ).
      LOOP AT lt_columns INTO ls_columns.
             if ls_columns-id = 'COLUMN1' or 'COLUMN2' or 'COLUMN3'.
              CREATE OBJECT lr_input_field
                EXPORTING
                  value_fieldname = ls_columns-id.
              ls_columns-r_column->set_cell_editor( lr_input_field ).
    Should I put business logic here? how can I set enabled or not on CELL, at this point I'm processing whole column!!
              lr_input_field->set_enabled( abap_true ).
            endif.
      ENDLOOP.
    Edited by: vanbelal on Mar 24, 2010 4:12 PM

  • Insert or delete single cells

    How do I insert or delete a single cell?
    For example, I want two columns of text. aligned horizontally, and, separated by a blank column.
    The two text lists have been created in other applications.
    So I copy list1, and paste it in cell C7.
    Then I copy list2, and paste it cell G6.
    oops. Now the lists are not aligned horizontally.
    The easiest way to align the lists is by either delete a single cell in column C or insert a single cell in column G.
    But I can't find the option to add/delete single cells.
    Does that option exist in Numbers? If so, how/where?
    Thanks,
    AJ

    AJ,
    My first thought on reading your post was: why are you using a single table for two side-by-side lists? If you had used two single-column tables you could use Delete Row or Insert Row to do what you want.
    pw and John both gave you perfectly good solutions, and I just wanted to add my two cents worth. I don't see much value in the Add/Delete Cell feature that you are looking for. The action never ends there because there's always a followup question as to what you want to do with the data to the right of and below the affected cell. So, it hasn't saved you any real time.
    Numbers has a very handy and secure method for moving a range of data. Highlight the range that you want to move. Then, Edit > Mark for Move. Now, click in the new starting location and Edit > Move.
    There you go; several ways to recover from the inevitable oops. Depending on how soon you discover your mistake, Command-Z is probably the easiest fix.
    Jerry

  • How to maintain Currencies at Hierachu Node Levels

    HI Gurus
    I have a requirement to use the Currency Translation at Hierarchy Node Level :I have to display all the Node Level Currencies at Group Currency Level AED  and Child level will have Local Currency.
    For Example : I have Plant Hierarchy 
             PLANT NODE1:   AED (Result needs to be converted in to AED)  ---> 9800 AED instead of 1000 BHD
                     CHILD1 :  500 BHD
                     CHILD2 :  500 BHD
             PLANT NODE2:  AED (Result needs to be converted in to AED) -->13250 AED  Instead of 1000 KWD
                      CHILD2 : 500 KWD
                      CHILD3:  500 KWD
    PLANT ROOT  : AED : 23050 AED should be appeared insted of * due to multiple currencies
    I have tried to created NOde variables and use the currency conversion filed but it is appearing in non editable mode.
    Could you please advise how can we achieve this
    Best Regards
    NLN

    HI Gurus
    I have a requirement to use the Currency Translation at Hierarchy Node Level :I have to display all the Node Level Currencies at Group Currency Level AED  and Child level will have Local Currency.
    For Example : I have Plant Hierarchy 
             PLANT NODE1:   AED (Result needs to be converted in to AED)  ---> 9800 AED instead of 1000 BHD
                     CHILD1 :  500 BHD
                     CHILD2 :  500 BHD
             PLANT NODE2:  AED (Result needs to be converted in to AED) -->13250 AED  Instead of 1000 KWD
                      CHILD2 : 500 KWD
                      CHILD3:  500 KWD
    PLANT ROOT  : AED : 23050 AED should be appeared insted of * due to multiple currencies
    I have tried to created NOde variables and use the currency conversion filed but it is appearing in non editable mode.
    Could you please advise how can we achieve this
    Best Regards
    NLN

  • Trigger label edit on node when added to Tree

    I have a button which adds a node to a tree (through the
    tree's data provider); the new node appears on the tree and is
    automatically selected, which is great ---but how can I
    automatically switch this node's label into edit mode without the
    user having to click on it?
    The effect I'm going for is, the new node appears, is
    selected and is in edit mode, e.g. a new folder that was created
    with the label "New Folder" the value of which should be changed.
    So far I've only accomplished the first 2 (new node appears and is
    selected) I haven't yet figured out how to pro grammatically
    trigger the ItemClick event on the tree component for the final
    step.

    Hi Tom,
    Just had a similar issue that we were able to resolve successfully.
    In our case, it appears that an Oracle DB JDBC driver can cause this random issue as described in <b>SAP notes #886596 and #1003198</b> ("Certain Oracle JDBC driver can cause data inconsistence.").
    The notes include a resolution process and a work around recommendation to this issue, without having to apply a new SPS level...
    Hope this helps (time has passed by since you asked this question, but it's never too late to get the right answer, as this issue seems to be persistent!).
    Regards,
    Joseph

  • Populate multiple rows and columns based off of a single cell

    Does anyone know a way to populate multiple rows and columns based off of the input of a single cell. I'm trying to create a workout tracker that auto populates from a master list of workouts. Example, in A2 the user selects the workout from a drop down menu (St1, St2, St3, etc) and the workout is pulled from the master list and is populated into B2:C5.
    I'm using =LOOKUP(A2,Master :: A2:A32,Master :: C2:C32) right now, but it's only drawing the top column. I'm looking for an edit for the formula (or completely new formula) that will place the info from the 1st column of the Master table into the 1st column of the Auto Tracker 1 table and then on down until the 4th column.
    Here is a screen shot of what I have now:
    And an example of what I'd like to accomplish:
    Any and all help is appreciated, and please let me know if there is any more info that I can give that'd help out.

    Hi Mike,
    Your screenshots show that you have merged some cells in Column A of both tables. That may be the reason why the LOOKUP function is having trouble working out which range of cells to examine.
    Hope this helps.
    Regards,
    Ian.

  • Modifying single cell in ALV Grid via OO

    Hi All,
    Got a problem I hope someone can assist me with.  I have a custom program generating an editable ALV grid.  The users want to update a single cell in a row with value from a custom drop down.  I've got the dropdown working, but I can't work out how to get the value back into the field.  My attempts result in a 'GETWA_NOT_ASSIGNED' short dump.
    I'm using the CL_GUI_ALV_GRID->get_selected_cells_id method to get the reference for the field to be modified, but I don't know where to go from here. 
    Any thoughts would be greatly appreciated.  Btw, my knowledge of OO is passable, but not great, so any explanations of what the code is doing in a proposed solution would be greatly appreciated.
    points will be rewarded.
    Cheers,
    Stephen

    Hello Stephen
    Since your dropdown list restrict the already allowed values there should be no special need to validate the selected values.
    Simply "grab" the data from the editable ALV into your internal itab in the ABAP report.
    I have copied sample report BCALV_EDIT_07 into ZUS_SDN_BCALV_EDIT_07 and modified the report to show how to retrieve the dropdown values (which is simple). Please note that I added the GUI-function 'SAVE' to the GUI-status MAIN100.
    *       MODULE PAI INPUT                                              *
    MODULE pai INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      "$TMP
      g_grid->check_changed_data( ). " retrieve changes from editable grid
      CASE save_ok.
        WHEN 'EXIT'.
          PERFORM exit_program.
        "$TMP
        WHEN 'SAVE'.
          PERFORM save_data.
        WHEN OTHERS.
    *     do nothing
      ENDCASE.
    ENDMODULE.                    "pai INPUT
    *&      Form  SAVE_DATA
    *       text
    FORM save_data.  "$TMP
    * define local data
      data: ls_fcat   type lvc_s_fcat,
            lt_fcat   type lvc_t_fcat.
      lt_fcat = gt_fieldcat.
      ls_fcat-edit = ' '.
      modify lt_fcat from ls_fcat
          TRANSPORTING edit
        where ( edit = 'X' ).  " display ALV should be not editable
      " Simulate saving of data
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
    *     I_INTERFACE_CHECK                 = ' '
    *     I_BYPASSING_BUFFER                =
    *     I_BUFFER_ACTIVE                   =
    *     I_CALLBACK_PROGRAM                = ' '
    *     I_CALLBACK_PF_STATUS_SET          = ' '
    *     I_CALLBACK_USER_COMMAND           = ' '
    *     I_CALLBACK_TOP_OF_PAGE            = ' '
    *     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *     I_CALLBACK_HTML_END_OF_LIST       = ' '
    *     I_STRUCTURE_NAME                  =
    *     I_BACKGROUND_ID                   = ' '
          I_GRID_TITLE                      = 'Display modified list data'
    *     I_GRID_SETTINGS                   =
    *     IS_LAYOUT_LVC                     =
          IT_FIELDCAT_LVC                   = lt_fcat
    *     IT_EXCLUDING                      =
    *     IT_SPECIAL_GROUPS_LVC             =
    *     IT_SORT_LVC                       =
    *     IT_FILTER_LVC                     =
    *     IT_HYPERLINK                      =
    *     IS_SEL_HIDE                       =
    *     I_DEFAULT                         = 'X'
    *     I_SAVE                            = ' '
    *     IS_VARIANT                        =
    *     IT_EVENTS                         =
    *     IT_EVENT_EXIT                     =
    *     IS_PRINT_LVC                      =
    *     IS_REPREP_ID_LVC                  =
          I_SCREEN_START_COLUMN             = 5
          I_SCREEN_START_LINE               = 5
          I_SCREEN_END_COLUMN               = 120
          I_SCREEN_END_LINE                 = 20
    *     I_HTML_HEIGHT_TOP                 =
    *     I_HTML_HEIGHT_END                 =
    *     IT_EXCEPT_QINFO_LVC               =
    *     IR_SALV_FULLSCREEN_ADAPTER        =
        TABLES
          t_outtab                          = gt_outtab
        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.
    ENDFORM.                    "SAVE_DATA
    And here is the entire coding: In order to find the modified parts of the coding simply search for $TMP.
    PROGRAM zus_sdn_bcalv_edit_07.
    * Purpose:
    * ~~~~~~~~
    * This example shows how to define dropdown listboxes for
    * particular cells of your output table.
    * To check program behavior
    * ~~~~~~~~~~~~~~~~~~~~~~~~~
    * Conceive that customers are only allowed to smoke in the
    * first class. For this reason, if the customer is a smoker
    * only the first class (F) can be chosen in column 'CLASS',
    * otherwise all classes.
    * Essential steps (search for '§')
    * ~~~~~~~~~~~~~~~
    * 1.Define an extra field in your output table
    * 2.Define a dropdown table and pass it to ALV.
    * 3.Set your dropdown field editable and assign the fieldname of the
    *   corresponding additional field to DRDN_FIELD of the fieldcatalog.
    * 4.Set the handle of your additional field of your output
    *   table according to the listbox that shall be displayed.
    DATA: ok_code LIKE sy-ucomm,
          save_ok LIKE sy-ucomm,
          g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
          g_grid  TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container,
          gt_fieldcat TYPE lvc_t_fcat,
          gs_layout TYPE lvc_s_layo,
          g_max TYPE i VALUE 100.
    *§1.Define an extra field in your output table
    *   for each column where you want to use drop down listboxes.
    *   (One additional field refers to cells of one column).
    DATA: BEGIN OF gt_outtab OCCURS 0.
            INCLUDE STRUCTURE sbook.
    DATA: drop_down_handle TYPE int4.
    DATA: END OF gt_outtab.
    *       MAIN                                                          *
    END-OF-SELECTION.
      CALL SCREEN 100.
    *       MODULE PBO OUTPUT                                             *
    MODULE pbo OUTPUT.
      SET PF-STATUS 'MAIN100'.
      SET TITLEBAR 'MAIN100'.
      IF g_custom_container IS INITIAL.
        PERFORM create_and_init_alv CHANGING gt_outtab[]
                                             gt_fieldcat.
      ENDIF.
    ENDMODULE.                    "pbo OUTPUT
    *       MODULE PAI INPUT                                              *
    MODULE pai INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      "$TMP
      g_grid->check_changed_data( ). " retrieve changes from editable grid
      CASE save_ok.
        WHEN 'EXIT'.
          PERFORM exit_program.
        "$TMP
        WHEN 'SAVE'.
          PERFORM save_data.
        WHEN OTHERS.
    *     do nothing
      ENDCASE.
    ENDMODULE.                    "pai INPUT
    *       FORM EXIT_PROGRAM                                             *
    FORM exit_program.
      LEAVE PROGRAM.
    ENDFORM.                    "exit_program
    *&      Form  SAVE_DATA
    *       text
    FORM save_data.  "$TMP
    * define local data
      data: ls_fcat   type lvc_s_fcat,
            lt_fcat   type lvc_t_fcat.
      lt_fcat = gt_fieldcat.
      ls_fcat-edit = ' '.
      modify lt_fcat from ls_fcat
          TRANSPORTING edit
        where ( edit = 'X' ).  " display ALV should be not editable
      " Simulate saving of data
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
    *     I_INTERFACE_CHECK                 = ' '
    *     I_BYPASSING_BUFFER                =
    *     I_BUFFER_ACTIVE                   =
    *     I_CALLBACK_PROGRAM                = ' '
    *     I_CALLBACK_PF_STATUS_SET          = ' '
    *     I_CALLBACK_USER_COMMAND           = ' '
    *     I_CALLBACK_TOP_OF_PAGE            = ' '
    *     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *     I_CALLBACK_HTML_END_OF_LIST       = ' '
    *     I_STRUCTURE_NAME                  =
    *     I_BACKGROUND_ID                   = ' '
          I_GRID_TITLE                      = 'Display modified list data'
    *     I_GRID_SETTINGS                   =
    *     IS_LAYOUT_LVC                     =
          IT_FIELDCAT_LVC                   = lt_fcat
    *     IT_EXCLUDING                      =
    *     IT_SPECIAL_GROUPS_LVC             =
    *     IT_SORT_LVC                       =
    *     IT_FILTER_LVC                     =
    *     IT_HYPERLINK                      =
    *     IS_SEL_HIDE                       =
    *     I_DEFAULT                         = 'X'
    *     I_SAVE                            = ' '
    *     IS_VARIANT                        =
    *     IT_EVENTS                         =
    *     IT_EVENT_EXIT                     =
    *     IS_PRINT_LVC                      =
    *     IS_REPREP_ID_LVC                  =
          I_SCREEN_START_COLUMN             = 5
          I_SCREEN_START_LINE               = 5
          I_SCREEN_END_COLUMN               = 120
          I_SCREEN_END_LINE                 = 20
    *     I_HTML_HEIGHT_TOP                 =
    *     I_HTML_HEIGHT_END                 =
    *     IT_EXCEPT_QINFO_LVC               =
    *     IR_SALV_FULLSCREEN_ADAPTER        =
        TABLES
          t_outtab                          = gt_outtab
        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.
    ENDFORM.                    "SAVE_DATA
    *&      Form  BUILD_FIELDCAT
    *       text
    *      <--P_GT_FIELDCAT  text
    FORM build_fieldcat CHANGING pt_fieldcat TYPE lvc_t_fcat.
      DATA ls_fcat TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'SBOOK'
        CHANGING
          ct_fieldcat      = pt_fieldcat.
      LOOP AT pt_fieldcat INTO ls_fcat.
    * Exchange smoker field with invoice field - just to
    * make the dependance between SMOKER and CLASS more transparent
    * (Smoking is only allowed in the first class).
        IF ls_fcat-fieldname EQ 'SMOKER'.
          ls_fcat-col_pos = 11.
          ls_fcat-outputlen = 10.
          MODIFY pt_fieldcat FROM ls_fcat.
        ELSEIF ls_fcat-fieldname EQ 'INVOICE'.
          ls_fcat-col_pos = 7.
          MODIFY pt_fieldcat FROM ls_fcat.
        ELSEIF    ls_fcat-fieldname EQ 'CLASS'.
    *§3.Set your dropdown field editable and assign the fieldname of the
    *   corresponding additional field to DRDN_FIELD of the fieldcatalog.
          ls_fcat-edit = 'X'.
          ls_fcat-drdn_field = 'DROP_DOWN_HANDLE'.
          ls_fcat-outputlen = 5.
    * Field 'checktable' is set to avoid shortdumps that are caused
    * by inconsistend data in check tables. You may comment this out
    * when the test data of the flight model is consistent in your system.
          ls_fcat-checktable = '!'.        "do not check foreign keys
          MODIFY pt_fieldcat FROM ls_fcat.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "build_fieldcat
    *&      Form  CREATE_AND_INIT_ALV
    *       text
    *      <--P_GT_OUTTAB  text
    *      <--P_GT_FIELDCAT  text
    *      <--P_GS_LAYOUT  text
    FORM create_and_init_alv CHANGING pt_outtab TYPE STANDARD TABLE
                                      pt_fieldcat TYPE lvc_t_fcat.
      DATA: lt_exclude TYPE ui_functions.
      CREATE OBJECT g_custom_container
        EXPORTING
          container_name = g_container.
      CREATE OBJECT g_grid
        EXPORTING
          i_parent = g_custom_container.
      PERFORM build_fieldcat CHANGING pt_fieldcat.
    * Optionally restrict generic functions to 'change only'.
    *   (The user shall not be able to add new lines).
      PERFORM exclude_tb_functions CHANGING lt_exclude.
      PERFORM set_drdn_table.
      PERFORM build_data CHANGING pt_outtab.
      CALL METHOD g_grid->set_table_for_first_display
        EXPORTING
          it_toolbar_excluding = lt_exclude
        CHANGING
          it_fieldcatalog      = pt_fieldcat
          it_outtab            = pt_outtab[].
    * Set editable cells to ready for input initially
      CALL METHOD g_grid->set_ready_for_input
        EXPORTING
          i_ready_for_input = 1.
    ENDFORM.                               "CREATE_AND_INIT_ALV
    *&      Form  EXCLUDE_TB_FUNCTIONS
    *       text
    *      <--P_LT_EXCLUDE  text
    FORM exclude_tb_functions CHANGING pt_exclude TYPE ui_functions.
    * Only allow to change data not to create new entries (exclude
    * generic functions).
      DATA ls_exclude TYPE ui_func.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_move_row.
      APPEND ls_exclude TO pt_exclude.
    ENDFORM.                               " EXCLUDE_TB_FUNCTIONS
    *&      Form  set_drdn_table
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM set_drdn_table.
    *§2.Define a dropdown table and pass it to ALV.
    *   One listbox is referenced by a handle, e.g., '1'.
    *   For each entry that shall appear in this listbox
    *   you have to append a line to the dropdown table
    *   with handle '1'.
    *   This handle can be assigned to several columns
    *   of the output table using the field catalog.
      DATA: lt_dropdown TYPE lvc_t_drop,
            ls_dropdown TYPE lvc_s_drop.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = 'F'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '2'.
      ls_dropdown-value = 'F'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '2'.
      ls_dropdown-value = 'C'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '2'.
      ls_dropdown-value = 'Y'.
      APPEND ls_dropdown TO lt_dropdown.
      CALL METHOD g_grid->set_drop_down_table
        EXPORTING
          it_drop_down = lt_dropdown.
    ENDFORM.                               " set_drdn_table
    *&      Form  build_data
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_data CHANGING pt_outtab TYPE STANDARD TABLE.
      DATA: lt_sbook TYPE TABLE OF sbook,
            ls_sbook TYPE sbook,
            l_index TYPE i,
            ls_outtab LIKE LINE OF gt_outtab.
      SELECT * FROM sbook INTO TABLE lt_sbook UP TO g_max ROWS."#EC CI_NOWHERE
      IF sy-subrc NE 0.
        PERFORM generate_entries CHANGING lt_sbook.
      ENDIF.
    *§4.Set the handle of your additional field of your output
    *   table according to the listbox that shall be displayed.
      LOOP AT lt_sbook INTO ls_sbook.
        l_index = sy-tabix.
        MOVE-CORRESPONDING ls_sbook TO ls_outtab.
        CLEAR ls_outtab-class.
    * Alternate between smoker and non smoker to make
    * it more obvious what this example is about
        l_index = l_index MOD 2.
        IF l_index EQ 1.
          ls_outtab-smoker = 'X'.
        ELSE.
          ls_outtab-smoker = ' '.
        ENDIF.
        IF ls_outtab-smoker EQ 'X'.
          ls_outtab-drop_down_handle = '1'.
        ELSE.
          ls_outtab-drop_down_handle = '2'.
        ENDIF.
        APPEND ls_outtab TO pt_outtab.
      ENDLOOP.
    ENDFORM.                               " build_data
    *&      Form  generate_entries
    *       text
    *      <--P_LT_SLFIGHT  text
    FORM generate_entries CHANGING pt_sbook TYPE STANDARD TABLE.
      DATA: ls_sbook TYPE sbook,
            l_month(2) TYPE c,
            l_day(2) TYPE c,
            l_date(8) TYPE c,
      l_prebookid TYPE i.
      ls_sbook-carrid = 'LH'.
      ls_sbook-connid = '0400'.
      ls_sbook-forcurkey = 'DEM'.
      ls_sbook-loccurkey = 'USD'.
      ls_sbook-custtype = 'B'.
      DO 110 TIMES.
        l_prebookid = sy-index.
        ls_sbook-forcuram = sy-index * 10.
        ls_sbook-loccuram = ls_sbook-loccuram * 2.
        ls_sbook-customid = sy-index.
        ls_sbook-counter = 18.
        ls_sbook-agencynum = 11.
        l_month = sy-index / 10 + 1.
        DO 2 TIMES.
          l_day = 3 + l_month + sy-index * 2.
          l_date+0(4) = '2000'.
          l_date+4(2) = l_month.
          l_date+6(2) = l_day.
          ls_sbook-fldate = l_date.
          SUBTRACT 3 FROM l_day.
          ls_sbook-order_date+0(6) = l_date+0(6).
          ls_sbook-order_date+6(2) = l_day.
          ls_sbook-bookid = l_prebookid * 2 + sy-index.
          IF sy-index EQ 1.
            ls_sbook-smoker = 'X'.
          ELSE.
            ls_sbook-smoker = space.
          ENDIF.
          ls_sbook-luggweight = l_prebookid * 10.
          IF ls_sbook-luggweight GE 1000.
            ls_sbook-wunit = 'G'.
            ls_sbook-class = 'C'.
          ELSE.
            ls_sbook-wunit = 'KG'.
            ls_sbook-class = 'Y'.
          ENDIF.
          IF ls_sbook-bookid > 40 AND ls_sbook-wunit EQ 'KG'.
            ls_sbook-invoice = 'X'.
          ENDIF.
          IF ls_sbook-bookid EQ 2.
            ls_sbook-cancelled = 'X'.
            ls_sbook-class = 'F'.
          ENDIF.
          APPEND ls_sbook TO pt_sbook.
        ENDDO.
      ENDDO.
    ENDFORM.                               " generate_entries
    Regards
      Uwe

  • Concatenation of Data from 4 infoobjects into a single cell in Bex Report

    Hi,
    I have loaded ODS with the description data. The source system for loading the ODS is the flat file. The ODS data should be a replica of the flat file.
    In the flat file, there is a description field corresponding to a particular ID. This Description is greater than the standard 60 char length. So, I had to split the description while loading the flat file using single line routine in the Transfer Structure.
    So, while loading different  the data, I split the description field data from the flat file into 4 infoobjects and the flat file data was loaded into the ODS.
    Now, from the reporting point of view, I need to display the entire description data from the 4 info-objects into a single cell in the Bex report.
    Please suggest a solution for this.
    <b>****Points will be awarded***</b>

    Hi Vineet,
    Thanks for the response.
    Could you please help me out with the VBA script(code) that needs to be written in the macro.
    Thanks in Advance.
    <i><b>****Points will be awarded****</b></i>
    Regards,
    Hitesh Shetty.

  • Not Hier node levels we need Hier Node Descriptions

    Hi. Guys.
    I  come accross with issue like we have 0prod_hier with different hier node levels and we need Hier
    node descriptions in place of node levels after executing the report. So
    I have changed Level 01 Level 02 Level 03 ......... with Desc1 Desc2 Desc3...... like that in Hier Maintenance
    from backend side.
    I could be able to see the descriptions in places of Level 1 level 2 Level3 ....
    But problem is when I navigate the 0prod_hier into rows/columns it is going to short dump. Why
    I am getting I am not understanding
    and when I navigate other fields I am not getting problem. Only for Prod_hier, i am facing this
    problem error is saying like this. and currently Prod_hier is in Free Characterstics.
    Error analysis
    A RAISE statement in the program "SAPLRSDU_PART" raised th
    condition "TABLE_NOT_EXISTS".
    Since the exception was not intercepted by a superior
    program, processing was terminated.
    Short description of exception condition:
    Please help me out how to solve this.
    thanks & Regards
    Vijay

    Hello Vijay,
    the cause of this problem are the temporary hierarchy tables.
    You may execute the report SAP_DROP_TMPTABLES (in se38) for the temporary hierarchy tables (= 02-tables) and
    recheck the behaviour. Please generate the query after doing this. You can find more information regarding temporary tables
    in note 449891.
    best regards,
    Jerome

  • Multiple values in a single cell in report !!

    Hello,
    I want to display multiple values in a single cell, each value separated by comma.
    Ex: I have Employee and Department.
    If a employee works for many departments, all the Department names should be displayed in the same cell in the report.
    Please help !

    Thanks for your replies !
    Is there any other way to achieve this ?
    There is 1 InfoObject which has 2 fields Employee and Department.
    Employee     Department
    001                A
    001                B
    001                C
    In the report there should be 1 row for Employee 001 with all the Departments displayed in the same cell separated by commas.
    Can this be done in the backend through a ABAP code?

Maybe you are looking for