Sitemap

Amicuk Programming Answers

4 LEVEL ALV BASED ON DOUBLECLICK

-0001-11-30   Views:0

Advertisement

hi friends, i Want to make 4 level Alv Based on Doubleclick, Eg. 1 level :- Based On selectionscreen (ALV)         2nd level :- double click on any cell of 1st alv (ALV) 3rd level :- double click on any cell of 2st alv (ALV) 4th level :- double click

hi friends,
i Want to make 4 level Alv Based on Doubleclick,
Eg.
1 level :- Based On selectionscreen (ALV)        
2nd level :- double click on any cell of 1st alv (ALV)
3rd level :- double click on any cell of 2st alv (ALV)
4th level :- double click on any cell of 3rd alv (Call Tranasaction)
i make till second level using class lcl_event_receiver...
i need ur help to go ahead..
thankx..
Swapnil.

The replay answer
Advertisement
Hi Swapnil,
I tried that and got the same in first attempt itself. i am not sure where you got strucked.
Here is the sample code... try this..
REPORT Z195_ALV_LEVELS.
DATA: ispfli TYPE TABLE OF spfli.
DATA: isflight TYPE TABLE OF sflight.
DATA: iscarr TYPE TABLE OF scarr.
DATA: imara TYPE TABLE OF mara.
DATA: xspfli TYPE spfli.
DATA: gr_table TYPE REF TO cl_salv_table.
DATA: gr_table1 TYPE REF TO cl_salv_table.
DATA: gr_table2 TYPE REF TO cl_salv_table.
DATA: gr_table3 TYPE REF TO cl_salv_table.
DATA: gr_functions TYPE REF TO cl_salv_functions_list.
DATA: gr_events TYPE REF TO cl_salv_events_table.
DATA: gr_selections TYPE REF TO cl_salv_selections.
DATA: w_level TYPE sy-index.
* CLASS lcl_handle_events DEFINITION
CLASS lcl_handle_events DEFINITION.
  PUBLIC SECTION.
    METHODS: on_user_command FOR EVENT added_function OF cl_salv_events
    IMPORTING e_salv_function,
    on_double_click FOR EVENT double_click OF cl_salv_events_table
    IMPORTING row column.
ENDCLASS. "lcl_handle_events DEFINITION
DATA: event_handler TYPE REF TO lcl_handle_events.
START-OF-SELECTION.
  SELECT * INTO CORRESPONDING FIELDS OF TABLE ispfli FROM spfli UP TO 100 ROWS.
  CALL METHOD cl_salv_table=>factory
    IMPORTING
      r_salv_table = gr_table
    CHANGING
      t_table      = ispfli.
  gr_table->set_screen_status(
  pfstatus = 'SALV_TABLE_STANDARD'
  report = sy-repid
  set_functions = gr_table->c_functions_all ).
  gr_events = gr_table->get_event( ).
  CREATE OBJECT event_handler.
  SET HANDLER event_handler->on_user_command FOR gr_events.
  SET HANDLER event_handler->on_double_click FOR gr_events.
* Set up selections.
  gr_selections = gr_table->get_selections( ).
  gr_selections->set_selection_mode( 1 ). "Single
* Display
  gr_table->display( ).
* CLASS lcl_handle_events IMPLEMENTATION
CLASS lcl_handle_events IMPLEMENTATION.
  METHOD on_user_command.
* Get the selection rows
    DATA: lr_selections TYPE REF TO cl_salv_selections.
    DATA: lt_rows TYPE salv_t_row.
    DATA: ls_rows TYPE i.
    DATA: message TYPE string.
    CASE e_salv_function.
      WHEN 'MYFUNCTION'.
*        lr_selections = gr_table->get_selections( ).
*        lt_rows = lr_selections->get_selected_rows( ).
*        READ TABLE lt_rows INTO ls_rows INDEX 1.
*        READ TABLE ispfli INTO xspfli INDEX ls_rows.
*        CONCATENATE xspfli-carrid xspfli-connid xspfli-cityfrom xspfli-cityto
*         INTO message SEPARATED BY space.
*        MESSAGE i001(00) WITH 'You pushed the button!' message.
    ENDCASE.
  ENDMETHOD. "on_user_command
  METHOD on_double_click.
    IF w_level EQ 0.
      w_level = 1.
      PERFORM display_2ndlevel.
    ELSEIF w_level EQ 1.
      w_level = 2.
      PERFORM display_3rdlevel.
    ELSEIF w_level EQ 2.
      w_level = 3.
      PERFORM display_4thlevel.
    ELSEIF w_level EQ 3.
      w_level = 4.
      MESSAGE i001(00) WITH 'No further digging is possible'.
    ENDIF.
*    DATA: message TYPE string.
*    DATA: row_c(4) TYPE c.
*    row_c = row.
*    CONCATENATE 'Row' row_c 'Column' column INTO message SEPARATED BY space.
*    MESSAGE i001(00) WITH 'You double-clicked on ' message.
  ENDMETHOD. "on_double_click
ENDCLASS. "lcl_handle_events IMPLEMENTATION
*&      Form  DISPLAY_2NDLEVEL
*       text
*  -->  p1        text
*  <--  p2        text
FORM display_2ndlevel .
  SELECT * INTO CORRESPONDING FIELDS OF TABLE isflight FROM sflight UP TO 100 ROWS.
  CALL METHOD cl_salv_table=>factory
    IMPORTING
      r_salv_table = gr_table1
    CHANGING
      t_table      = isflight.
  gr_table1->set_screen_status(
  pfstatus = 'SALV_TABLE_STANDARD'
  report = sy-repid
  set_functions = gr_table1->c_functions_all ).
  gr_events = gr_table1->get_event( ).
  CREATE OBJECT event_handler.
  SET HANDLER event_handler->on_user_command FOR gr_events.
  SET HANDLER event_handler->on_double_click FOR gr_events.
* Set up selections.
  gr_selections = gr_table1->get_selections( ).
  gr_selections->set_selection_mode( 1 ). "Single
* Display
  gr_table1->display( ).
ENDFORM.                    " DISPLAY_2NDLEVEL
*&      Form  DISPLAY_3RDLEVEL
*       text
*  -->  p1        text
*  <--  p2        text
FORM display_3rdlevel .
  SELECT * INTO CORRESPONDING FIELDS OF TABLE iscarr FROM scarr UP TO 100 ROWS.
  CALL METHOD cl_salv_table=>factory
    IMPORTING
      r_salv_table = gr_table2
    CHANGING
      t_table      = iscarr.
  gr_table2->set_screen_status(
  pfstatus = 'SALV_TABLE_STANDARD'
  report = sy-repid
  set_functions = gr_table2->c_functions_all ).
  gr_events = gr_table2->get_event( ).
  CREATE OBJECT event_handler.
  SET HANDLER event_handler->on_user_command FOR gr_events.
  SET HANDLER event_handler->on_double_click FOR gr_events.
* Set up selections.
  gr_selections = gr_table2->get_selections( ).
  gr_selections->set_selection_mode( 1 ). "Single
* Display
  gr_table2->display( ).
ENDFORM.                    " DISPLAY_3RDLEVEL
*&      Form  DISPLAY_4THDLEVEL
*       text
*  -->  p1        text
*  <--  p2        text
FORM display_4thlevel .
  SELECT * INTO CORRESPONDING FIELDS OF TABLE imara FROM mara UP TO 100 ROWS.
  CALL METHOD cl_salv_table=>factory
    IMPORTING
      r_salv_table = gr_table3
    CHANGING
      t_table      = imara.
  gr_table3->set_screen_status(
  pfstatus = 'SALV_TABLE_STANDARD'
  report = sy-repid
  set_functions = gr_table3->c_functions_all ).
  gr_events = gr_table3->get_event( ).
  CREATE OBJECT event_handler.
  SET HANDLER event_handler->on_user_command FOR gr_events.
  SET HANDLER event_handler->on_double_click FOR gr_events.
* Set up selections.
  gr_selections = gr_table3->get_selections( ).
  gr_selections->set_selection_mode( 1 ). "Single
* Display
  gr_table3->display( ).
ENDFORM.                    " DISPLAY_4THLEVEL

Go to See the other 2 answers

4 LEVEL ALV BASED ON DOUBLECLICK

Category:DefaultRelease time:-0001-11-30Views:130

hi friends, i Want to make 4 level Alv Based on Doubleclick, Eg. 1 level :- Based On selectionscreen (ALV)         2nd level :- double click on any cell of 1st alv (ALV) 3rd level :- double click on any cell of 2st alv (ALV) 4th level :- double click[More]

Grey out a particular row in ALV based on some condition.

Category:DefaultRelease time:-0001-11-30Views:130

Hi All, How can we grey out the particular row in ALV based on some condition( I am using the function modules and not OOPS). Regards Ramesh.Hello Ramesh In this case you need to add a specific field to your structure: TYPES: BEGIN OF ty_s_outtab. IN[More]

Drop down in alv based on data in other calumn of same row

Category:DefaultRelease time:-0001-11-30Views:130

Hi Guys, I need to provide drop down in an ALV based on data in other calumn in same row. if i have two calumns country and region in my alv then drop down values for region should come depending upon country value. i went through lot of blogs and fo[More]

HOW TO DISABLE ALL BUT ONE CHECKBOX IN ALV BASED ON ITEM LEVEL

Category:DefaultRelease time:-0001-11-30Views:130

Hi All, I have a report that has output format in ALV , first column is a Checkbox and second in agreement number . the data is displayed on item level , now my requirement is check box must be displayed in front of only first line item per agreement[More]

Do sum in ALV based on the color of the column

Category:DefaultRelease time:2015-10-11Views:130

Hi , I have one column in ALV which has color red or green based on the whether to consider it in summationn or not based on some condition. Now I want to do 'Total' of this column, but not all the values should be considered. Instead of that only th[More]

Dynamic Headers in ALV Based on Different layouts

Category:DefaultRelease time:2015-10-11Views:130

Hi Experts, I Have a requirement in an ALV Report wherein After the report run as the user chooses different layouts from saved ones the ALV header should change accordingly. I'm using Function modules to write the ALV. First of all , is it possible?[More]

Sales order item level deliveryblock based on the material's destin country

Category:DefaultRelease time:2015-10-11Views:130

Hi Experts I have a requirement to set delivery block to an order at the item level based on of country of destination and material. -Requirement is to block automatically order line when a material is not authorized (Regulatory affair) to be shipped[More]

How to get field values in ALV based on user provided input

Category:DefaultRelease time:2015-10-11Views:130

Hi, In my ALV grid, I have 2 fields: 1. Material ID 2. Material Description When user provides input to Material ID field, the material Description field should get populated immediately. Note: Curretly I am able to do it based on the sy-ucomm = 'Ent[More]

Conversion of the ABAP Report (ALV based) into BSP Application

Category:DefaultRelease time:2015-10-11Views:130

Hello Friends, I tried to convert the abap report into a bsp application. I have followed all the steps mentoined in the previous threads regarding this topic. I have created a simple Z report in CRM, that displays the business partner details from t[More]

Any option to restrict SE16 record level access based on company code?

Category:DefaultRelease time:2015-10-11Views:130

Hi All, I have a requirement to restrict record level access in SE16 based on company code. Our SAP system has two company codes. The requirement is that users of one company code should not be able to see records of other company code in SE16. Is it[More]

Filtering top level tabs based on user attributes

Category:DefaultRelease time:2015-10-11Views:130

Hello everyone ~ I've been creating role and workset filters based on the Webinar demonstration given by Marion Schlotte (<a href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/17968de1-0a01-0010-1f9f-c090fbc7001a"&[More]

Hot
<b>Hi everybody, My approach was to use FM 'API_SEMBPS_SETDATA' but the modified values neighter appear in the layout nor were saved to the infocube after launching 'API_SEMBPS_POST'.</b> <a href="http://help.sap.com/saphelp_nw04/helpd [More]
I have a dynamic PDF form that is flowable on each page but not both. By that I mean that the fields on the 2nd page won't move to the 1st page if there is available space. How can I make the entire document flowable? I am using Adobe LiveCycle ES2 D [More]
Hi All, I need to know more infor about users in oracle 11g. 1.How to check when user last time login to database. 2.If user account is lock why it is locked? if it is locked by trying to loing with wrong password how to check how many times he attem [More]
I am working on enabling an archive of all e-mail on our small business' 10.6.8 e-mail server.  I was thrilled to find the "Copy All Mail To:" option in Server Admin.  I setup an archive account, and entered it in the copy all mail to section of [More]
Hi My macbook air crashed. I was in the midst of creating an imovie. I am attemptimg to recreate it but cannot dowmload Itunes. I have an older model macbook air v 10.5.8. any suggestions. Thank youClick here. (107140)Read other 3 answers [More]
Hello,     Need some assistance.  I have read threads looking for this problem, but could not find exactly what I am looking for.  I know that Facebook has video chat now, but I do not have the video icon when you click to chat with someone.  Example [More]
I am searching for something similar to "free" in Linux, to display the amount of free and used memory, and then incapsulate it into a shell script, so "top" isn't good. I already found the total memory output with "system_profile [More]
I am having network slowness ever since upgrading to Lion 10.7.2. Nothing in my setup has changed. I used to get around 10 Mbps on my DSL router, now I get about 6 Mbps. I checked the router, the signal coming in to it is the same strength, 12 Mbps. [More]
Hi, after upgrading from CS3 to CS5.5, i get a "Security Sandbox Violation" when loading a XML-file. With CS3 everything was fine, but now my file is not working any more. The XML-file and my SWF-file are stored in the same directory and it neth [More]
Hi,We have got some recurring Meeting invites in .ics format to a User.It fails to Open in Outlook.Please help me inresolving The error occurs only for recurring meetings .Attached is the text BEGIN:VCALENDAR X-LOTUS-CHARSET:UTF-8 VERSION:2.0 PRODID: [More]