Skip to content
NextLytics
Megamenü_2023_Über-uns

Shaping Business Intelligence

Whether clever add-on products for SAP BI, development of meaningful dashboards or implementation of AI-based applications - we shape the future of Business Intelligence together with you. 

Megamenü_2023_Über-uns_1

About us

As a partner with deep process know-how, knowledge of the latest SAP technologies as well as high social competence and many years of project experience, we shape the future of Business Intelligence in your company too.

Megamenü_2023_Methodik

Our Methodology

The mixture of classic waterfall model and agile methodology guarantees our projects a high level of efficiency and satisfaction on both sides. Learn more about our project approach.

Products
Megamenü_2023_NextTables

NextTables

Edit data in SAP BW out of the box: NextTables makes editing tables easier, faster and more intuitive, whether you use SAP BW on HANA, SAP S/4HANA or SAP BW 4/HANA.

Megamenü_2023_Connector

NextLytics Connectors

The increasing automation of processes requires the connectivity of IT systems. NextLytics Connectors allow you to connect your SAP ecosystem with various open-source technologies.

IT-Services
Megamenü_2023_Data-Science

Data Science & Engineering

Ready for the future? As a strong partner, we will support you in the design, implementation and optimization of your AI application.

Megamenü_2023_Planning

SAP Planning

We design new planning applications using SAP BPC Embedded, IP or SAC Planning which create added value for your company.

Megamenü_2023_Dashboarding

Dashboarding

We help you with our expertise to create meaningful dashboards based on Tableau, Power BI, SAP Analytics Cloud or SAP Lumira. 

Megamenü_2023_Data-Warehouse-1

SAP Data Warehouse

Are you planning a migration to SAP HANA? We show you the challenges and which advantages a migration provides.

Business Analytics
Megamenü_2023_Procurement

Procurement Analytics

Transparent and valid figures are important, especially in companies with a decentralized structure. SAP Procurement Analytics allows you to evaluate SAP ERP data in SAP BI.

Megamenü_2023_Reporting

SAP HR Reporting & Analytics

With our standard model for reporting from SAP HCM with SAP BW, you accelerate business activities and make data from various systems available centrally and validly.

Megamenü_2023_Dataquality

Data Quality Management

In times of Big Data and IoT, maintaining high data quality is of the utmost importance. With our Data Quality Management (DQM) solution, you always keep the overview.

Career
Megamenü_2023_Karriere-2b

Working at NextLytics

If you would like to work with pleasure and don't want to miss out on your professional and personal development, we are the right choice for you!

Megamenü_2023_Karriere-1

Senior

Time for a change? Take your next professional step and work with us to shape innovation and growth in an exciting business environment!

Megamenü_2023_Karriere-5

Junior

Enough of grey theory - time to get to know the colourful reality! Start your working life with us and enjoy your work with interesting projects.

Megamenü_2023_Karriere-4-1

Students

You don't just want to study theory, but also want to experience it in practice? Check out theory and practice with us and experience where the differences are made.

Megamenü_2023_Karriere-3

Jobs

You can find all open vacancies here. Look around and submit your application - we look forward to it! If there is no matching position, please send us your unsolicited application.

Blog
NextLytics Newsletter Teaser
Sign up now for our monthly newsletter!
Sign up for newsletter
 

How to Implement an Automatic Change Log BAdI

◀ Back to Knowledge Base

Especially if you are working with sensitive data, it is crucial to track the latest changes. Such process creates responsibility and helps to avoid business risk due to error or negligence. In the "How to track changes with NextTables" article, you learned the basics of the change log process. In this article you will receive step by step guidance through the technical side of implementation.

At the end of this article, you will be able to lock the change log fields and fill them automatically. You can see an example below.

How to Implement an Automatic Change Log Badi 1

Necessary Steps

In order to achieve the desired result, we have to change the setting EDITABLE of the fields Changed on and Changed by to locked. In order to ensure it, we will set this setting in the META method of the /NLY/BADI_EDITOR BAdI.

How to Implement an Automatic Change Log Badi 2

Furthermore, we have to derive and fill these fields in the I_STEP 1 of the UPDATE method.

Technical implementation

In the How to implement a BAdI for NextTables article you have learned how to create a BAdI implementation. To make sure that the BAdI is executed for a certain table only, you have to setup the filter criteria accordingly. Please enter respective table name and table type. In our example we use the DSO ZOMACOST.

How to Implement an Automatic Change Log Badi 3

The logic itself is implemented in the implementing class. First, we will utilize the method /NLY/IF_EDITOR~SET_META_EXIT to change the field editability settings. Double click on the method to create an implementation.

How to Implement an Automatic Change Log Badi 4

In our example, we use the fields ZCUSER and ZCDATE to store the Changed by and Changed on information. In order to prevent manual changes, we have to set editability of those fields to locked using the following code.


METHOD /nly/if_editor~set_meta_exit.
    DATA: l_s_fields_info TYPE /nly/ts_fields_info.
    FIELD-SYMBOLS:  <l_s_fields_info> TYPE /nly/ts_fields_info.

* Change properties 
    LOOP AT ch_t_fields_info ASSIGNING <l_s_fields_info>.

      CASE <l_s_fields_info>-fname.
        WHEN '/BIC/ZCUSER' OR '/BIC/ZCDATE'.
          <l_s_fields_info>-editable = '1'.
      ENDCASE.
    ENDLOOP.

  ENDMETHOD.

After activation, user cannot edit these fields via front end.

How to Implement an Automatic Change Log Badi 5

 

After we have ensured that the fields are not editable, we will fill them automatically. In our example we use system parameters sy-uname, which contains the active user, and sy-datum, which represents the current date. Please create an implementation of the Update method /NLY/IF_EDITOR~SET_UPDATE_EXIT with the following code.

METHOD /nly/if_editor~set_update_exit.

    FIELD-SYMBOLS:
      <fs_t_table> TYPE ANY TABLE,
      <ls_table>   TYPE /bic/azomacost2. "Table structure

    CHECK co_table IS BOUND.
    ASSIGN co_table->* TO <fs_t_table>.

    CASE i_type.

      WHEN /nly/cl_table_rest_v3=>co_type_validate.

        CASE i_step.

          WHEN /nly/cl_table_rest_v3=>co_step_before_update.
          WHEN /nly/cl_table_rest_v3=>co_step_after_update.

        ENDCASE.

      WHEN /nly/cl_table_rest_v3=>co_type_update

        OR /nly/cl_table_rest_v3=>co_type_insert
        OR /nly/cl_table_rest_v3=>co_type_delete.

        CASE i_step.

          WHEN /nly/cl_table_rest_v3=>co_step_before_update.

            LOOP AT <fs_t_table> ASSIGNING <ls_table>.
              <ls_table>-/bic/zcuser = sy-uname.
              <ls_table>-/bic/zcdate = sy-datum.
            ENDLOOP.

          WHEN /nly/cl_table_rest_v3=>co_step_after_update.
        ENDCASE.
    ENDCASE.
 ENDMETHOD.

Now, as you change the values, the fields Changed by and Changed on are updated automatically.

How to Implement an Automatic Change Log Badi 6

As you implement your custom logic, please make sure that all involved pieces are activated, not only the implementing class. You need to activate the following objects:

  • implementing class together with methods
  • BAdI implementation
  • Enhancement implementation

Which License is needed for this feature Professional | Enterprise


Do you have a question regarding NextTables? Already a customer? Please click here for Support.