Friday, January 16, 2015

ABAP Tip-Easy Popup ALV program without screen







Chapter 001
ABAP Tip-Easy Popup ALV program without screen
Source : http://abapjoy.blogspot.com

It’s very difficult to create popup screen, which entails complex task of adding container and assigning alv.
If we use ‘CL_RS_ALV_GRID_POPUP’ class, we can implement ALV POPUP easily.

Fist, Demo program ‘BCALV_GRID_03’ provide by SAP implement POPU ALV with screen 101.



We don’t have to create screen for ALV poup. Let’ figure out other way without screen.

1. copy demo program .
2. add commend the line which is called when user double click and add PERFORM.

3. write below source code, ALV POPUP screen without screen is completed.
다음과 같이 스크립트를 추가하면 ALV POPUP 프로그램이 완성된다.
FORM show_details  USING    p_row TYPE lvc_s_row
                            p_column TYPE lvc_s_col.

  DATA : t_data1 TYPE TABLE OF sbook,
         t_fieldcat1 TYPE lvc_t_fcat,
         w_popup_grid TYPE REF TO cl_rs_alv_grid_popup.

    SELECT * FROM sbook INTO TABLE t_data1
               WHERE carrid = 'AA'.

  CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
   EXPORTING
*    I_BUFFER_ACTIVE              =
      i_structure_name             = 'SBOOK'
*    I_CLIENT_NEVER_DISPLAY       = 'X'
*    I_BYPASSING_BUFFER           =
*    I_INTERNAL_TABNAME           =
    CHANGING
      ct_fieldcat                  = t_fieldcat1
           .
 ENDIF.

  CREATE OBJECT w_popup_grid
     EXPORTING
*    I_STRUCTURE_NAME =
       i_t_fieldcatalog = t_fieldcat1
       i_left = 10
       i_top  = 10
       i_height = 300
       i_width = 300
      .

  CALL METHOD w_popup_grid->show_data
    EXPORTING
      i_t_data = t_data1.
  .

ENDFORM.                    " SHOW_DETAILS

4. After executing program, ALV POPUP is called when you double click the row.

ALV POPUP



No comments:

Post a Comment