Posts

ALV reort using CL_SALV_TABLE

Image
 REPORT ztest_pr.  TABLES: afko.  TYPES: BEGIN OF ty_final,           aufnr TYPE afko-aufnr,           matnr TYPE resb-matnr,           auart TYPE aufk-auart,           abjnr TYPE aufk-objnr,           aufpl TYPE afvc-aufpl,           aplzl TYPE afvc-aplzl,           vornr TYPE afvc-vornr,           arbid TYPE afvc-arbid,           steus TYPE afvc-steus,           objnr TYPE afvc-objnr,           stext TYPE bsvx-sttxt,         END OF ty_final.  DATA: lt_final TYPE TABLE OF ty_final,              ls_final TYPE ty_final.  DATA: lv_stext LIKE bsvx-sttxt.   SELECT-OPTIONS: s_aufnr FOR afko-aufnr. ******************************************************** * Class Definition ********************************************************  CLASS lc_salv DEFINITION.    PUBLIC SECTION.      METHODS: fetch_data,               create_salv_obj RAISING cx_static_check ,               display_toolbar,               set_layout,               set_column_attr RAISING cx_static_check,               event_handle_

Exception handing in OData

Image
SAP provided below 2 Interfaces and 2 Classes to handle the exceptions in OData. /IWBEP/IF_MESSAGE_CONTAINER /IWBEP/IF_MGW_CONTEXT /IWBEP/CX_MGW_BUSI_EXCEPTION /IWBEP/CX_MGW_TECH_EXCEPTION     Example: DATA(lo_msg_container) = mo_context->get_message_container( ). SELECT SINGLE * FROM qals INTO @DATA(ls_qals) WHERE prueflos EQ @iv_prueflos.  IF sy-subrc NE 0. METOD 1: Just raise an exception but don't handle it (no parameters)          RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception.  The output will be as follows: Method 2: Using Message Container raising and handling the exceptions using the interface reference as importing parameter.       lo_msg_container->add_message_text_only(         EXPORTING           iv_msg_type = 'E'           iv_msg_text = |Inspection Lot { iv_prueflos } is invalid| ).       RAISE EXCEPTION TYPE /iwbep/cx_mgw_busi_exception         EXPORTING           message_container = lo_msg_container.     ENDIF. Method 3: BUSINESS_ERROR Raising and

Radio Buttons in a single horizontal line on Input Screen of ABAP Program

Image
Create Program using Transaction SE38 or Use your any existing custom Program. BEGIN OF LINE will create single line with all parameters inside it. If you place any of the components in the same line, selection text symbols won't work. You need to use COMMENT to display texts. Change Texts under Text Elements Output will be displayed as below on Input Screen when Executing Program.

SAP Fiori Introduction

SAP Fiori Design System Accelerates and scales the design and development of enterprise software. It follows a modular design approach based on business roles, moving away from traditional monolithic transactions. It also Redefines the enterprise user experience by focusing on user tasks and workflows. SAP Fiori design system operates on two levels: Universal values, principles, and practices apply across all technology platforms. Values:- Consistency, Integration, Intelligence Principles:- Role-based, Adaptive, Simple, Coherent, Delightful Practices:- Design-Led Development, Design Council, Design Communities SAP Fiori design languages provide standardized design guidance across multiple platforms. SAP Fiori for Web SAP Fiori for iOS SAP Fiori for Android SAP Conversational User Experience SAP Fiori design system covers the below topics; What is Fiori? SAP Fiori is a design system that provides a consistent and holistic user experience for SAP software across platforms and devices. De

Introducing RESTful Application Programming

Image
RAP is just one code line for all different deployment options, SAP S4HANA or the cloud scenarios. the core of the RAP is based on CDS and supports all the draft functionality, the extensibility, and out-of-the-box implementation to take all the technical implementation tasks. With 7.5, it was the first time SAP introduced an end-to-end programming model. From CDS via BOPF up to the gateway level, we were able to create applications. RAP is the successor of the ABAP Programming Model for SAP Fiori. SAP extended the core data services by the so-called behaviour definition. The extension of the CDS language, and also the extension of the ABAP language itself, are used in order to have the native concept of built-in business objects.   Define a Database Table To implement the data model we would need at least one table. In this case, there is one single database table that contains flight connections. Here are the common steps that involve in the creation of a table. Create a Table Defini

Working with Internal Table in ABAP

Image
 Internal Table: Internal tables are variable data objects in which you can store several values of identical type. This type has to be specified in the declaration and is called the row type of the internal table. Table Types: The type of an internal table is called a table type. In the previous example we used TYPE TABLE OF in the DATA statement directly. The table type was bound to the declared variable. As an alternative you can use TYPE TABLE OF in a TYPES statement to define a table type with a name. You can then use this table type, for example, in a DATA statement. The visibility of these types depends on the position of the TYPES statement.  Processing Data in a Simple Internal Table: CLASS zcl_01_hello_world DEFINITION   PUBLIC   FINAL   CREATE PUBLIC .   PUBLIC SECTION.     INTERFACES if_oo_adt_classrun .   PROTECTED SECTION.   PRIVATE SECTION. ENDCLASS. CLASS zcl_01_hello_world IMPLEMENTATION.   METHOD if_oo_adt_classrun~main. * Declarations ********************************

Exception Handling in ABAP

Image
In ABAP, an exception is an error situation during the execution of an ABAP program. An exception is raised by the code that detects the error situation. Depending on who raises the exception, we distinguish between system exceptions and application exceptions. A catchable exception can be treated in the program using TRY... CATCH ..... ENDTRY   Before the ENDTRY statement, you have to add a CATCH statement followed by the ID of the exception you want to handle. CLASS zcl_01_hello_world DEFINITION   PUBLIC   FINAL   CREATE PUBLIC .   PUBLIC SECTION.     INTERFACES if_oo_adt_classrun .   PROTECTED SECTION.   PRIVATE SECTION. ENDCLASS. CLASS zcl_01_hello_world IMPLEMENTATION.   METHOD if_oo_adt_classrun~main. * Declarations **********************************************************************     DATA result TYPE i.     DATA numbers TYPE TABLE OF i. * Preparation **********************************************************************     APPEND 123 TO numbers. * Example 1: Conversion Err