*&-------------------------------* *& Simple ABAP code to call and display any website URL with *& your SAP GUI *&-------------------------------* REPORT ZREP_CALLURL. *Call website URL and display contents within SAP dialog window CALL METHOD CL_ABAP_BROWSER=>SHOW_URL EXPORTING URL = p_url TITLE = 'My Browser Window' SIZE = CL_ABAP_BROWSER=>LARGE "MEDIUM/LARGE/XLARGE MODAL = ABAP_TRUE PRINTING = ABAP_FALSE BUTTONS = 'X' FORMAT = CL_ABAP_BROWSER=>LANDSCAPE POSITION = CL_ABAP_BROWSER=>TOPLEFT * CONTAINER = CONTEXT_MENU = ABAP_FALSE.
*&-------------------------------* *& Output very simple ALV report using CL_SALV_TABLE class *&-------------------------------* REPORT ZALV_SIMPLE. * Select data from database table SFLIGHT SELECT * UP TO 20 ROWS from SFLIGHT INTO TABLE it_report. * Create an instance of the SALV table object CALL METHOD cl_salv_table=>factory EXPORTING list_display = if_salv_c_bool_sap=>false IMPORTING r_salv_table = salv_table CHANGING t_table = it_report.
*&-------------------------------* *& Simple ABAP code to demonstrate how to manipulate a logical database *& selection screen. This is assigned and setup within menu option Goto->attributes. *& You first need to assign a logical database such as PNP and then a HR report *& category to determine which fields should be displayed. *& *& SAP ABAP report functionality used *& ********************************** *& Use of HR logical database selection screen with standard ABAP report. *& Set default time period/key date for HR locical database report *& Set other defaults for HR logical database selection fields *& Get SAP HR org structure based on user selection from tree structure *& *&-------------------------------* REPORT ZREP_LOGICAL_DB. *GET PERNR "Use if you want to use logical database functionality *Use Org. Unit tree selection with normal ABAP report code
*&-------------------------------* *& This example creates a new infotype 0105 record by selecting an existing *& one from the database and updating its from and to date. The code will *& be similar code for almost all other HR infotypes *&-------------------------------* REPORT ZUPD_INFOTYPE. data : it_tabdescr type abap_compdescr_tab, wa_tabdescr type abap_compdescr. data : ref_table_descr type ref to cl_abap_structdescr. CONCATENATE 'PA' p_itype into ld_table. SELECT single * from (ld_table) into CORRESPONDING FIELDS OF ld_record where pernr eq p_pernr and USRTY eq 'MAIL'. "Only relevant for infotype 0105 * Change values within record you want to create
*&---------------------------------------------------------------------* *& *& SAP ABAP report functionality used *& ********************************** *& Email address input selection screen fields *& Display ALV report using Objects cl_salv_table *& Add custom ALV column header *& Change colour of ALV rows based on user start year *& Get ALV Spool from background execution *& Convert Spool to PDF and send as Email *& Submit an ABAP report in background *& ABAP report submits itself in background to create spool *& Pass parameter and select option to report submit *& Delete SAP spool request *&---------------------------------------------------------------------* REPORT ZREP_EMAIL_ALV_SPOOL. gd_email = p_email. gd_email2 = '#[email protected]'. gd_email3 = '#[email protected]'.
*&-------------------------------* *& Simple ABAP code to demonstrate the predefined ABAP data types. *& Note you would usually have all the WRITE statements after all the data *& declarations but just makes it clearer to put them together for this example *&-------------------------------* REPORT ZABAP_DATA_TYPES. *Type I (Integer) *---------------- *This is the basic numeric integer type which only accepts whole numbers DATA: ld_int type I. ld_int = 200. WRITE:/ ld_int. *Type F (Floating point number) *------------------------------ *This is a numeric values with decimal places used for calculation results DATA: ld_float type f.