banner ads

How to Display ALV table as pop up screen | ALV table | Display ALV output table.


How to Display ALV Table as Pop up screen.


The easiest way to display an ALV in PopUp is to use the standard function module REUSE_ALV_POPUP_TO_SELECT. The ALV can be editable also, so the ALV will help for example to select lines without a set of lines.




    Click here to watch practical video session on Pop up Screen Alv. 



Below is the list of parametes which you can use to display alv as pop up.

  CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
      EXPORTING
       I_TITLE                                             
'ALV AS POPUP'

      I_ALLOW_NO_SELECTION            
'X'
      I_SCREEN_START_COLUMN         
10
      I_SCREEN_START_LINE                 
5
      I_SCREEN_END_COLUMN             
100
      I_SCREEN_END_LINE                     
10
      I_TABNAME                                      
'LT_OUTPUT'
      IT_FIELDCAT                                    
LT_FIELD
      I_CALLBACK_PROGRAM              
SY-CPROG
  
TABLES
         T_OUTTAB                                     
LT_OUTPUT
 
EXCEPTIONS
   PROGRAM_ERROR                            
1
   
OTHERS                                                2
          
.             


ALV Reports in sap abap

As abaper you all already know to create alv reports in sap abap. This is basic thing we should know when we are starting our carrier as abap developer and even you must have worked on alv interactive report in sap abap. If you are totally new and you don't know how to create abap alv report then you first learn basic concepts of sap abap alv report, for which you can gain knowledge online as there are many abap alv tutorial available.


Once you become familiar with the concept of alv in sap abap then you can also practice different way to display alv like display alv in custom container and even display alv in tabstrip and so on..

Click here to watch ABAP New Feature For Statement with Where Clause.

Here is sample code which you can copy and paste for your self learning in order to check how this functionality work for displaying ALV as pop up screen.



*&---------------------------------------------------------------------*
*& Report  Z_POPUP_ALV
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  Z_POPUP_ALV.

TYPES BEGIN OF ty_output,
        name TYPE char10,
        address TYPE char10,
        phone   TYPE char10,
        email   TYPE char30,
        END OF ty_output.

DATA lt_output TYPE STANDARD TABLE OF ty_output,
       ls_output TYPE ty_output,
       lt_field TYPE STANDARD TABLE OF slis_fieldcat_alv,
       ls_field TYPE slis_fieldcat_Alv.


********** FIeld catlog creation*************
ls_field-COL_POS 1.
ls_field-FIELDNAME 'NAME'.
ls_field-SELTEXT_M 'Name'.
APPEND ls_field to lt_field.
CLEAR ls_field.

ls_field-COL_POS 2.
ls_field-FIELDNAME 'ADDRESS'.
ls_field-SELTEXT_M 'Address'.
APPEND ls_field to lt_field.
CLEAR ls_field.


ls_field-COL_POS 3.
ls_field-FIELDNAME 'PHONE'.
ls_field-SELTEXT_M 'Phone Number'.
APPEND ls_field to lt_field.
CLEAR ls_field.


ls_field-COL_POS 4.
ls_field-FIELDNAME 'EMAIL'.
ls_field-SELTEXT_M 'Email Id.'.
LS_FIELD-OUTPUTLEN 30.
APPEND ls_field to lt_field.
CLEAR ls_field.


************ Output table creatioon*************
LS_OUTPUT-NAME 'Swapnil'.
ls_output-ADDRESS 'VASHI'.
LS_OUTPUT-PHONE '9876543201'.
LS_OUTPUT-EMAIL 'abc@gmail.com'.
APPEND LS_OUTPUT TO LT_OUTPUT.
CLEAR LS_OUTPUT.


LS_OUTPUT-NAME 'Rajesh'.
ls_output-ADDRESS 'Panvel'.
LS_OUTPUT-PHONE '9876543201'.
LS_OUTPUT-EMAIL 'xyz@gmail.com'.
APPEND LS_OUTPUT TO LT_OUTPUT.
CLEAR LS_OUTPUT.


LS_OUTPUT-NAME 'Mangesh'.
ls_output-ADDRESS 'vashi'.
LS_OUTPUT-PHONE '9876543201'.
LS_OUTPUT-EMAIL 'pqr@gmail.com'.
APPEND LS_OUTPUT TO LT_OUTPUT.
CLEAR LS_OUTPUT.


LS_OUTPUT-NAME 'Pravin'.
ls_output-ADDRESS 'VASHI'.
LS_OUTPUT-PHONE '9876543201'.
LS_OUTPUT-EMAIL 'abc@gmail.com'.
APPEND LS_OUTPUT TO LT_OUTPUT.
CLEAR LS_OUTPUT.


******************** Call FUnction module to display data as popup screen********
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
  EXPORTING
   I_TITLE                       'ALV AS POPUP'

   I_ALLOW_NO_SELECTION          'X'
   I_SCREEN_START_COLUMN         10
   I_SCREEN_START_LINE           5
   I_SCREEN_END_COLUMN           100
   I_SCREEN_END_LINE             10
   I_TABNAME                    'LT_OUTPUT'
   IT_FIELDCAT                   LT_FIELD
   I_CALLBACK_PROGRAM            SY-CPROG
* IMPORTING
*   ES_SELFIELD                   =
*   E_EXIT                        =
  TABLES
    T_OUTTAB                      LT_OUTPUT
 EXCEPTIONS
   PROGRAM_ERROR                 1
   OTHERS                        2
          .
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.




Output.





No comments