Posts

Overview of ODATA in SAP

  Data Model is design of Data. How related data is put together in data collection called Entities and how entities relate to each other. Entity Types     *  Entity Type or Entity is like a structure which can hold one data record. In ABAP programming terms, we can compare it to a work area.     *  Entity type has properties with some of the properties marked as Keys. More details on the properties like Type, Length are also defined. Entity Sets     *  Entity Sets are collection of same entity types. Order Detail is an entity – Order details i.e. Collection of multiple order detail entities is an Entity Set. This is like a table.     *  Entity Set simply refers to Entity Type. Association     *  Associations are relationships between two entity types. It defines the cardinality/multiplicity between the related entities.     *  In this example, Orders and Order Details Entity Sets ar...

Introduction to ODATA in SAP.

    *  OData is an open standard that is both a data format and a protocol for consuming and manipulating data in a uniform way.     * OData is the way of communication between frontend which is SAP UI5/FIORI and SAP backend.     *   SAP Gateway component handles the OData Services. The Gateway component can be either embedded in ECC/S4 HANA or it can be on a separate gateway system.     *  Each OData service is represented by a URI (Uniform Resource Identifier) or URL (Uniform Resource Locator). We will use URI term going forward.     *  OData Service has two types of documents –  Service  and  Metadata.     *  Atom format (xml) and JSON formats are supported.     *  Any web browser can be used to explore OData Service.     *   Metadata               -  Metadata contains information about all the components ...

Backward loop of internal table in ABAP

Image
Use the keyword: STEP and provide sign as -(negative) which is backward direction and the number of specifies how many records we want to iterate over. Report REPORT yr_back_loop . SELECT *   FROM  ytl_ab_stu_det   INTO TABLE @DATA ( lt_stu ). WRITE : / 'Forward loop:' . LOOP AT lt_stu INTO DATA ( lr_stu ).   WRITE : / lr_stu - stu_id , lr_stu - stu_name , lr_stu - stu_branch , lr_stu - stu_marks . ENDLOOP . SKIP 3 . WRITE : / 'Backward loop:' . LOOP AT lt_stu INTO lr_stu STEP - 1 .   WRITE : / lr_stu - stu_id , lr_stu - stu_name , lr_stu - stu_branch , lr_stu - stu_marks . ENDLOOP . Output **************************** ** ** Thank You ************************* ** **

Create AMDP class and fetch data based on student branch*

Image
                                                             Refer -  Introduction to AMDP                                                              Example -  Sample AMDP example Step 1:  Right click on ABAP project -- New -- ABAP class. Step 2:  Select package, Give class name and description. Step 3:  Click and next and click on finish. Step 4:  Write Code. CLASS ycl_ab_amdp_stu1 DEFINITION   PUBLIC   FINAL   CREATE PUBLIC .     PUBLIC SECTION.     INTERFACES : if_amdp_marker_hdb .     TYPES: begin of ls_stu ,  ...

Create AMDP class and fetch data based on student branch

Image
                                                             Refer -  Introduction to AMDP Step 1: Right click on ABAP project -- New -- ABAP class. Step 2: Select package, Give class name and description. Step 3: Click and next and click on finish. Step 4: Write Code. CLASS ycl_ab_amdp_stu DEFINITION   PUBLIC   FINAL   CREATE PUBLIC.   PUBLIC SECTION.     INTERFACES: if_amdp_marker_hdb .     TYPES: begin of ls_stu ,            stu_id TYPE ystu_id ,            stu_name TYPE ystu_name ,            stu_branch TYPE ystu_branch ,            stu_marks TYPE...

Introduction to AMDP in SAP S4HANA.

       * AMDP -- ABAP managed database procedures.     * It is a framework for managing and calling stored/database procedure and database function in as ABAP.      * The AMDP manages AMDP procedures and functions. ------------------------------------------------------------------------------------------------------------------------------     * AMDP is a global class that contains special tag interface that starts with IF_AMDP_MARKER_*.     * For HANA database  IF_AMDP_MARKER_HDB. -------------------------------------------------------------------------------------------------------------------------------     * Constructors can't be implemented as AMDP methods.     * There are two types of AMDP methods.               1. AMDP procedure implementation.               2. AMDP function implementation.      1...

To delete bp attachments like invoice or payment advice in BP T-code.

Image
                            I want to delete invoice/payment advice based on date or business partner. ---------------------------------------- Steps to find filename ---------------------------------------------- Step 1:  Goto T-code - BP. Step 2:  Give business partner and press enter.  Step 3:  Goto attachments in top left (Services for object) and click on attachment list. Step 4:  Note the title. Step 5:  I picked Payment Advice title. ---------------------------------------- Create AMDP Class --------------------------------------------------- Step 1:  Right click on project click on new select abap class. Step 2:  Give package name, Class name and description. Step 3:  Click on finish after giving all the details. Step 4:  Write code. METHOD get_gos_objects_amdp BY DATABASE PROCEDURE FOR HDB LANGUAGE SQLSCRIPT       ...