Skip to Content
author's profile photo Former Member
Former Member

set_table_for_first_display Using display interactive Report?

Hi friends,

set_table_for_first_display using display interactive reports.

My task: When am i select Some row in First Display and Execut My Second display have same related data.

I have idea how to do Using Function Modules. I should use Class&Methods.

Please give idea about that.

Redards,

Thrimu

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on May 30, 2014 at 10:41 AM

    Check the standard example Report BCALV_GRID_DEMO.

    use the class CL_GUI_ALV_GRID

    DATA: lo_grid TYPE REF TO cl_gui_alv_grid,

    use the method set_table_for_first_display

    lo_grid->set_table_for_first_display(

    EXPORTING

    * I_BUFFER_ACTIVE = " BUFFERING ACTIVE

    * I_BYPASSING_BUFFER = " SWITCH OFF BUFFER

    * I_CONSISTENCY_CHECK = " STARTING CONSISTENCY CHECK FOR INTERFACE ERROR RECOGNITION

    * I_STRUCTURE_NAME = " INTERNAL OUTPUT TABLE STRUCTURE NAME

    * IS_VARIANT = " LAYOUT

    * I_SAVE = " SAVE LAYOUT

    * I_DEFAULT = 'X' " DEFAULT DISPLAY VARIANT

    is_layout = ls_layo " LAYOUT

    * IS_PRINT = " PRINT CONTROL

    * IT_SPECIAL_GROUPS = " FIELD GROUPS

    * IT_TOOLBAR_EXCLUDING = " EXCLUDED TOOLBAR STANDARD FUNCTIONS

    * IT_HYPERLINK = " HYPERLINKS

    * IT_ALV_GRAPHICS = " TABLE OF STRUCTURE DTC_S_TC

    * IT_EXCEPT_QINFO = " TABLE FOR EXCEPTION QUICKINFO

    * IR_SALV_ADAPTER = " INTERFACE ALV ADAPTER

    CHANGING

    it_outtab = lt_final " OUTPUT TABLE

    it_fieldcatalog = lt_fcat[] " FIELD CATALOG

    * IT_SORT = " SORT CRITERIA

    * IT_FILTER = " FILTER CRITERIA

    * EXCEPTIONS

    * INVALID_PARAMETER_COMBINATION = 1

    * PROGRAM_ERROR = 2

    * TOO_MANY_LINES = 3

    * OTHERS = 4

    ).


    You have to post this ABAP related issues in ABAP discussion not in ESS discussion.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Shanker,



      *&---------------------------------------------------------------------*

      *& Report ZO_O_P_CHK

      *&

      *&---------------------------------------------------------------------*

      *&

      *&

      *&---------------------------------------------------------------------*

      REPORT zo_o_p_chk.

      ********************************************************************************

      * Nodes *

      ********************************************************************************

      NODES : pernr,peras.

      INFOTYPES : 0015.

      ********************************************************************************

      * Types *

      ********************************************************************************

      TYPES : BEGIN OF s_adpm,

      chk,

      pernr TYPE persno,

      begda TYPE begda,

      endda TYPE endda,

      uname TYPE aenam,

      lgart TYPE lgart,

      betrg TYPE pad_amt7s,

      END OF s_adpm.

      ********************************************************************************

      * Internal table declaration *

      ********************************************************************************

      DATA : i_adpm TYPE TABLE OF s_adpm,

      w_adpm TYPE s_adpm.

      ******************************field catlog**************************************

      DATA : i_fcat TYPE lvc_t_fcat.

      *Object creation

      DATA : obj_grid TYPE REF TO cl_gui_alv_grid,

      obj_cont TYPE REF TO cl_gui_custom_container.

      *Class

      *CLASS rec_pay DEFINITION DEFERRED.

      ********************************************************************************

      * Constantes *

      ********************************************************************************

      CONSTANTS : c_cont(12) TYPE c VALUE 'C_CONT1'.

      ********************************************************************************

      * Cass Defination *

      ********************************************************************************

      CLASS rec_pay DEFINITION.

      PUBLIC SECTION .

      TYPES : BEGIN OF r_ran,

      sign TYPE bapisign,

      option TYPE bapioption,

      low TYPE persno,

      high TYPE persno,

      END OF r_ran.

      DATA : i_ran TYPE TABLE OF r_ran,

      w_ran TYPE r_ran.

      METHODS : m1.

      ENDCLASS. "rce_pay DEFINITION

      *----------------------------------------------------------------------*

      * CLASS rec_pay IMPLEMENTATION

      *----------------------------------------------------------------------*

      CLASS rec_pay IMPLEMENTATION.

      METHOD m1.

      break-point.

      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

      IMPORTING

      e_grid = obj_grid.

      * CALL METHOD obj_grid->check_changed_data.

      LOOP AT i_adpm INTO w_adpm WHERE chk = 'X'.

      w_ran-sign = 'I'.

      w_ran-option = 'EQ'.

      w_ran-low = w_adpm-pernr.

      APPEND w_ran TO i_ran.

      CLEAR w_ran.

      BREAK-POINT.

      ENDLOOP.

      ENDMETHOD. "m1

      ENDCLASS. "rec_pay IMPLEMENTATION

      DATA : obj_rec TYPE REF TO rec_pay.

      ********************************************************************************

      * Start-of-selection *

      ********************************************************************************

      START-OF-SELECTION.

      GET peras.

      rp_provide_from_last p0015 space pn-begda pn-endda.

      IF pnp-sw-found EQ 1.

      MOVE : p0015-pernr TO w_adpm-pernr,

      p0015-begda TO w_adpm-begda,

      p0015-endda TO w_adpm-endda,

      p0015-uname TO w_adpm-uname,

      p0015-lgart TO w_adpm-lgart,

      p0015-betrg TO w_adpm-betrg.

      APPEND w_adpm TO i_adpm.

      CLEAR w_adpm.

      ENDIF.

      ********************************************************************************

      * End-of-selection *

      ********************************************************************************

      END-OF-SELECTION.

      SORT i_adpm BY pernr.

      IF i_adpm IS NOT INITIAL.

      CALL SCREEN 0001.

      ENDIF..

      *&---------------------------------------------------------------------*

      *& Module STATUS_0001 OUTPUT

      *&---------------------------------------------------------------------*

      MODULE status_0001 OUTPUT.

      SET PF-STATUS 'ADD_PAYMENTS'.

      * SET TITLEBAR 'xxx'.

      ENDMODULE. " STATUS_0001 OUTPUT

      *&---------------------------------------------------------------------*

      *& Module USER_COMMAND_0001 INPUT

      *&---------------------------------------------------------------------*

      MODULE user_command_0001 INPUT.

      CASE sy-ucomm.

      WHEN 'EXIT' OR 'CANC'.

      LEAVE PROGRAM.

      WHEN 'BACK'.

      LEAVE TO SCREEN 0.

      ENDCASE.

      ENDMODULE. " USER_COMMAND_0001 INPUT

      *&---------------------------------------------------------------------*

      *& Module DISPLAY_PROCESS OUTPUT

      *&---------------------------------------------------------------------*

      MODULE display_process OUTPUT.

      PERFORM field_cat.

      PERFORM grid_display.

      ENDMODULE. " DISPLAY_PROCESS OUTPUT

      *&---------------------------------------------------------------------*

      *& Form FIELD_CAT

      *&---------------------------------------------------------------------*

      FORM field_cat .

      PERFORM fcate_fields USING 'CHK' text-a01 text-a08 'X' 'X'.

      PERFORM fcate_fields USING 'PERNR' text-a01 text-a02 '' ''.

      PERFORM fcate_fields USING 'BEGDA' text-a01 text-a03 '' ''.

      PERFORM fcate_fields USING 'ENDDA' text-a01 text-a04 '' ''.

      PERFORM fcate_fields USING 'UNAME' text-a01 text-a05 '' ''.

      PERFORM fcate_fields USING 'LGART' text-a01 text-a06 '' ''.

      PERFORM fcate_fields USING 'BETRG' text-a01 text-a07 '' ''.

      ENDFORM. " FIELD_CAT

      *&---------------------------------------------------------------------*

      *& Form FCATE_FIELDS

      *&---------------------------------------------------------------------*

      * text

      *----------------------------------------------------------------------*

      * -->P_0173 text

      * -->P_0174 text

      *----------------------------------------------------------------------*

      FORM fcate_fields USING value(p_0173)

      value(p_0174)

      value(p_0175)

      value(p_0176)

      value(p_0177).

      DATA : w_fcat TYPE lvc_s_fcat.

      w_fcat-fieldname = p_0173.

      w_fcat-tabname = p_0174.

      w_fcat-scrtext_l = p_0175.

      w_fcat-checkbox = p_0176.

      w_fcat-edit = p_0177.

      APPEND w_fcat TO i_fcat.

      CLEAR w_fcat.

      ENDFORM. " FCATE_FIELDS

      *&---------------------------------------------------------------------*

      *& Form GRID_DISPLAY

      *&---------------------------------------------------------------------*

      * text

      *----------------------------------------------------------------------*

      * --> p1 text

      * <-- p2 text

      *----------------------------------------------------------------------*

      FORM grid_display .

      CREATE OBJECT obj_cont

      EXPORTING

      * parent =

      container_name = c_cont

      * style =

      * lifetime = lifetime_default

      * repid =

      * dynnr =

      * no_autodef_progid_dynnr =

      EXCEPTIONS

      cntl_error = 1

      cntl_system_error = 2

      create_error = 3

      lifetime_error = 4

      lifetime_dynpro_dynpro_link = 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.

      CREATE OBJECT obj_grid

      EXPORTING

      * i_shellstyle = 0

      * i_lifetime =

      i_parent = obj_cont

      * i_appl_events = space

      * i_parentdbg =

      * i_applogparent =

      * i_graphicsparent =

      * i_name =

      * i_fcat_complete = SPACE

      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.

      CALL METHOD obj_grid->set_table_for_first_display

      * EXPORTING

      * i_buffer_active =

      * i_bypassing_buffer =

      * i_consistency_check =

      * i_structure_name =

      * is_variant =

      * i_save =

      * i_default = 'X'

      * is_layout =

      * is_print =

      * it_special_groups =

      * it_toolbar_excluding =

      * it_hyperlink =

      * it_alv_graphics =

      * it_except_qinfo =

      * ir_salv_adapter =

      CHANGING

      it_outtab = i_adpm

      it_fieldcatalog = i_fcat

      * it_sort =

      * it_filter =

      * EXCEPTIONS

      * invalid_parameter_combination = 1

      * program_error = 2

      * too_many_lines = 3

      * others = 4

      .

      IF sy-subrc <> 0.

      * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

      * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF.

      IF sy-ucomm = 'RP'.

      update i_adpm .

      CREATE OBJECT obj_rec.

      obj_rec->m1( ).

      ENDIF.

      ENDFORM. " GRID_DISPLAY

      here, after checking the check box the checked row values are NOT getting in my selectoption (RANGES for Interactive purpose).

      Help me.

      Thanks & Regards.

      Thrimu

  • author's profile photo Former Member
    Former Member
    Posted on Jun 02, 2014 at 05:56 AM

    Hi Friends,

    any one share me complete interactive report using Class & Methods.

    Please help me

    Regards,

    Thrimu

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Shankar,

      Actually the thing is First display am i getting. For second display purpose. one of the field i taken as checkbox in my internal table (What are the rows am i select in first Display that row Or That key field data only display in second Display) Please give me idea about Interactive for multiple row selection process ( First Grid display -----> Second Grid display) Using Class & Methods Only

      Regards,

      Thrimu

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.