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
I use Liferay Portal. It has a defined directory structure for all portlets and expects files to be in their proper locations. One of these is that it expects all .jsp files to be in the /webroot/html directory. The problem is that all references in [More]
hi Gurus, I wanted to know the following. What is the difference between Blanket Purchase Order and the Framework Order. Thanks.Hi, Framework order is also known as Blanket PO.....which we use for the procurement of Low value Material with Long term [More]
Like so many others, I am finding that SystemUIServer is often consuming between 90% and 100% of a CPU. I have tried various of the solutions offered in other threads, to no avail. And I believe I have more details than I have seen posted yet. First, [More]
When I try to send cerate an email and enter a contact, old email addresses pop up for the contact that are no longer current. I would like to delete them so only the most current address pops up but I can't find a way to delete them.There is no faci [More]
Hi gurus. does anyone know how to introduce the profit centre as a reporting characteristic in FI reports? we need to report on financials by PC. some of the reports let you choose the pc via dynamic selections but others don't for example for FS10N, [More]
I decided to watch some Netflix before I went to bed and I noticed that my screen would dim and then eventually lock the phone.  This has never been an issue till tonight.  I was wondering if anyone else is having the same problem and what I can do t [More]
I have a document using century gothic with Pages 09 on an Intel Mac with the most recent Snow Leopard upgrade.  It looks and prints fine. When I transfer this document to another computer with pages 09 the century gothic font is missing and pages as [More]
Hi All I am trying to delimit the existing date for the employee's credit card details. But i am getting an error message stating "No data stored for 0105 in the selected period" even though the entries exist in PA0105 table. The values i am pas [More]
OK, before you ask why, it's because it seems logical not to have everyone have read rights to my Macintosh HD. Of course, now I realize that it must exist or else OS X won't boot. So, I've tried going into single user mode and running chmod 775 /Vol [More]
I am using a FileMaker database where I insert color images.  But when I print to PDF, they print as Black and White.  I have to remember to change my setting every single time to ensure the color image stays.  I am doing Print, Print Setup-Propertie [More]