Quantcast
Channel: Custom Code Management
Viewing all 19 articles
Browse latest View live

Enhancing the ABAP Workbench with a website containing dev guidelines!

$
0
0

Hi community,

 

we all know that development guidelines are always in PDF format hidden on a fileshare or document management system. Updates are not really distributed. What if you would have a modification free possibility to show every developer of your company the latest version of guidelines located on an internal webserver.

 

Update: With SAP Netweaver 7.40 SP10 please use the standard behavior

ABAP Workbench Tools

     -> Initial page (SE80)

          -> Changing the Welcome Page

 

For all older releases please continue.......

 

 

What to do?

 

  1. Create a website with your own guidlines or use the official http://help.sap.com/abapdocu_740/en/index.htm?file=ABENABAP_PGL.htm
  2. Create an implicit enhancement to the class CL_WB_INITIAL->SHOW_CONTROLS at the end of the method and add the following code

 

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:
1) Klasse CL_WB_INITIAL, Methode SHOW_CONTROLS, Ende                                                                                                 A
*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT Z_WB_START.    "active version

DATA:  l_url          TYPE char200,
             l_url_sec      TYPE string,
             l_is_ok        TYPE abap_bool,
             l_wan_flag     TYPE as4flag.
  data:    l_event_tab      type cntl_simple_events,
              l_event          type cntl_simple_event,
             lv_ssm_cust      type ssm_cust.

* Get the URL for HTML control
  SELECT SINGLE * FROM ssm_cust into lv_ssm_cust WHERE id = 'SESS_WB_URL'.
  IF sy-subrc = 0 AND lv_ssm_cust-path IS NOT INITIAL.
     l_url     = LV_ssm_cust-path.
     l_url_sec = LV_ssm_cust-path.

* Check if this URL is valid/good
    CALL METHOD cl_http_utility=>if_http_utility~is_valid_url
      EXPORTING
        url   = l_url_sec
      RECEIVING
        is_ok = l_is_ok.

    IF NOT l_is_ok IS INITIAL.
      CALL FUNCTION 'SAPGUI_GET_WAN_FLAG'
        IMPORTING
          wan_flag = l_wan_flag.
      IF l_wan_flag IS INITIAL.
       IF NOT me->html_control IS INITIAL.
           SET HANDLER handle_evt_sapevent FOR me->html_control  ACTIVATION space.
       ENDIF.
       CLEAR:
        me->gui_container,
        me->html_control.
        CREATE OBJECT me->gui_container
             EXPORTING
                container_name  = 'IMAGE'.
         if me->html_control is initial.
         create object me->html_control
             exporting
                 parent   = me->gui_container.
    l_event-eventid    = me->html_control->m_id_sapevent.
    l_event-appl_event = ' '.
    append l_event to l_event_tab.
    call method me->html_control->set_registered_events
      exporting
        events = l_event_tab.
    set handler handle_evt_sapevent for me->html_control.

    call method me->html_control->show_data
      exporting
        url = l_url.

    endif.
  endif.
endif.
endif.

ENDENHANCEMENT.

*$*$-End:   (1)---------------------------------------------------------------------------------$*$*

ENDMETHOD.

 

 

 

3. An finally start SM30 for table SSM_CUST and maintain a valid URL for the entry SESS_WB_URL

 

 

Now in your ABAP workbench the website will be opened.

 

 

 

SE80.PNG

 

Regards

Björn


Reducing complexity of Custom Code Implementations

$
0
0

Customer always enhance standard systems with own home grown code. This coding will always be penetrated by change requests, improvements and bug fixes. A common problem of central enhanced code positions will be localizations or local implementations of business processes.

Huge IF or Case statements to complete different behaviors of a process or in worst case additional customer specific customizing tables.

All these requirements leads to additional efforts in development, testing and also transport of code. The time to realize a feature and the time until it will be available for testing or productive use. What happens if the business departments are not able to define the final specifications?

 

In this case I recommend to make a disruptive switch from implementing hard coded, semi flexible features to a very flexible rule based approach.

Just focus on the interface parameters and move eberything to the business side. Away from complex ABAp statements into a direction of configure and release with high speed.

 

Please have a look at SAPs Decision Service Management and the Business Rule Framework

 

DSM SCN Seite: http://scn.sap.com/docs/DOC-29158

 

And visit the blog from Carsten explaining how to get rid of unflexible customizing tables.

 

Custom Code Blog: http://scn.sap.com/community/brm/blog/2013/08/31/how-to-kill-custom-code-and-z-tables

Reason why you should INVEST in custom code

$
0
0


Build custom code on top of a standard software is always an investment and often not cheap. It will lead to new responsibilities, additional effort and further investments in any kind of change events.

 

Let us assume you will have a perfect specification and a requirement document. The next step will be the design and implementation phase. In best case with an agile development methodology like SCRUM. But it works also with the waterfall methodology.

 

The goal: Breaking business specification into testable features with moderate development effort provide a base for both developer and QA's activity planning;  It also serve as the primary input into backlog in Scrum/takt planning and execution.

 

 

I.N.V.E.S.T. for better Custom Code

 

 

Independent:

Independent backlog item are easiest to be developed. Use the SCRUM methodology and break down the requirements in smaller pieces


Negotiable:

Capture the essence of a feature and leave design/implementation/ testing details to team. Focus on the need for the business and do not manipulate the developers. They know what is feasable or not.

Valuable:

Cares about value to the business and only to the business. Usage estimation of features to be implemented are really needed. Avoid requesting waste or features nobody really use.

Estimable:

Estimable so that both SCRUM team and the appication business owner are able to rank and plan implementation.

Small:

Small so that one development team can deliver in one development cycle unit. No sense to have one backlog team to consume all available team capacity. Recommendation: size < 15PD for a working, releaseable feature

Testable:

Testable so that quality can be assured by Quality Assurance using ABAP Test Cockpit or SAP Code Inspector after code implementation.

What's new in Solution Manager 7.1 SP12 Custom Code Management

$
0
0

Live Session

 

August 15, 2014; 15:00-16:00 (CEST) Topic: Custom Code Lifecycle Management - Decommissioning  (Speaker: Thomas Fischer)

Abstract:

  Custom Code requires a lot of effort to make the necessary changes and to execute necessary tests upfront any change event.

Often a lot of unused custom code still exist in your landscape. Efficient decommissioning of this code will help to reduce effort and prepare the system for new innovations.

Objectives:

  We will show how the new features in Solution Manager SP12 support you in your decommissioning project.

Especially how you will be able to mange your custom code efficiently using our new city model and the newly generated dashboards.

 

Register today to get a free seat.  

 

Get the latest Slidedeck and Learning Material about Custom Code Managent

 

RampUp Knowledge Transfer

Reduce your custom code by using BRFplus / DSM

$
0
0

Introduction

One part of my job here at SAP is to "promote" BRFplus and DSM in projects within SAP Services (Consulting). To be very clear - this does not mean to simply sell it but more or less to show the capabilities in prototypes, demos, proof-of-concepts and so on.

Another part of my job is working on / with an engineered service package officially called "Custom Code Migration Service for SAP Business Suite on HANA". There we take care of your custom code when it comes to a migration to Suite on HANA (there are a lot of guides, tools etc. available. As I want to focus on another topic, this should be enough).

 

With these two different aspects of technology topics, I see BRFplus definitely as a topic in this area of custom code management. With BRFplus, you can model business (decision) logic without creating custom code in massive ways. Just let me give you some examples from different projects (anynomized, of course) to show how BRFplus can replace custom code, increase flexibility (closer to business users, easier to change) and reduce costs (e.g. in case of upgrade, migration to HANA, etc., this is no longer custom code!).

 

Example 1 - Goodwill (Warranty)

This project was part of a Warranty based project. The question was how to handle customers asking for goodwill for the goods they bought. Let's assume, we are in the automotive industry and sell special cars. By law, you might be obliged to deliver warranty regarding your special car for 24 months (2 years).

 

But for every repair that comes after these 24 months, it is up to your company if you want to allow goodwill for our customer.

Depending on different parameters (how old is the car? what about the mileage? who is the customer? what is the damage reported?...), you should decide how much of the costs (labour, material, other) you want to cover as goodwill.

 

In this scenario, all of our rules were modeled within BRFplus and the custom code part was simply the integration call. This integration looks a little bit like calling a function module. By that, we were able to avoid custom code in the system and the rules could be modeled closer to the business unit, e.g. with a decision table as shown in the following picture.

 

12.08.png

 

In this decision table, there are only as example 3 condition columns in this screenshot, but by this it is still easy-to-understand. You can read the first row like this:

If the car was sold in Sales Region (VKORG) 1000, is 24 - 26 months old and has a mileage of 200.000 to 250.000 km, we will pay 80% of the material, labour (time) and all other costs.

 

In reality, there were more than 50 parameters that influenced the decision. This would have been a lot of IF/ELSE or CASE-Statements in ABAP, a lot of (Z-) customizing tables etc., but everything could be modeled in BRFplus.

 

Example 2 - Tax Code Determination (Purchasing)

A typical example - which is by the way documented by Carsten Ziegler in a nice document, too - is the determination of the Tax Code in a Purchasing Order in ERP (MM-PUR).

 

12.08.png

 

The idea is that for each item in a purchase order, you have to determine the correct Tax Code as shown in the image. Typically, you have a some logic on your own within a function module, class/method  behind the standard BADI to determine the correct behaviour of the Tax Code.

 

Instead of using the BADI offered here (ME_PROCESS_PO_CUST with Method PROCESS_ITEM) to put our logic in there, we simply added a call of a BRFplus function in there (<30 lines of code). All of the business logic is encapsulated in the BRFplus function and if the logic to determine the tax code changes, you simply change the BRFplus logic.

 

The logic within BRFplus could look like the following screenshot, where you see the real modelling workbench of BRFplus.

3.png

 

Here, we say that if the Plant is '0020', the Tax Code should be N0 and so on. There are a lot of expressions that you can use in rules but most commonly are from my point of view decision tables and formulas as these two expression types offer almost everything you need to model business logic - and it is easy-to-understand compared to ABAP. So as last aspect, let's have a look at a decision table to show how this might reduce your IF-ELSE / CASE-Statements massively.

 

4.png

In this Decision Table, we see that based on the Material Category the Tax Code is determined. Compared to a CASE-Statement, you have some advantages here: You can have several condition columns (not only the category but maybe in parallel the country, purchasing organisation (EKORG), ...) and within each condition row, you can choose several values (with including or excluding conditions like: Category 01 - 10 but not 08.).

 

So you might see that at least I am pretty much excited about the capabilities of BRFplus / DSM.

 

Summary

With BRFplus you can model your logic inside a tool instead of doing it all by (custom) coding and customizing tables. Generally, you only need a few lines of code for the integration - but this interface is usually very stable. By that you reduce your amount of custom code, because you do not need FORM-routines, Function Modules, classes / methods etc. All of your logic is put into BRFplus. At the end, BRFplus is generating at runtime ABAP code, but this is not "custom code" when it comes to maintenance etc.

 

I really feel that if you take care of custom code management and you identify spots where you need your tailored process in the SAP system, BRFplus can be a valid alternative instead of coding.

 

In addition to that, the modelling tools offer the possibility to let the business experts do the modelling work in BRFplus instead of specification documents.

 

So how can you benefit from BRFplus? I would say: directly by simply starting the transaction "BRFplus" on your system. It is included in your NetWeaver-ABAP system. Try some small prototypes, read the official SAP press book, get involved in the BRFplus Community here in SCN, book a course...

As soon as you dive deeper into this topic, I would strongly recommend to check out DSM as Add-On. Why? Just check this post by Carsten Ziegler.

Getting started with Doctor ZedGe

$
0
0

The ABAP Test Cockpit is a new powerful enterprise-ready SAP standard tool to perform static program analysis of Custom ABAP Code. The results are fine for developers but for Project Managers, Quality Managers and IT Managers are difficult to be translated into activities.

This guide will explain how Doctor ZedGe can provide more transparency on the quality of your custom ABAP code also introducing some proven concepts related to software quality assurance. It's just a small add-on by Techedge to better present the ATC results.

 

img_1.png

 

Thanks to community project abap2xlsx, it creates nice looking MS Excel spreadsheets aggregating the raw data produced by ABAP Test Cockpit and computing additional metrics like Maintainability Index.


Our idea was to simplify the ATC results, that are designed to be used mainly by a developer to adjust the code (and I suggest to use it in your every day development activity), in order to provide an easily readable overview of the system complexity.

 

We thought about a label, like the one used for the energy class, to be applied to custom code to prove its quality.

 

img_2.png

 

In order to achieve this result we designed a MS Excel spreadsheets composed of three sections:

  • The Global Score: the label that shown the calculated global score
  • The Report Summary: a summary that show ad aggregation of the value contained in the Report Detail section
  • The Report Detail: a detailed list of all scanned objects with standard metrics and violations available in three different aggregation level depending on the role of the user

img_3.png

We designed it for Developers and Quality Assurance Managers (QA) but also for Team Leaders and Project Managers (PM), for AMS members and even for SAP Owners.

 

SAP Owners

During the weekly CAB meeting, SAP Owners will monitor quality of Custom ABAP Code. In case, they can launch new projects to improve it. Periodically they may also want to get a Certification from independent companies.

 

img_4.png

 

Team Leaders and Project Managers (PM)

Running Doctor ZedGe against the specific Change Request of their project, Team Leaders and Project managers can get:

  • Quantitative analysis with transparency on number of objects  created/changed together with detailed software metrics like (e.g. Lines of code)
  • Quality analysis with a clear picture of exceptions

 

It’s important to underline that information can be obtained at any time and not only during the release of the CR or during Massive Checks performed by the QA.

Team Leaders will normally run the query each day maybe before the SCRUM meeting.

Project Managers will normally run it to prepare the weekly Status Meeting.

 

AMS members

During the hand-over process (Knowledge Transfer phase), AMS can inspect the CRs the Project Team is going to move to production. Doctor ZedGe highlights objects with higher Maintainability Index and with any exceptions (Violations) and special attention can paid on them.

 

Quality Assurance Managers (QA)

QAs can weekly analyze the QAS system for example aggregating by Package (formerly known as Development Class).

 

Developers

As many times as needed, Developers can check compliance to standards. They will avoid Violations by design. They will also produce Elegant Code thanks to the metrics Maintainability Index, Cyclomatic (indicator of complexity) and Comment ratio. A granted good Modularization is a big benefit.

 

Do not forget to get rid of Business hard coding

Please refer to blog Business hard coding finder - a free Code Inspector check to improve your Custom ABAP Code to evaluate risks introduced by the practice of hard coding strings (literals) corresponding to codes (IDs) related to Organizational Units or Document Types and even Master Data. Examples are Company Codes, Purchase Organizations, Sales Organizations, and Accounting document types.

 

Installation

Here you can find a form to request the transports of the Doctor ZedGe and the installation instructions.

 

Technical Requirements

In add to Code Inspector and abap2xlsx, Doctor ZedGe leverages and requires ABAP Test Cockpit that is available since SAP ECC 6.0 EhP6 (SAP BASIS 7.31 SP05).

 

And finally ...

Here you’ll find the presentation (power point file) held by me at the SAP Inside Track Munich 2014 and if you have the pleasure to participate to the SAP TechEd && d-code 2014 in Las Vegas don't miss the presentation that will be held by Ivan Femia.

Direct access to single object in CCLM via browser

$
0
0

CCLM offers you the capabilitry for mass maintenance and an integrated view on all obejcts. But there is also the need to access directly an custom code object in CCLM without using the full CCLM application.

 

For this purpose a weblink feature is available.

 

Just put this link in your browser

 

https://<server>:<port>/sap/bc/webdynpro/sap/ags_ccl_objects?sap-client=001&sap-language=DE

 

and add the following addition parameters to th eURL

 

&WP_OBJECT_NAME=ZZTEST&WP_PGMID=R3TR&WP_TYPE=PROG

 

This will open the CCLM objects view for this single object. In this example the Program with name ZZTEST.

 

CCLM_obj.PNG

 

Now it is much easier to maintain attribute values for a single object and with a better performance.

 

To find out the server and port just open SE80: in Package AGS_CUSTOM_CODE do a single test in webdynpro application AGS_CCL_OBJECTS.

New master note of SAP Solution Manager 7.1 SP 12


Guides for Custom Code Management Tools in Solution Manager

$
0
0

Hallo,

I assume that you have already heard about the new and exciting features for CCLM coming with SP12 of Solution Manager 7.1. The documentation to implement CCLM is now directly embedded in the Solution Manger Set-Up for Custom Code Management.

 

If you need some more information on how to work with these new features in SP12, please read:

Work with CCLM in Solution Manager SP12 | SCN

 

For your convenience here you can find some information on CCLM until SP10:

Set-Up CCLM until SP10 | SCN

 

And here are information on how to set-up UPL:

Set-Up UPL | SCN

 

I hope this helps to enjoy the new features in Solution Manager SP12.

 

Regards,

Thomas

Get started with CCLM on SP12 - register to an EGI session now

$
0
0

Dear customers,

 

If you plan to start with CCLM on your SAP Solution Manager SP12 in near future,  you should think about taking part at a CCLM EGI to understand the setup procedure and the scope of CCLM. EGIs are structured as follows:

 

  • Empowering: SAP experts explain step-by-step configuration process and engage in technical knowledge transfer with your IT professionals, multi-day virtual classroom training via Web session, 1-2 hours each day.
  • Execution: Participants execute demonstrated steps within their own project, on their own SAP environment, 2-3 hours on the same day.
  • Expertise on Demand: Participants have direct access to an SAP expert who, if necessary, supports them remotely during the execution in the afternoon of the week were the EGI takes place


Link to register for the CCLM EGI: https://service.sap.com/sap/bc/bsp/spn/esa_redirect/index.htm?gotocourse=X&courseid=70255033

 

For a successful participation of this EGI it is necessary to follow / implement the prerequisites before you attend the EGI. Please read more here about the prerequisites.

 

 

Best regards,

Sylke Graupner

Understanding the ‘Size’ parameter in SAP Clone Finder result.

$
0
0

In the Clone Finder result ‘Size’ parameter count could be misleading sometime. Hence it is necessary to read and understand the ‘Size’ parameter and its output. Here are few test scenarios described to clarify the ‘Size’ count and found that the SAP Clone Finder actually counts “only the lines” where section of the ABAP code has been written (pure lines of code) irrespective of ‘ABAP Keywords’ (An ABAP word that initiates an ABAP statement.) or ‘ABAP Statement’ (A complete sentence of the ABAP programming language closed with a period.)

 

  1. The ABAP Editor shows total 16 lines in a program which includes Header, Commented code/lines & Empty lines.Capture1.JPG.png

→The SAP Clone Finder result shows ‘Size (Total lines of code in a program) = 5’, which excludes the Header, Commented lines & Empty lines. Pure lines of ABAP code.

Capture2.JPG.png

2. Now if we combine all the lines of code into one single line….

Capture3.JPG.png

→The Size count changes to = 1. The Clone Finder counts only the lines where ABAP code has been written.

Capture4.JPG.png

3. Now if we break the ABAP Statements (A complete sentence of the ABAP programming language which close with a period.) into several lines…

Capture5.JPG.png

→The Size count now changes to = 10. This iterates the fact that the SAP Clone Finder 'Size' parameter actually counts only the “lines” where code has been written excluding a Header, Commented lines and Empty lines.

Capture6.JPG.png

Enhancing CCLM with own made URL integration

$
0
0

CCLM is a flexible tool in solution manager to collect and manage custom code objects with their individual and flexible attribute value pair assignments.

In this blog I will explain how to integrate CCLM with an external URL or link to a document management system (DMS)

 

First we need a customer specific attribute. To define this start CCLM in Solution Manager.

 

  • Go on activity "Library Definition"

 

  • Create a new attribute  e..g. Z_URL as a STRING of lenght 200 with cardinality N and ensure you selected the "maintainable" flag
  • Assign now this attribute to the objects CustomCodeObject and CustomCodeDuplicate. Of course you can also assign them to the Owner, Contracts etc types. It depends on you and your demand.

 

 

Now we have created a simple new attribute and can maintain this attribute with a value = URL to a website to any object in the library.

 

CCLM_URL.PNG

 

You might see that there is a new button "GOTO" available. This button will be activated as soon as you have a valid BAdI Implementation available.

 

To enable this button please implement the BAdI with the following steps.

 

  • Start SE18 and implement the Enhancement Spot AGS_CUSTOM_CODE_GOTO  -> DISPLAY
  • Open the tree on the left side
  • Position on word IMPLEMENTATION and make a right mouse click -> Create Implementation
  • Create an enhancement implementation  (F8)
  • Give a menaingful name and a description
  • Assign it to a development class
  • Double click on you new create implementation
  • Enter now a name for the BAdI Implementation, a description and an implementing class
  • Copy either the sample implementation or select "EMPTY class"
  • Confirm and assign to your development package
  • Open the tree and go to edit mode and select "Filter value"
  • Create a "Combination" using Z_URL = ATTRIB_CLASS
    cclm_filter.PNG
  • Switch to implementing class and implement the method IF_AGS_CUSTOM_CODE_GOTO_BADI~EXECUTE_GOTO

 

          method IF_AGS_CUSTOM_CODE_GOTO_BADI~EXECUTE_GOTO.

             data: lv_url type string.
                    lv_url = attrib_value.

            cl_ags_work_app_launcher=>wd_url_launch(
                      i_wdapi = WD_API
                      i_url   = lv_url         ).

          endmethod.

 

  • Save and activate your implementation.

 

If you open now your CCLM objects view and you position the custor on the line with your attribute and you click on the GOTO button a webpage with the corresponding URL will open.

 

 

Purpose:

You are now able to integrate any external webpage or anything reachable with simple HTTP URL with CCLM.

You can also open any Solution Manager Webdynpro Application or start any Tcode.
You might start a remote logon to an external system....

 

Thousands of possibilities one simple BAdI interface to be implemented.

 

 

Please post your ideas here and share it with the community.

 

 

Please implement note 2095905 to ensure a working environment.

 

 

 

 

 

 

 

 


CCLM: How to create own attribute and implement BADI to extract value

$
0
0

1 General Information

1.1     About this document

This document is about how to create own attributes in CCLM and implement BADI to extract data and set value for own created attribute, a step by step guide will be provided with snapshots.

The next chapter has implementation details.

1.2 Technical Prerequisite

In this version, detail authorization and technical prerequisite is not discussed. In General, authorization role SAP_CCLM_ALL (with authorization object: SM_CC_AUTH with the ID 'SM_CC_LIB' and activity 20 = Change library definition) has to be assigned to user who is responsible in this implementation.

SAP Note 1978139-Custom Code Library: Collection of Custom Attributes via BADI should be implemented to avoid data collection error.

2 Implementation Details

In this document we describe a scenario to create an attribute to keep old package information of custom attribute, in order that in case development class of object is changed, we have different old value and new value.

2.1 Create attribute

T-Code CCLM -> navigation bar ‘Library Definition’ -> tab ‘Attribute’, click button ‘Create’ to create new attribute.

 

CCLM_Attribute_01.jpg

CCLM_Attribute_02.jpg

CCLM_Attribute_03.jpg

 

2.2 Assign attribute to custom object

After attribute creation, you have to assign the defined attribute to custom code object in order to show it in the attribute list of object when you browse the “Objects” navigation panel.

Transaction Code ‘CCLM’ -> ‘Library Definition’ -> Tab ‘Objects and Assigned Attributes’.

CCLM_Attribute_04.jpg

CCLM_Attribute_05.jpg

CCLM_Attribute_06.jpg

 

 

2.3 Implement BAdI

Once you have defined your custom attributes and know which ones of them should be maintained automatically via a custom collector, then you have to define a customer individual RFC function module or a BADI implementation in your managed system(s) to retrieve the data for the custom attributes and pass it back to CCLM.

As a template please use the existing RFC function module /SDF/GET_CCLM_ATTR_VIA_BADI or implement directly the BAdI /SDF/CCLM_ATTR_BADI. Here we implement BAdI /SDF/CCLM_ATTR_BADI as example.

In managed system, T-code SE18.

CCLM_Attribute_07.jpg

CCLM_Attribute_08.jpg

CCLM_Attribute_09.jpg

 

 

Implement method ‘GET_ATTRIBUTES’ to extract data and set CCLM attribute.

2.3.1 Create data type

Create a data type (structure) for attribute in managed system.

T-Code SE11 -> Data Type ‘ZAGS_CC_DATA’

CCLM_Attribute_10.jpg

CCLM_Attribute_11.jpg

 

2.3.2 Implement data extraction coding

 

CCLM_Attribute_12.jpg

Sample code is attached below.

 

 

 

2.4 Set up the custom collector in CCLM configuration

Next step is to propagate the new customer specific function module (or specific function module which calls the BADI implementation) to the CCLM. For this please define a unique identifier in CCLM customizing table AGS_CC_CUSTOM.  If you are using the BAdI implementation, please use the value CC_CONTENT = /SDF/GET_CCLM_ATTR_VIA_BADI.

T-Code SE16, table AGS_CC_CUSTOM, add one entry as below for the custom attribute.

CCLM_Attribute_13.jpg

[Comment]: For a subset of for all customer specific fields you should define this unique identifier. This unique identifier is the link between the generic data extractor job and the used function module while running the extraction. E.g. CUSTOM1 as example.

CC_KEY                CC_CONTENT

CUSTOM1           Z_RFC_FUBA_NAME

Here we directly use the name of the attribute ‘ZOLDPK’ as CC_KEY.

2.5 Define a new customer field's extractor job

For every group of customer fields you should define your own extractor entry. This has the benefit to schedule this job independent for subsets of customer attributes. But will also give you the flexibility to schedule this job only for selected systems. Maintain the table AGS_CC_EXTACTOR with the following schema

Job name: SM_CCL: <CUSTOM1>

in this example the < CUSTOM1> must be the same as the CC_KEY in the AGS_CC_CUSTOM, in our example <CUSTOM1> is ‘ZOLDPK’. Example:

CCLM_Attribute_14.jpg

This customizing will define a new collector entry in the CCLM settings calling the CCLM standard program RAGS_CC_GET_NEW_ATTRIBUTES every week at 6 AM in the morning.

T-Code SE16, table AGS_CC_EXTRACTOR, add one entry as below.

CCLM_Attribute_15.jpg

2.6 Schedule the custom collector job

Once you have executed the step before, go to the navigation bar Settings (before SP10, in case ST-PI> SP10, go to solman_setup or directly start job in SM37) on the left and select the system where you want to schedule the job. A new entry should appear with job name:

SM_CCL: <IDENTIFIER><SID><Installation_Number>

Schedule the job to start information extraction.

CCLM_Attribute_16.jpg

[Comment]: In case upper version of ST-PI (> SP10), you might not have Settings in navigation bar, then you can either go to solman_setup -> CCLM or directly go to SM37 to create/copy a batch job for this.

CCLM_Attribute_17.jpg

CCLM_Attribute_18.jpg

 

2.7 Check Attribute Value in CCLM

T-Code CCLM -> navigation bar ‘Objects’ -> check attributes of the object.

CCLM_Attribute_19.jpg

CCLM_Attribute_20.jpg

[Reference]: CCLM Configuration Guide.

Enhance ATC / SCI to use pragmas in test

$
0
0

In general the use of pragmas is a good way to tell

„Yes, I know it’s dirty, but I need it that way“.

It is faster than ATC exemptions but from a quality assurance perspective it’s also a bit scary cause you have less control how often these exemptions are used. Due to that we came up with code inspector test to validate if the developer wrote additional text behind de pragma / pseudo comment.

 

DATA gv_unused               Type  ##NEEDED .
DATA gv_unused_with_reason   Type  ##NEEDED. "Is used in dynamic assign.

 

During the development of this test my colleague found out that in our current Netweaver version 740 SP3 pragmas do not show up in code inspector scans.

The Issue is a missing parameter in the command for the source scan in CL_CI_SCAN : CONSTRUCTOR

 

SCAN ABAP-SOURCE      p_include->lines          TOKENS          INTO tokens          STATEMENTS      INTO statements          LEVELS          INTO levels          STRUCTURES      INTO structures          FRAME PROGRAM   FROM p_include->trdir-name          INCLUDE PROGRAM FROM p_include->trdir-name          MESSAGE         INTO message          INCLUDE         INTO include          LINE            INTO line          WORD            INTO word          WITH ANALYSIS          WITH INCLUDES
WITH COMMENTS

The parameter WITH PRAGMAS  is missing.

 

Unsing SAP Enhancements you can change the SCAN command and enable pragmas for the tests.

We implemented an implicit enhancement and added the WITH PRAGMAS option controlled by additional Parameters in the Constructor:

 

method CONSTRUCTOR .
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Klasse CL_CI_SCAN, Methode CONSTRUCTOR, Anfang                                                                                                    A
*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT 1  Z001_ENH_CI_SCAN_CONSTRUCTOR.    "active version
LOG-POINT ID Z000_SAP_CODE_ENHANCEMENT SUBKEY sy-cprog FIELDS 'Z001_ENH_CI_SCAN_CONSTRUCTOR'.   IF p_with_pragmas = abap_true.     SCAN ABAP-SOURCE p_include->lines          TOKENS          INTO tokens          STATEMENTS      INTO statements          LEVELS          INTO levels          STRUCTURES      INTO structures          FRAME PROGRAM   FROM p_include->trdir-name          INCLUDE PROGRAM FROM p_include->trdir-name          MESSAGE         INTO message          INCLUDE         INTO include          LINE            INTO line          WORD            INTO word          WITH ANALYSIS          WITH INCLUDES          WITH COMMENTS          WITH PRAGMAS '*'.     subrc = sy-subrc.     IF p_noaunit = abap_true.       determine_aunit_lines( ).     ENDIF.     RETURN.   ENDIF.
ENDENHANCEMENT.
*$*$-End:   (1)---------------------------------------------------------------------------------$*$*     SCAN ABAP-SOURCE      p_include->lines          TOKENS          INTO tokens          STATEMENTS      INTO statements          LEVELS          INTO levels          STRUCTURES      INTO structures          FRAME PROGRAM   FROM p_include->trdir-name          INCLUDE PROGRAM FROM p_include->trdir-name          MESSAGE         INTO message          INCLUDE         INTO include          LINE            INTO line          WORD            INTO word          WITH ANALYSIS          WITH INCLUDES          WITH COMMENTS.   subrc = sy-subrc.   if p_noaunit = 'X'.     DETERMINE_AUNIT_LINES( ).   endif.
ENDMETHOD.

This parameter is transferred from the Initialisation of the first test to the CL_CI_SCAN class. The CONSTRUCTOR of CL_CI_SCAN needs be enhanced with an additional parameter:

 

P_WITH_PRAGMAS     TYPE ABAP_BOOL  DEFAULT ABAP_FALSE

 

The CONSTRUCTOR is CALLD in Method GET of CL_TEST_SCAN that needs an implicit enhancement at the top too:

 

ENHANCEMENT 1  Z001_ENH_CI_TEST_SCAN_GET.    "active version
* Enhancement enables the output of pragmas in the code scan to make them searchable.
LOG-POINT ID Z000_SAP_CODE_ENHANCEMENT SUBKEY sy-cprog FIELDS 'Z001_ENH_CI_TEST_SCAN_GET'.
* Code is copied from SAP lines below   IF ref_include IS INITIAL.     CHECK super->get( ) = abap_true.   ENDIF.   CHECK ref_include->subrc = 0.   IF ref_scan IS INITIAL.     cl_ci_scan=>create( EXPORTING p_include      = ref_include                                   p_noaunit      = no_aunit                                   p_with_pragmas = with_pragmas  "new attribute of class which is to be set on usage class exmpl: ZCL_001_CI_TEST_PRAGMA_JSTFCTN                         IMPORTING p_ref          = ref_scan ).   ENDIF.
ENDENHANCEMENT.

 

Here is now a class attribute used to control pragmas on/off. This needs to be added to the class:

WITH_PRAGMAS Instance Attribute     Protected Type ABAP_BOOL

 

This attribute is inherited to the test classes an used in the CONSTRUCTOR of the custom test where we set it to abap_true.

 

Attention:  If the first test in the SCI variant is a standard test that does not use the enhancement, it will not be called again as the Instance of CL_CI_SCAN is reused by default. Until now we did not test it, but to use the CLEAR method in your own test class could help to enforce to start the source scan again.

 

Thanks to my colleagues Stefan Gaertner  for the great work.

Presentation on Custom Code Management Tool by SAP

$
0
0

Hello everyone,

I was asked several times to share my Slides from sithh 2015 with the information on Custom Code Management tools provided by SAP ( without SOLMAN). My special thanks goes to the team sap_ags that introduced me to these tools. Bjoern Panter

 

 

 

Here they are at SlideShare: Custom code management & tools



Summary of my presentation:
  • Custom Code Management will have positive impact on your TCO
  • There are lots of tools available that you can use
    • TA: CCAPPS
    • SQL Monitor / SQL SQL Performance Tuning Worklist
  • Take your time to get used to them
  • Involve the business an test solution


Links:

scr1:  Custom Code Management – Decommissioning     [PDF]  SAP 2014

scr2: Custom Code Management Custom Code Apps      [PDF]  SAP Active Global Support

scr3: CCM Usage & Procedure Logging                              [PDF]  SAP Active Global Support

Usage & Procedure Logging                                                  [SCN]  SCN 2015

 

 

Code Inspector Check for clones:

http://scn.sap.com/community/abap/blog/2015/03/08/abapopenchecks--open-source-checks-sap-code-inspector-atc

 

Use Boy Scouts Rule

http://clean-code-developer.com/Red-Grade.ashx#Follow_the_Boy_Scouts_Rule_4    ( Thanks Peter Langner )

 

 

 

 

 

 


Clonefinder - 2 new updates to make your life easier

$
0
0

Hi friends of the clonefinder,

 

just implement note

 

2195536

 

Capability to save your customer individual namespaces

 

 

 

2219002:

 

Tremendous performance increase by introducing a delta calculation. First run remains unchanged, but every additional run later on will calculate only changed and new objects and will update the existing buffer

Solving SAP problems without reading code - Extract a FAMIX model to Moose

$
0
0

Overview

There is now an open source project started to extract code information for analysis using Moose. It was first presented at the SAP Inside Track 2016 Frankfurt.

 

It can be used to draw diagrams like this:

 

https://raw.githubusercontent.com/RainerWinkler/Moose-FAMIX-SAP-Extractor/master/wiki_pictures/Packages_with_classes_and_usages.png

 

The program is available on Github:

GitHub - RainerWinkler/Moose-FAMIX-SAP-Extractor: An project to extract model data from a SAP system with FAMIX and Moos…

 

A complete description on how to use it is given in the wiki. See this link for a complete use case: Usage of methods (Use Case) · RainerWinkler/Moose-FAMIX-SAP-Extractor Wiki · GitHub

 

Moose is afree open source platform for software and data analysis built in Pharo.

 

Extraction is done using FAMIX. FAMIX is optimized to support multiple languages and can contain detailed information needed for software analysis and refactoring (See for instance this article to explain why: Why FAMIX and not UML ?).

 

For an overview over Moose see Moose.

 

You may also check Agile Visualization and Humane assessment .

Open Roassal examples for lots of examples for diagrams together with sources.

Open Moose -> Meta Browse for details on FAMIX.


The extractor is implemented in a single ABAP program that reads only informations about the code, but not the code itself.

 


Moose is implemented in Pharo. Pharo is an open source implementation of the programming language and environment Smalltalk. See the official project homepage Pharo - Welcome to Pharo! for further informations.


It is recommended to download Moose 6 and run it using Pharo 5 as there are more visualization options able than in Moose 5.

Tipps

  • Plan to invest some time in learning Pharo. It is cool software, but also different. I like to say "It is software developed by Aliens for Aliens". Many thinks work, but not always the way I expect.
  • Smalltalk uses three mouse buttons, left, right and middle. To start moose perform a left mouse click on the desktop and choose the Moose Panel.
  • To execute code, select the whole code and choose right mouse click "Do it and go". If not only the selected line is executed, this is in most cases leading to an error.
  • If part of a script are red: add declarations for small talk variables enclosed in | | at the start of a script. Example "methods := " methods is read. Add | methods | at the top. Small talk variables are not typed so stating the variable is sufficient.

Start

  • Install the program found on github. Choose either the ABAP 7.40 or ABAP 7.31 version. Export a model with the extension .mse.
  • Install Pharo 5 (Add the 4.0 Sources to the folder)
  • Download an Image of Moose 6 (You may store it at some other place)
  • Start the Pharo exe and choose the Moose image.
  • Click on the desktop with the left mouse button and choose the Moose Panel.
  • Import the MSE file with the icon in the upper right.
  • Click on the model. Click on all classes choose visualization -> Blueprint complexity.

What can be done?

The extractor is not yet in a status where it is sufficiently complete for most productive usages.See the requirement and issues on github for the actual situation.But basic information on methods, classes, interfaces and packages can now be extracted from SAP to Moose to learn and experiment.


Report issues on bugs or requests for improvements.


Fork the repository and start to improve the extractor.

What is planned?

Extract also non ABAP programs, like SAP BW data flows, ...

Thanks

I would like to thank especially:

Damir Majer for many helpfull discussing and especially for inviting Tudor Girba to the SAP Inside Track Munich 2015

Tudor Girba for many valuable informations and tips on how to use Moose and FAMIX

Enno Wulff for making a 7.31 version available and many discussions to improve the extractor and to give hints on what can be done

And all colleagues that made this tool possible!

Applying the Simplification Database - SAP Netweaver 7.50

$
0
0


 

Simplification for S/4Hana

 

If you are thinking about a migration to S/4Hana there are several migration or Helper tools available to understand the impact of such endeavor. One of the tools I would like to talk about is the simplification database SAP is provided with Netweaver 7.50 SP02. I will describe the necessary steps until you can see what is the outcome and the result of the tool.

 

Prerequisites

 

In order to use the new simplification database und respective reports you need to check whether your system contains all the necessary logic to extract the source code needed.

Got to SE38 and check if the program SYCM_DOWNLOAD_REPOSITORY_INFO or the package SYCM_MAIN and SYCM_ANALYSIS exists.

If the program does not exist, you need to implement Note 2185390 – Custom Code Analyzer. This will prompt or download approx. 15 other Notes. IMPORTANT BEFORE you start the Note Implementation you need to do the following manual steps (These steps will also be prompted when installing the notes).


Create Package SYCM_MAIN as a Sub-Package of BASIS (as an embedded Package):


bild 1.png

 

Once you have done this you need to create SYCM_ANALYSIS as a sub package of SYCM_BASIS


bild2.png


Now you can implement all Notes.

You should not encounter any problems implementing the Notes.

After completion just make sure that the program SYCM_DOWNLOAD_REPOSITORY_INFO exists and it should display as follow:

 

    bild3.png

 

 

How to run the extraction program

 

 

Refer to the original note where it is described how to run this program.

Your Namespaces should be automatically proposed if they are correctly maintained (as a producer namespace) in SE03.

 

bild4.png

            

Namespace /0CUST/ presents your ‘Z*’ or ‘Y*’ Objects – do not remove.

 

Make sure that only relevant Namespaces are selected to avoid unnecessary run times. Namespaces declared as Consumer Namespace are not relevant at this point.


Navigation Index

 

Make sure the Navigation Index is up-to-date otherwise you must run SAPRSEUx before running SYCM_DOWNLOAD_REPOSITORY_INFO. The following cancellation message will appear in your job log if the navigation index is not up-to-date.


bild5.png

 

Submit the program SAPRSEUx as a background job. We will run this program for our entire system. Refer also to the Notes mentioned in the Error Messages. The execution time is depending on your SAP system and this can run up 5 days!

 

 

Simplification Database

 

Before you use the simplification Database make sure that you have uploaded Version 2 of the Database. Use Program SYCM_UPLOAD_SIMPLIFIC_INFO to upload the Simplification Database, which you download from the sap market place (search Simplification Database). Only Netweaver 7.50 P02 is able to process it, there is no other version of the simplification Database.

 

 

 

Submit the Report:


Download scenario with an IDES 7.40 EHP7

 

The result of the download was

 

bild6.png

 

The Upload produced the following protocol

 

bild7.png

 

 

Executing the Simplification Report for larger Systems

 

Please check the parameter via Transaction RZ11 rdisp/max_wprun_time


bild8.png


If your value is still at 600 and you are trying to analyze a larger system this will probably not work because this program does not work in batch; it tries to output an ALV Display. We measured around 750 seconds execution time for the IDES system. This parameter can be changed in online if you have the appropriate authorizations.

 

 

Simplification Results IDES 7.40

 

The ERP 6.0 EHP 7 system contained (based on our analysis Tool – without Table Maintenance Function Groups)

 
  bild9.png

 

Simplification Report - Results

 

The report detected 4321 Simplifications available.


bild10.png


Well, it seems like an overwhelming number, but we but this into a visualization tool and here are the organized numbers.

Number of Notes (21) and their occurrences:

bild11.png

 

Affected Components (summarized 1st level):


bild12.png

javascript:;


By Simplification Category:


bild13.png

 


By Object Type:


bild14.png

 

Ok, we have analyzed an IDES system which might not reflect your environment but it pretty much tells us a story what will happen and what we need to do.


Furthermore, we have not yet checked , if the executable source code objects are even used in the productive environment. Our Benchmarks have shown that only 30-40% is used in today’s systems. That means: Get rid of all unnecessary Objects!!!



On the other hand, you can change your development rules. Everybody with the appropriate ERP version or Enhancement Pack can already switch to Eclipse as the development tool of choice. Yes, it is fairly new but the benefits will overcome the down sides of such an approach. Core Data Services(CDS) are essential for a future well performing system. This is a big rethinking to push application logic to the Database – but that is what comes along with Hana in order to reap the benefits.


Even if you find out that SAP has provided read-only views, Migration CDS´s, etc. – not looking at the notes might impact your performance and your new processes might be slower than in your ERP system.


The notes are extremely well written, clear to understand. But you really need somebody who takes care of those notes, looks at your system and knows what needs to be done.


New Developments should always be checked by Source Code Inspector (SCI), ABAP Test Cockpit (ATC) and SQLM (Integration or Production system) for correctly developed and performing applications or any other executable Object.

This is something you can do today!

There is really no good excuse not to do it, because if you do it right from the beginning the pain of migrating is largely reduced.


The tools, SAP provides, are more than sufficient to quality control your development inventory.



Addressing the simplification Issues

 

Of course we cannot address all Notes listed in the report. But we would like to pick Note 2215871 - Feldlängenerweiterung für Materialnummer - Datenmigration / Field length extended for the Material Number

This note refers to the fact that the material number has been extended to 40 Characters – today we have 18 characters.

If you choose to use the 40-character Material number following issues need to be considered:


Concatenated field content:

 

These type of fields you will find in BOR objects, Long Texts, Generic Object Services (GOS), Records Management, Workflows, BRFplus and Change documents. Archives will not be migrated.

If you use any fields like this in your own defined Tables, you need to do your own conversion programs.

This will of course impact any Function Calls (especially RFC Communication) using the material number, BAPI Extensions, Material Classification(VC). This is just an extract from all notes around the material number issued by SAP.

I believe the biggest Issue will be all Printing Functions (Goods Receipt Slip, Purchase Order Print, etc..).

Dynpro, Web Dynpro, Fiori and Odata Services need to looked at and probably adapted.

 

   

 

Usage Analysis

 

If you want to see Usage Data in your simplification Report, you need to do a few things upfront. Go to transaction CC_APPS and go to UPL control.

 

 

bild15.png

    

 

 

Activate the UPL control. This will allow you to see if objects are used or not used in your production system. This will spawn a collector job on your system.

If data was collected use CC_APP again and start UPL SHOW in order to see or download the usage data. Download it if you want include this information in your simplification report on the Netweaver 7.50.



bild16.png

bild17.png

Just keep in mind in order to get useful results the usage data should cover at least 6 month and best case 13 months. That means if you would like to use this function you need to start recording very early before you even try to evaluate your objects.

Integrating Usage Data from Netweaver 7.50

 

In Netweaver 7.50 go to Transaction SYCM -> Utilities


bild18.png

 

Choose -> Configure UPL Data Access


bild19.png


Maintain the RFC Destination, a description and the Date Intervals.

Depending on your Release or Patch Level and even importing all those notes the following Error Message might pop-up:


bild20.png


We have tested this with Solution Manager 7.1 and ERP 6.0 EHP 7 and in both cases it produced the same error. We are investigating.

 

We will continue providing you with useful information. Feedback is more than welcome.

 

 

 

DEV221 - Best Practices for Lowering TCO of Custom ABAP Code by Using CCLM Tools

$
0
0

With custom_code we, the abapdevelopers, support our business with our super power to develop software exactly to their current needs.

We want to be fast & flexible in innovation and adopt business needs as fast as they occur.

 

To do so we need an understandable, lightweight and robust code base in our systems .

 

Do you have it?

Do you have full transparency about your ABAP Code in your SAP system?

How many lines of custom code is in there, where it is and if it's used or not?

If this is the case, please tell me in the comments section how you were able to.

 

I have the pleasure to be one of the ten SCN speakers chosen for next SAP sapteched 2016 in Barcelona and I will have a lecture on this topic. (DEV221)

 

 

Why is the transparency of custom code important to someone like me?

 

I work as abap developer and software designer at bonprix Handelsgesellschaft mbH which is a SAP Customer with several SAP systems installed.

We use SAP Software to support our business delivering the best experience to the customer each day.

Constantly improving the rules and features of a System where it's not clear to you what is important & used often and what is never used slows down the achievable speed of improvements and raises the cost of maintenance for several reasons.

 

How do you know which part of your software is used or not used? Software we do not need can be deleted what reduces the tco of the IT what gives additional room for nice projects. Software that is highly used in your business should be as fast and robust as possible.

 

The goal is to have used, high flexible, robust, free of bugs software.

How we get to there?

 

 

cclm apps in SAP Netweaver will help you to analyse your systems software and start with a classification right on the spot

During my session DEV221 at SAP teched Barcelona 2016 I will show you how bonprix as customer of SAP software uses these tools.

You will see how to identify highly used an not uses code in the ABAP productive system without slowing it down noticeable.

Expensive SQL / often run statements will be shown. Using the tools to be explained SQL Statements an atc results will be combined.

You do not need additional licenses or installations. You can start right away lowering tco,  its all there ...

 

Do cclm apps provide the universal remedy - NO - but they hepl you to see where you are standing at the moment.

 

 

After you have learned in my session how to Identify the relevant code Gungor Ozcelebi will start show you in his session DEV222 how to fix issues in it.

SCN community - power to you!

 

 

We the SCN Community speakers

hope to see you at our sessions in Barcelona and we are looking forward for your feedback an discussions.

 

See you there

Timo

Viewing all 19 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>