Category > Articles
Supported by
Supported by Inetum

The ABAP detective

images/thumbnail.jpg - Thumbnail
When a development is completed in SAP, the time to send it to other systems where it can be duly tested and then executed by users has finally arrived. Before that occurs, however, it has to be checked for lapses, errors and other problems that could lead to our programmes behaving in an unpredictable manner. There is a very useful tool that allows some of these errors and gaps to be filtered out. It is called ABAP Code Inspector.

Mathematics problem

images/thumbnail.jpg - Thumbnail
Do you know the difference between a mystery and an enigma puzzle? An enigma puzzle is known to have a solution, but with a mystery you don’t know if there is solution. Do you agree with this? 5 * 3 / 10 = ( 5 * 3 ) / 10 = 5 * ( 3 / 10 ) = 1.5 If you don’t, you should agree because it is a mathematical fact. Now let’s do some experiments.

Steal data from a SALV

images/thumbnail.jpg - Thumbnail
A friend of a friend of a friend said that a friend of his knew a friend who explained to him in a shady club bar in the docks area of Lisbon how to steal data from a SALV.

Have you used regular expressions before?

images/thumbnail.jpg - Thumbnail
Regularly expressions have been around for ages. But they’re not very well known and even less used. They are a sort of descriptive language that allows for making research and very sophisticated replacements in alpha-numeric chains. A simple example: to validate an email address. If you have to do this through an algorithm you’ll have to work hard. However, with regular expressions, only two or three code lines and the regular expression "\b[A-Z0-9.

Read code from the web and execute it

images/thumbnail.jpg - Thumbnail
This is a 2-in-1 article. That is to say, you’ll learn two subjects at once. But get ready, what you’ll learn is dynamite, and, in the wrong hands, it can implode your universe. First, you’ll learn how to read content on the web. And right after that, assuming that this content is ABAP code, you’ll learn how to execute it in the blink of an eye.

With many fields avoid INTO CORRESPONDING FIELDS

images/thumbnail.jpg - Thumbnail
I have already advised here that, in tables with many fields, it’s always recommended to avoid using SELECT *, you must always select, explicitly, only the necessary fields. But I didn’t warn you that there’s yet another optimisation worth making: avoid INTO CORRESPONDING FIELDS OF TABLE.

R3TR vs LIMU

images/thumbnail.jpg - Thumbnail
You’ve screwed up the productive system. You made a change to a method of a class (or to a function, whatever). Someone else makes another change to another method of the same class (or to another function of the same group of functions, whatever) and saves it to a different transport. When you transport your changes to the productive system, you discover that the class (or function, whatever) now has a syntax error because the changes had interdependencies. You also discover that now, until you get this problem resolved, all your functional co-workers hate you.

SAPlink

images/thumbnail.jpg - Thumbnail
SAPlink is a Z program that is installed in the development environment and which enables a wide variety of object types to be imported and exported from the Workbench. Take a look here at some examples of how SAPlink can be used: To transfer a table from one SAP system to another To share a class on the internet To make a local security backup of a set of programs before making a dangerous change To keep a development in our personal repository (in Evernote, of course) in case you need it later in another project Etc.

Hey dad, look...no hands

images/thumbnail.jpg - Thumbnail
In today’s article I will show you (and explain!) how you can make a selection screen refresh itself on a regular basis without user intervention. Are you ready?

Finally ABAP knows Excel

images/thumbnail.jpg - Thumbnail
There are various ways of creating an Excel spreadsheet in ABAP. Some are more masochistic than others and some are certainly more lousy than others.

Insert variables in standard texts

images/thumbnail.jpg - Thumbnail
Everyone uses standard texts. But did you know that standard texts can have dynamic fields in the middle? SAP calls them “text symbols”. The way to do it is identical to that of the old forms of the harmful SE71, in other words wrapping them in the & symbol. Thus: &KNA1-NAME1;&. It’s really handy. I’ll show you how it’s done.

Search object attributes in an internal table

images/thumbnail.jpg - Thumbnail
There are increasingly more objects in ABAP, gradually less fear of them and, lo and behold, more and more people are writing and using them. It is normal and desirable, if objects begin to appear everywhere, to start to stuff them into internal tables. I also stored a load of objects in tables a while back, unfortunately I did not know at that time what I am going to teach you here. It could have come in handy. So, what exactly am I going to teach you here?

Implementing private methods in BADIs

images/thumbnail.jpg - Thumbnail
A little while ago I had an idea as eccentric as it was amazing that today I have decided to share here, namely, how to create private methods in BADI classes. Let me explain.

How to sabotage tables

images/thumbnail.jpg - Thumbnail
Another article to help those who are into sneaky subversion Spies, take note on how to edit a table that cannot be (and probably shouldn’t be) edited. I’ll show you three techniques. The first stopped being useful a few years ago, the second is about to become obsolete and the third, well, we’ll just have to see for how long it will work. 1. SE16 /H OK_CODE EDIT The first technique dates back to the twentieth century and uses the old transaction SE16.

Sending a report or spool job by email

images/thumbnail.jpg - Thumbnail
This post inaugurates a new category in Abapinho: Code. Posts in this category will present useful programs that are ready to execute. This one is used for sending the result of any report or spool order by e-mail. This program makes use of the new BCS (Business Communication Services) through the CL_BCS class instead of the tired and old SO_DOCUMENT_SEND_API1, may its soul rest in peace. The content can be sent in the body of the email, as a TXT attachment or as an HTML attachment, with the latter being sent nice and neat with all the colours. Enjoy it. Blindly copy it and use it or dissect it and learn how to use CL_BCS. On the way, you can still learn, if you feel like it, how to use local classes and exception classes. A local class is simpler to show here in Abapinho but if you want you can transform it into a global class through SE24 as Abapinho already explained some time ago so that you can use it anywhere. *&---------------------------------------------------------------------* *& Report ZZZ_NFG_SEND_REPORT_BY_EMAIL *& *&---------------------------------------------------------------------* *& Author: Nuno Godinho *& Date: 03 January 2012 *& Description: Sends an abap list (generated by a submitted program or *& read from an existing spool) by email. The list can be *& sent either in the email body, as a text attachment or *& as an HTML attachment. *&---------------------------------------------------------------------* REPORT zzz_nfg_send_list_by_mail MESSAGE-ID so. *************************************************************************** * Exception classes CLASS zcx_zs_no_receivers DEFINITION FINAL INHERITING FROM cx_static_check. ENDCLASS. CLASS zcx_zs_spool_error DEFINITION FINAL INHERITING FROM cx_static_check. ENDCLASS. CLASS zcx_zs_invalid_parameters DEFINITION FINAL INHERITING FROM cx_static_check. ENDCLASS. CLASS zcx_zs_objectlist_error DEFINITION FINAL INHERITING FROM cx_static_check. ENDCLASS. *----------------------------------------------------------------------* * CLASS cl_send_list_by_mail DEFINITION *----------------------------------------------------------------------* * *----------------------------------------------------------------------* CLASS cl_send_list_by_mail DEFINITION. PUBLIC SECTION. TYPES: ty_send_mode TYPE char4, ty_source TYPE char6. CONSTANTS: k_send_mode_text TYPE ty_send_mode VALUE 'TEXT', k_send_mode_text_attach TYPE ty_send_mode VALUE 'TXTA', k_send_mode_html_attach TYPE ty_send_mode VALUE 'HTMA', k_send_mode_attachment TYPE ty_send_mode VALUE space, k_source_submit TYPE ty_source VALUE 'SUBMIT', k_source_spool TYPE ty_source VALUE 'SPOOL'. METHODS: constructor RAISING cx_send_req_bcs, add_recipient IMPORTING i_smtp_address TYPE ad_smtpadr RAISING cx_send_req_bcs cx_address_bcs, submit_and_send_mail IMPORTING i_report TYPE program i_variant TYPE raldb_vari i_send_mode TYPE ty_send_mode i_subject TYPE so_obj_des i_smtp_address TYPE ad_smtpadr OPTIONAL RAISING zcx_zs_no_receivers cx_bcs zcx_zs_invalid_parameters zcx_zs_objectlist_error zcx_zs_spool_error, read_spool_and_send_mail IMPORTING i_spool_number TYPE rspoid i_send_mode TYPE ty_send_mode i_subject TYPE so_obj_des i_smtp_address TYPE ad_smtpadr OPTIONAL RAISING zcx_zs_no_receivers zcx_zs_invalid_parameters zcx_zs_objectlist_error cx_send_req_bcs cx_bcs zcx_zs_spool_error. PRIVATE SECTION. DATA: go_send_request TYPE REF TO cl_bcs. METHODS: get_objectlist_and_send_mail IMPORTING i_source TYPE ty_source i_report TYPE program OPTIONAL i_variant TYPE raldb_vari OPTIONAL i_spool_number TYPE rspoid OPTIONAL i_send_mode TYPE ty_send_mode i_subject TYPE so_obj_des i_smtp_address TYPE ad_smtpadr OPTIONAL RAISING zcx_zs_no_receivers zcx_zs_invalid_parameters zcx_zs_objectlist_error cx_bcs zcx_zs_spool_error, submit_report_to_memory IMPORTING value(i_report) TYPE program value(i_variant) TYPE raldb_vari RETURNING value(ot_listobject) TYPE table_abaplist RAISING zcx_zs_objectlist_error, read_spool_to_memory IMPORTING i_spool_number TYPE rspoid RETURNING value(ot_listobject) TYPE table_abaplist RAISING zcx_zs_spool_error, get_objectlist IMPORTING i_source TYPE ty_source value(i_report) TYPE program value(i_variant) TYPE raldb_vari i_spool_number TYPE rspoid RETURNING value(ot_listobject) TYPE table_abaplist RAISING zcx_zs_spool_error zcx_zs_objectlist_error, create_text_document IMPORTING i_report TYPE program i_variant TYPE raldb_vari i_spool_number TYPE rspoid i_subject TYPE so_obj_des it_listobject TYPE table_abaplist OPTIONAL RETURNING value(o_document) TYPE REF TO cl_document_bcs RAISING zcx_zs_objectlist_error cx_document_bcs, add_header_to_body IMPORTING i_report TYPE program i_variant TYPE raldb_vari i_spool_number TYPE rspoid CHANGING xt_soli TYPE soli_tab, add_abaplist_text_attach IMPORTING it_listobject TYPE table_abaplist i_name TYPE so_obj_des CHANGING x_document TYPE REF TO cl_document_bcs RAISING zcx_zs_objectlist_error cx_document_bcs, add_abaplist_html_attach IMPORTING it_listobject TYPE table_abaplist i_name TYPE so_obj_des CHANGING x_document TYPE REF TO cl_document_bcs RAISING cx_document_bcs, send_mail IMPORTING value(it_listobject) TYPE table_abaplist i_report TYPE program OPTIONAL i_variant TYPE raldb_vari OPTIONAL i_spool_number TYPE rspoid OPTIONAL i_send_mode TYPE ty_send_mode i_subject TYPE so_obj_des RAISING zcx_zs_objectlist_error zcx_zs_invalid_parameters cx_bcs, build_attach_name IMPORTING i_report TYPE program i_variant TYPE raldb_vari i_spool_number TYPE rspoid i_extension TYPE so_obj_des OPTIONAL RETURNING value(o_name) TYPE so_obj_des. ENDCLASS. "cl_send_list_by_mail DEFINITION *----------------------------------------------------------------------* * CLASS cl_send_list_by_mail IMPLEMENTATION *----------------------------------------------------------------------* * *----------------------------------------------------------------------* CLASS cl_send_list_by_mail IMPLEMENTATION. METHOD constructor. * Create the send request go_send_request = cl_bcs=>create_persistent( ). go_send_request->set_send_immediately( 'X' ). ENDMETHOD. "constructor METHOD add_recipient. DATA: recipient TYPE REF TO if_recipient_bcs. recipient = cl_cam_address_bcs=>create_internet_address( i_smtp_address ). go_send_request->add_recipient( recipient ). ENDMETHOD. "add_receiver METHOD submit_and_send_mail. get_objectlist_and_send_mail( i_source = k_source_submit i_send_mode = i_send_mode i_report = i_report i_variant = i_variant i_subject = i_subject ). ENDMETHOD. "submit_report_and_sendmail METHOD read_spool_and_send_mail. get_objectlist_and_send_mail( i_source = k_source_spool i_send_mode = i_send_mode i_spool_number = i_spool_number i_subject = i_subject ). ENDMETHOD. "read_spool_and_send_mail METHOD get_objectlist_and_send_mail. DATA: t_recipients TYPE bcsy_re, t_listobject TYPE table_abaplist. * Check parameters IF ( i_source = k_source_spool AND i_spool_number IS INITIAL ) OR ( i_source = k_source_submit AND i_report IS INITIAL ). RAISE EXCEPTION TYPE zcx_zs_invalid_parameters. ENDIF. * Add recipient if supplied IF i_smtp_address IS SUPPLIED. add_recipient( i_smtp_address ). ENDIF. * It should only run if there is at least one recipient t_recipients = go_send_request->recipients( ). IF t_recipients[] IS INITIAL. RAISE EXCEPTION TYPE zcx_zs_no_receivers. ENDIF. * Get objectlist either from submit or from spool t_listobject = get_objectlist( i_source = i_source i_report = i_report i_variant = i_variant i_spool_number = i_spool_number ). * Send email CALL METHOD send_mail EXPORTING it_listobject = t_listobject i_report = i_report i_variant = i_variant i_spool_number = i_spool_number i_send_mode = i_send_mode i_subject = i_subject. ENDMETHOD. "get_objectlist_and_send_mail METHOD get_objectlist. * Get abap list into memory (either from spool or submit) IF i_source = k_source_submit. submit_report_to_memory( i_report = i_report i_variant = i_variant ). ELSE. read_spool_to_memory( i_spool_number = i_spool_number ). ENDIF. * Import the list from memory and store it in table listobject REFRESH : ot_listobject. CALL FUNCTION 'LIST_FROM_MEMORY' TABLES listobject = ot_listobject EXCEPTIONS not_found = 1 OTHERS = 2. IF sy-subrc <> 0. RAISE EXCEPTION TYPE zcx_zs_objectlist_error. ENDIF. * Free memory CALL FUNCTION 'LIST_FREE_MEMORY' TABLES listobject = ot_listobject EXCEPTIONS OTHERS = 1. IF sy-subrc <> 0. RAISE EXCEPTION TYPE zcx_zs_objectlist_error. ENDIF. ENDMETHOD. "get_objectlist METHOD submit_report_to_memory. TRANSLATE: i_report TO UPPER CASE, i_variant TO UPPER CASE. * Submit report SUBMIT (i_report) USING SELECTION-SET i_variant EXPORTING LIST TO MEMORY AND RETURN. ENDMETHOD. "submit_report METHOD read_spool_to_memory. * Adapted from FM RSPO_RETURN_ABAP_SPOOLJOB. This FM converts the list to ASCII * and I needed it as an ABAPLIST so I just copied the code and adapted it DATA: data_is_otf TYPE c. CALL FUNCTION 'RSPO_CHECK_JOB_ID_PERMISSION' EXPORTING rqident = i_spool_number access = 'DISP' EXCEPTIONS no_such_job = 1 no_permission = 2. IF sy-subrc <> 0. RAISE EXCEPTION TYPE zcx_zs_spool_error. ENDIF. CALL FUNCTION 'RSPO_GET_TYPE_SPOOLJOB' EXPORTING rqident = i_spool_number IMPORTING is_otf = data_is_otf EXCEPTIONS can_not_access = 1. IF sy-subrc <> 0. RAISE EXCEPTION TYPE zcx_zs_spool_error. ENDIF. IF data_is_otf = 'X'. RAISE EXCEPTION TYPE zcx_zs_spool_error. ELSE. SUBMIT rspolist EXPORTING LIST TO MEMORY AND RETURN WITH rqident = i_spool_number WITH first = 1 WITH last = 0 WITH pages = space. ENDIF. ENDMETHOD. "read_spool METHOD send_mail. DATA: document TYPE REF TO cl_document_bcs, sent_to_all TYPE os_boolean, bcs_exception TYPE REF TO cx_bcs, name TYPE so_obj_des. IF i_send_mode = k_send_mode_text. document = create_text_document( i_report = i_report i_variant = i_variant i_spool_number = i_spool_number it_listobject = it_listobject i_subject = i_subject ). ELSE. * Create text document without adding listobject to the body (it will be attached) document = create_text_document( i_report = i_report i_variant = i_variant i_spool_number = i_spool_number i_subject = i_subject ). * Add attachment to document IF i_send_mode = k_send_mode_text_attach. name = build_attach_name( i_report = i_report i_variant = i_variant i_spool_number = i_spool_number i_extension = 'TXT' ). add_abaplist_text_attach( EXPORTING it_listobject = it_listobject i_name = name CHANGING x_document = document ). ELSEIF i_send_mode = k_send_mode_html_attach. name = build_attach_name( i_report = i_report i_variant = i_variant i_spool_number = i_spool_number ). add_abaplist_html_attach( EXPORTING it_listobject = it_listobject i_name = name CHANGING x_document = document ). ENDIF. ENDIF. * Add document to send request go_send_request->set_document( document ). * Send sent_to_all = go_send_request->send( i_with_error_screen = 'X' ). * IF sent_to_all NE 'X'. * RAISE EXCEPTION TYPE zcx_zs_mail_not_sent. * ENDIF. ENDMETHOD. "send_mail METHOD create_text_document. DATA: t_listasci TYPE STANDARD TABLE OF solisti1, t_listobject LIKE it_listobject, t_soli TYPE soli_tab, w_soli LIKE LINE OF t_soli. * Add header add_header_to_body( EXPORTING i_report = i_report i_variant = i_variant i_spool_number = i_spool_number CHANGING xt_soli = t_soli ). * Add abap list IF it_listobject IS SUPPLIED. CLEAR w_soli. APPEND w_soli TO t_soli. w_soli = '------------------------------------------------------'. APPEND w_soli TO t_soli. CLEAR w_soli. APPEND w_soli TO t_soli. t_listobject[] = it_listobject[]. CALL FUNCTION 'LIST_TO_ASCI' TABLES listasci = t_listasci listobject = t_listobject EXCEPTIONS empty_list = 1 list_index_invalid = 2 OTHERS = 3. IF sy-subrc <> 0. RAISE EXCEPTION TYPE zcx_zs_objectlist_error. ENDIF. APPEND LINES OF t_listasci TO t_soli. ENDIF. * Create text document o_document = cl_document_bcs=>create_document( i_type = 'RAW' i_text = t_soli i_subject = i_subject ). ENDMETHOD. "create_text_document METHOD add_header_to_body. DATA: w_soli LIKE LINE OF xt_soli. IF i_report IS NOT INITIAL. CONCATENATE 'Report:' i_report INTO w_soli SEPARATED BY space. APPEND w_soli TO xt_soli. ENDIF. IF i_variant IS NOT INITIAL. CONCATENATE 'Variant:' i_variant INTO w_soli SEPARATED BY space. APPEND w_soli TO xt_soli. ENDIF. IF i_spool_number IS NOT INITIAL. MOVE i_spool_number TO w_soli. CONCATENATE 'Spool number:' w_soli INTO w_soli SEPARATED BY space. APPEND w_soli TO xt_soli. ENDIF. CONCATENATE 'Date:' sy-datum sy-uzeit INTO w_soli SEPARATED BY space. APPEND w_soli TO xt_soli. CONCATENATE 'User:' sy-uname INTO w_soli SEPARATED BY space. APPEND w_soli TO xt_soli. ENDMETHOD. "build_header METHOD add_abaplist_text_attach. DATA: t_solix TYPE solix_tab. * It's always necessary to compress the table. SAPconnect will decompress it CALL FUNCTION 'TABLE_COMPRESS' "#EC * TABLES in = it_listobject out = t_solix EXCEPTIONS compress_error = 1 OTHERS = 2. IF sy-subrc <> 0. RAISE EXCEPTION TYPE zcx_zs_objectlist_error. ENDIF. x_document->add_attachment( i_attachment_type = 'ALI' i_attachment_subject = i_name i_att_content_hex = t_solix ). ENDMETHOD. "add_abaplist_text_attach METHOD add_abaplist_html_attach. DATA: t_soli TYPE soli_tab, t_listobject LIKE it_listobject. t_listobject[] = it_listobject[]. CALL FUNCTION 'WWW_HTML_FROM_LISTOBJECT' TABLES html = t_soli listobject = t_listobject. x_document->add_attachment( i_attachment_type = 'HTM' i_attachment_subject = i_name i_att_content_text = t_soli ). ENDMETHOD. "add_abaplist_html_attach METHOD build_attach_name. IF i_report IS NOT INITIAL. o_name = i_report. IF i_variant IS NOT INITIAL. CONCATENATE o_name '-' i_variant INTO o_name. ENDIF. ELSE. MOVE i_spool_number TO o_name. SHIFT o_name LEFT DELETING LEADING space. ENDIF. CONCATENATE o_name '-' sy-datum '-' sy-uzeit INTO o_name. IF i_extension IS NOT INITIAL. CONCATENATE o_name '.' i_extension INTO o_name. ENDIF. ENDMETHOD. "build_attach_name ENDCLASS. "cl_send_list_by_mail IMPLEMENTATION *************************************************************************** TABLES: adr6. *------------------------------------------------------------------* SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001. PARAMETERS: p_subj TYPE so_obj_des OBLIGATORY. SELECT-OPTIONS: s_rec FOR adr6-smtp_addr NO INTERVALS LOWER CASE OBLIGATORY. SELECTION-SCREEN END OF BLOCK b1. SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002. PARAMETERS: p_submit RADIOBUTTON GROUP typ USER-COMMAND typ. SELECTION-SCREEN BEGIN OF BLOCK b2a WITH FRAME. PARAMETERS: p_rep TYPE program MODIF ID ty1, p_var TYPE raldb_vari MODIF ID ty1. SELECTION-SCREEN END OF BLOCK b2a. PARAMETERS: p_spool RADIOBUTTON GROUP typ. SELECTION-SCREEN BEGIN OF BLOCK b2b WITH FRAME. PARAMETERS: p_rspoid TYPE rspoid MODIF ID ty2. SELECTION-SCREEN END OF BLOCK b2b. SELECTION-SCREEN END OF BLOCK b2. SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003. PARAMETERS: p_text RADIOBUTTON GROUP opt, p_texta RADIOBUTTON GROUP opt, p_htmla RADIOBUTTON GROUP opt DEFAULT 'X'. SELECTION-SCREEN END OF BLOCK b3. AT SELECTION-SCREEN OUTPUT. LOOP AT SCREEN. IF screen-group1 = 'TY1'. IF p_submit IS NOT INITIAL. screen-input = 1. ELSE. screen-input = 0. ENDIF. MODIFY SCREEN. ENDIF. IF screen-group1 = 'TY2'. IF p_spool IS NOT INITIAL. screen-input = 1. ELSE. screen-input = 0. ENDIF. MODIFY SCREEN. ENDIF. ENDLOOP. START-OF-SELECTION. DATA: go_sender TYPE REF TO cl_send_list_by_mail, send_mode TYPE cl_send_list_by_mail=>ty_send_mode, exc_ref TYPE REF TO cx_root, text TYPE string. IF ( p_submit IS NOT INITIAL AND p_rep IS INITIAL ) OR ( p_spool IS NOT INITIAL AND p_rspoid IS INITIAL ). MESSAGE s622 DISPLAY LIKE 'E'. EXIT. ENDIF. CREATE OBJECT go_sender. * Determine send mode CASE 'X'. WHEN p_texta. send_mode = cl_send_list_by_mail=>k_send_mode_text_attach. WHEN p_htmla. send_mode = cl_send_list_by_mail=>k_send_mode_html_attach. WHEN OTHERS. send_mode = cl_send_list_by_mail=>k_send_mode_text. ENDCASE. * Add recipients LOOP AT s_rec. CALL METHOD go_sender->add_recipient EXPORTING i_smtp_address = s_rec-low. ENDLOOP. TRY. CASE 'X'. WHEN p_submit. CALL METHOD go_sender->submit_and_send_mail EXPORTING i_send_mode = send_mode i_report = p_rep i_variant = p_var i_subject = p_subj. WHEN p_spool. CALL METHOD go_sender->read_spool_and_send_mail EXPORTING i_send_mode = send_mode i_spool_number = p_rspoid i_subject = p_subj. ENDCASE. WRITE: / 'Mail message sent'. CATCH cx_root INTO exc_ref. text = exc_ref->get_text( ). WRITE: / text. ENDTRY. * It will not work without this commit COMMIT WORK. Texts for selection screen: P_SUBJ Subject S_REC| Recipients P_SUBMIT| Send report P_REP| Report P_VAR| Variant P_SPOOL| Send spool job P_RSPOID| Spool job ID P_TEXT| Email body P_TEXTA| TXT attachment P_HTMLA| HTML attachment Greetings from Abapinho.