Posted: Sat Jan 26, 2008 4:28 pm Post subject: Example with FM REUSE_ALV_POPUP_TO_SELECT
Code:
REPORT z_reuse_alv_popup_to_select.
*---------------------------------------------------------------------*
* Example with FM REUSE_ALV_POPUP_TO_SELECT *
*---------------------------------------------------------------------*
* Author : Michel PIOUD *
* Email : [email protected] HomePage : http://www.geocities.com/mpioud *
*---------------------------------------------------------------------*
SELECTION-SCREEN :
SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max. "#EC NEEDED
PARAMETERS p_max(2) TYPE n DEFAULT '20' OBLIGATORY.
SELECTION-SCREEN END OF LINE.
*---------------------------------------------------------------------*
TYPES:
BEGIN OF ty_user_addr,
bname TYPE user_addr-bname, " User name
name_first TYPE user_addr-name_first, " First name
name_last TYPE user_addr-name_last, " Last name
checkbox,
END OF ty_user_addr.
*---------------------------------------------------------------------*
DATA:
* Data displayed
gt_user TYPE TABLE OF ty_user_addr.
*---------------------------------------------------------------------*
INITIALIZATION.
*---------------------------------------------------------------------*
* Form f_read_data
*---------------------------------------------------------------------*
FORM f_read_data.
* Read Users address data
SELECT bname name_first name_last
UP TO p_max ROWS
INTO CORRESPONDING FIELDS OF TABLE gt_user
FROM user_addr.
ENDFORM. " F_READ_DATA
*---------------------------------------------------------------------*
* Form f_display_data
*---------------------------------------------------------------------*
FORM f_display_data.
* Macro definition
DEFINE m_fieldcat.
add 1 to ls_fieldcat-col_pos.
ls_fieldcat-fieldname = &1.
ls_fieldcat-ref_tabname = &2.
append ls_fieldcat to lt_fieldcat.
END-OF-DEFINITION.
TYPE-POOLS: slis. " ALV Global types
DATA:
l_exit,
ls_private TYPE slis_data_caller_exit,
ls_user TYPE ty_user_addr,
ls_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv.
* Build the field catalog
m_fieldcat 'BNAME' 'USER_ADDR'.
m_fieldcat 'NAME_FIRST' 'USER_ADDR'.
m_fieldcat 'NAME_LAST' 'USER_ADDR'.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.