Posts

Showing posts with the label ABAP for consultants

ABAP development for Email sending

ABAP development for Accounting [rev]

2083799 - Composite SAP Note: Postings with Accounting BAPIs 1232484 - How to use the VAT due date, tax reporting date VATDATE 1232484 - How to use the VAT due date, tax reporting date VATDATE The functionality is based on legal requirements in different countries. Incomplete list of countries currently known: Poland, Hungary, Slovakia, Spain. For each country it must be checked whether the functionality fulfills the legal requirements. 1. Activation of the functionality The functionality can be activated per company code in the usual customizing for the company code 'Enter Global Parameters'. (transaction OBY6 or SM30: View V_001_B) For this purpose the new field XVATDATE has been added to table T001. 2. General rule If the functionality is active then every financial accounting document that is tax relevant ( i.e. contains a tax code in a g/l-line item) must have a valid date in the field VATDATE. If the document is not tax relevant, or the functionality is off in the company...

Enhancement Framework

Image
Theory Enhancement options Enhancement Spots BADIs and the enhancement framework Enhancements types Using enhancement framework options FAQ How to pass values for the filters? How to call BADI from the code? How to find BADI? Theory The Enhancement Framework enables you to add functionality to standard SAP software without actually changing the original repository objects, and to organize these enhancements as effectively as possible. Modifications – changes to development objects delivered by SAP with or without the Modification Assistant Enhancements – inserting user developments into SAP development objects at predefined positions using customer exits, appends, includes, and classical Business Add-Ins (BAdIs). Enhancement options  Enhancement options are positions in repository objects where enhancements can be made. The enhancement options are divided into two classes: Implicit enhancement options are provided by the framework and exist without any particular preparation by ...

ABAP RESTful Application Programming Model

Image
The ABAP RESTful Application Programming Model consists of three main layers Data Modeling & Behavior: contains domain-specific business objects , that are defined with Core Data Services (CDS) and transactional behavior. Business Objects Queries: CDS  Business Services Provisioning: consists of projection views with their projection behavior to focus on a particular aspect of the data model which is exposed as business services through the OData protocol. Business object projection CDS view BDEF: Behavior projection ABAP behavior Service definition Service binding  Service Consumption: allows you to c onsume all types of OData services as well as OData Web APIs. Odata UI services Odata Web API Database layer CDS based data model In the CDS layer, you can use and manipulate data that is persisted in the database. The projection is a subset of the fields of the underlying data model , that are relevant for the application. For example, UI annotations would be part of a...

ABAP cookbook with #2

Create an email (Outlook) and attach a file Create an email (Outlook) and attach a file  cl_gui_frontend_services=>registry_get_value( EXPORTING root = cl_gui_frontend_services=>hkey_local_machine key = 'SOFTWARE\Classes\Outlook.Application\CurVer' IMPORTING reg_value = lv_reg_value). cl_gui_cfw=>flush( ). DATA(lo_gen_ebpp_notification) = NEW cl_gen_ebpp_notification( ). CALL FUNCTION 'CONVERT_OTF' EXPORTING format = 'PDF' TABLES otf = it_otf_data lines = lt_lines cl_gui_frontend_services=>get_temp_directory( CHANGING temp_dir = lv_temp_dir ). cl_gui_cfw=>flush( ). CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING filename = gv_filename filetype = 'BIN' TABLES data_tab = lt_lines...

Smartforms, Interactive Forms by Adobe

Image
Toolkit Text Types used in Smartforms Use of SAP Smartforms Use of SAP Interactive Forms by Adobe Toolkit Text Types used in Smartforms By using a Style builder, you can define smart styles in a smart form. To open style builder, Run Transaction: SMARTSTYLES. Using these smart styles, you can create paragraph, and character format that can be assigned to texts and fields in a smart form. Dynamic Text (D) This field which is assigned as L_TEXT should be declared in global definitions of smartforms whose type is of some Table type created in SE11. The table type should be "type-compatible" to type TSFTEXT. Text Element (E) This text type is used for displaying the values where we have to either explicitly mention the variable name or the field name if it is a work area. GV_HEADER is a variable to display the required value. Include Text (I) This text type is used to display the standard text that is created in the T-CODE SO10. Usually we use to read the data created in stan...

Paralell Processing with ABAP [REV]

SPTA framework aRFC/ bgRFC SPTA framework SPTA framework is the most sophisticated and secured framework for parallel processing provided by SAP. If we want to handle multiple records and want to update/check multiple database tables in parallel, in that case, using conventional way to invoke parallel processing is difficult and there can be some ABAP memory issue. But in SPTA framework there are build in security for all the ABAP memory related issues so it is very secure. Also, SPTA framework is very easy to implement and all the parallel processing work is handled by SAP we do not need to bother how to handle it. In this way, it is also a very sophisticated framework. FM SPTA_PARA_PROCESS_START_2 The FM is used to set up parallel processing.  The parameter user_param can be used for import/export parameters. We need to create a new separate subroutine pool program with the routines before, after and in_rfc  call function 'SPTA_PARA_PROCESS_START_2'       expo...

ABAP Daemon Framework

Use ABAP Daemons, to implement event handling .   ABAP Daemons are long-living ABAP session s. The application server takes care that once an ABAP Daemon was started , there is no limit for the lifetime of such ABAP session.   Even if there is an ABAP runtime error, or a work process in the application server crashes, the ABAP Daemon session gets restarted immediately . ABAP Daemons have event-driven programming model (similar to ABAP Channels) which contains the typical event handler API for your implementation needs with such methods like on_start, on_message, on_error etc. You can start an ABAP Daemon and send messages to it. Please consider, that each ABAP Daemon runs under a given user, and therefore the messages to it can be sent only within the same client. If you need to send the system-wide messages to your ABAP Daemon you can use ABAP Messaging Channel (AMC). ABAP Daemons are available with SAP NetWeaver AS ABAP 7.52. The startup configuration was added to ABA...

Debugging

Image
How to debug the field symbol? via a breakpoint How to catch an exception?  I create a new exception dynamically. Since I don’t know the exact name of exception, I can only create a breakpoint based on CX_ROOT, which is super class of all class based exceptions. then all that I can do is just F8, F8 and F8… Soon ( ten seconds later) I found one exception raised in a suspicious method GET_TABLE_CONTENT. Then I click “Display Trigger Location”, the debuger displays the method GET_P_ASSOC_OBJ_DEF_ATTRIB which leads to the exception CX_SY_NO_HANDLER. Wait.. isn’t this trouble-maker method developed by myself? After going through BSP framework code I learnt that BSP framework will first try to determine the cell type by calling our property getter method ( PREFIX GET_P_XXX). Only the successful determination of field type can trigger the successive call of content getter method ( PREFIX GET_XXXX) to retrieve the cell content. By the way, if the method which trigger the exception is not ...