SAP ABAP: Send Email with attached Internal Table XLS file

Below you will find a quick guide of how to set up a FM in your system that will take as input an internal table, convert that table in to XLS format and send out an email with the attachment. Add the appropriate import parameters. Add appropriate table parameters. if recepients[] is
Continue Reading →

SAP ABAP: E-mail ABAP Report List Output in HTML Format

Code sample for emailing ABAP report list output as HTML email. Note this doesn’t support ALV GRID reports. This has been implemented as a Function Module interface.
Continue Reading →

SAP ABAP: Check if you’re in the production environment using a FM

There comes a time when I am writing a program that I don’t want executed in any of the production environments [ie: like a data load that I would only allow to run in the DEV or QA systems].  There’s an obvious way to check which system ID you’re running on, but a b
Continue Reading →

Regular Expressions (Regex) and its use in ABAP

A useful post that I found online [link] originally written by Christian Jianelli. For testing Regex without coding you can use the ABAP program DEMO_REGEX_TOY. Even in ABAP Regular Expressions (Regex) is not a new issue. ABAP supports regular expressions as of Release 7.00, released
Continue Reading →

ABAP: Web Dynpro – dynamic context & UI manipulation

A good example of the dynamic modifications can be viewed via Web Dynpro component DEMODYNAMIC.
Continue Reading →

ABAP: create a table from scratch using RTTS

RTTS: RunTime Type Services – allows to get the definition of variables or to create them during program execution. RTTS is made of 2 components: RTTI: RunTime Type Identification – is used to get the definition of existing variables or existing types RTTC: RunTime Type Cr
Continue Reading →

ABAP: cl_salv_table = simple AVL

A really simple snippet that will get you an alv grid on the screen without using the CL_GUI_ALV_GRID class. DATA: gt_itab TYPE SOME_TABLE. DATA: go_salv TYPE REF TO cl_salv_table. ... TRY . cl_salv_table=>factory( EXPORTING list_display = if_salv_c_bool_sap=>false IMPORTING r_s
Continue Reading →

SAP ABAP: referencing caller program’s variables within a CALL’ed FM

When executing a CALL command there is a way to access the variables of a caller program – see sample code below. REPORT zcustom_caller. DATA: gv_a TYPE i, gv_b TYPE i, gv_c TYPE i. gv_a = 1. gv_b = 2. gv_c = 3. CALL FUNCTION 'z_custom_called' EXPORTING i_a = gv_a IMPO
Continue Reading →

SAP Gateway: Testing the CREATE method

A CREATE operation uses the HTTP POST method and is called against the same URL as the QUERY operation. Getting reference to x-csrf-token via Firefox I am using RESTClient plugin for Firefox to access the gateway services.  To properly call the CREATE service a header x-csrf-token par
Continue Reading →

SAP ABAP: reading payload via IF_HTTP_EXTENSION class

The process of creating a RESTful handler in SAP is a relatively simple process.  Simply create a new class extending an interface IF_HTTP_EXTENSION and implement the HANDLE_REQUEST method. As part of the implementation you will get access to the SERVER parameter: server TYPE REF TO i
Continue Reading →