SAP SD: Activating Generic Object Services

 The Generic Object Services (GOS) offer functions that are available in all SAP SD sales transactions (like VA02/VA03, VA22/VA23, etc.).

With the Generic Object Services, you can …

  • Add attachments to a sales document
  • Send orders with a note to another user
  • Record a personal note about the document
  • Subscribe to order changes and e.g. receive an email in case the order is changed
  • Start workflows if available
  • Jump to IDocs that are linked to the sales document

SAP Generic Object Services in VA03

Activate Generic Object Services (GOS)

This button is available to a user once you activate the function with the user parameter SD_SWU_ACTIVE.

  • Start transaction SU3 (or SU01 if you want to set it for a different user than yourself)
  • Switch to the tab Parameters
  • Enter SD_SWU_ACTIVE as SET/GET Parameter ID and X as the Parameter value in an empty row
  • Save the changes

Activate Generic Object Services in Transaction SU3

Click here to find a more detailed explanation of how to set up and maintain user parameters.

Generic Object Services Missing In Create Transactions

Please note that the GOS button is only available in the SD create transactions (e.g. VA01, VA21, …) after implementing SAP note 2413663.

SAP Gateway: 33 Transactions You Need To Know

 

TransactionDescription
/IWBEP/CACHE_CLEANUPCleanup of Model Cache
/IWBEP/ERROR_LOGSAP GW Backend Error Log
/IWBEP/OCI_SRV_GENOData Srvc. Generator for OSCI
/IWBEP/REG_SERVICEMaintain Service
/IWBEP/SBSAP Gateway Service Builder
/IWBEP/SBSSAP Gateway Service Builder Setup
/IWFND/APPS_LOGSAP Gateway Application Log Viewer
/IWFND/CACHE_CLEANUPCleanup of Model Cache
/IWFND/CLEANUPExecute Cleanup
/IWFND/ERROR_LOGSAP Gateway Error Log
/IWFND/ERROR_LOG_E2ESAP Gateway Error Log - E2E
/IWFND/EXPLORERService Explorer
/IWFND/GW_CLIENTSAP Gateway Client
/IWFND/IWF_ACTIVATEActivate / Deactivate SAP Gateway
/IWFND/MAINT_SERVICEActivate and Maintain Services
/IWFND/MED_ACTIVATEActivate/Deactivate Metadata Cache
/IWFND/NOTIF_MONITORNotification Monitor
/IWFND/SERVICE_TESTService Explorer
/IWFND/STATSSAP Gateway Statistics
/IWFND/TRACESSAP Gateway Traces
/IWFND/V4_ADMINSAP Gateway Service Administration
/UI2/FLCFiori Launchpad Checks
/UI2/FLIAFiori Launchpad Intent Analyis
/UI2/FLPSAP Fiori Launchpad
/UI2/FLPD_CONFFiori Lpd. Designer (cross-client)
/UI2/FLPD_CUSTFiori Lpd. Designer (client-spec.)
/UI2/INVAL_CACHESGlobal Invalidation of UI2 chaches
/UI2/SEMOBJDefine Semantic Object - Customer
/UI2/SEMOBJ_SAPDefine Semantic Object - SAP
/UI5/THEME_TOOLUI Theme Tool
LPD_CUSTLaunchpad customizing
SEGWSAP Gateway Service Builder
SICFHTTP Service Hierarchy Maintenance

Change Transport Request Status from Released to Modifiable

 Sometimes it happens that customizing or development objects were assigned to the wrong SAP transport request. Or that a Transport Request was released accidentially.

Released transport requests (and tasks) are blocked once in status Released and can no longer be removed or modified. You may also want to delete the entire transport request. This option is also denied to you as soon as tasks are released.

For these cases SAP provides a report to modify the transport request status.

Change a transport task from Released to Modifiable

Start transaction SE38 and run report RDDIT076. Enter the transport request (not task) which status should be changed. Execute the report (F8).

SAP report RDDIT076 Selection Screen

In the transport request overview you will get a list of all assigned tasks and their release status.

Possible release status are:

  • D - Modifiable
  • L - Modifiable, Protected
  • O - Release Started
  • R - Released
  • N - Released (with Import Protection for Repaired Objects)

Double click on a task to display detailed information. In the bottom-right corner click Display <-> Change (or F9) to activate edit mode.

Change the Status field from R (Released) to D (Modifiable) and confirm. Repeat this step for the transport request of needed.

Once these changes are saved the transport request can be modified again.

SAP report RDDIT076 Change Transport Request Status

Possible side effects

However, the changing the transportation status carries some security risks. Changing the transportation statuscan lead to inconsistencies in the subsequent systems.

If the company uses an automatic, trigger-controlled or periodic import into the subsequent system, transport requests can be incorrectly marked as imported.

Imagine the following scenario:

  1. A transport request is released and the import into the subsequent system runs via trigger or periodically
  2. The transport request status gets modified in the development system. The desired change is made and the transport request released again.
  3. Since this transport request has already been imported into the subsequent system. The request is no longer recognized as a new or changed transport, since the transport has already been imported. All ubsequent changes are therefore not transferred to the subsequent system anymore.

SAP ABAP: The Best Performance Analysis Transactions

 

Transaction CodeDescriptionRelevant SAP Notes
DB01Analyze Exclusive Lockwaits
DB02Tables and Indexes Monitor
DBACOCKPITStart DBA Cockpit
RZ20CCMS Monitoring
SATABAP Trace
ST04DB Performance Monitor
ST05Performance Trace2482775
ST12Single transaction analysis2436955
ST22ABAP Dump Analysis
STADBusiness Transaction Analysis

Workload Analysis

Transaction CodeDescriptionRelevant SAP Notes
/SDF/MONSchedule Monitoring Set
SM04Logons to an AS Instance
SM21Display System Log
SM66Systemwide Work Process Overview
SMQRRegistration of Inbound Queues
SMQSRegistration of Destinations
ST02Setups/Tune Buffers
ST03Workload and Performance Statistics
ST03NWorkload and Performance Statistics
ST06Operating System Monitor
ST07Application monitor
ST14Application Analysis
STADStatistics display for all systems552845

A more comprehensive overview of performance analysis transactions with further information and details on how to use them can be found in SAP Note 948066.

This SAP note contains further SAP notes that cover the extensive topic.

Compare Customizing between SAP systems

 Transaction SPRO comes with some neat tools to check and compare customizing objets. With this function you can compare customizing settings (and tables in general) between two systems or clients. The result screen then shows differences in customizing.

Customizing / Table Comparison Transaction

Execute transaction SPRO. From the menu bar choose Tools > Customizing Objects > Object Comparison.

SAP Customizing Object Comparison

Alternatively, the transaction can be started directly via tcode SCMP.

Compare Customizing settings

First, fill in the table you want to compare. In this example TVAK is used. Second, select a RFC connection from our source system to the target system you want to compare. If no connection exists create it via tcode SM59.

SAP Transaction SCMP

There are a few more options on the selection screen:

  1. Enter selection requirements is useful if you want to restrict the table entries which should be compared.
  2. Display Differences only will only display differences.
  3. Background execution runs the comparison as a background job.
  4. Restrict fields to be compared enables you to select which fields should be compared.

Run the selection by clicking on Comparison or press F5.

The result screen shows the selected table entries and indicates by color and code if there are differences between the two systems or clients.

A legend is available via Ctrl + F8 or by clicking on the respective button.

SAP Transaction SCMP Result screen

How to execute a SQL query directly in SAP

 There are situations where it comes in handy to run a database statement directly, without the need for ABAP programming.

SQL Editor in DBA Cockpit

The DBA Cockpit comes with a SQL Editor with which you can easily execute your SQL queries on your SAP system.

  1. Call transaction DBACOCKPIT
  2. Open the folder Diagnostics on the left-hand side navigation tree
  3. Doubleclick on SQL Editor

SAP DBA Cockpit SQL Editor

How to run a SQL query

Queries are entered in the Input Query section. Change to row limitation to a suitable value for your case.

In this example, we want to get all Deliveries which are not assigned to a Shipment.

SELECT * FROM likp WHERE vbeln NOT IN ( SELECT vbeln FROM vttp )

SAP DBA Cockpit SQL Query

After hitting Execute (or pressing F8) you get the result directly on your screen:

SAP DBA Cockpit SQL Query Result

Other features worth mentioning:

  • Queries can be further analyzed by pressing Explain in the stats bar
  • Queries can be saved for future use

Required Authorizations

Following authorization objects need to be maintained for the DBA Cockpit

  • Authorization object S_TCODE for transactions DBACOCKPITSM49SM69
  • Authorization object S_ADMI_FCD for STOR and SMSS
  • Authorization objects S_TABU_DIS and S_TABU_NAM to control table access

SAP ABAP: Generate dynamic WHERE conditions from user authorization

 When was the last time you’ve read the documentation for the AUTHORITY-CHECK statement? In case you haven’t done it in a while as I did, you’ve probably missed the hint at class CL_AUTH_OBJECTS_TO_SQL which is available since ABAP 7.50.

Checking the authorization for a single value is easy. For example, if we only need to check if the user is authorized for a certain Sales Organization we can check with an authorization check via object V_VBAK_VKO:

AUTHORITY-CHECK OBJECT 'V_VBAK_VKO'
         ID 'VKORG' FIELD 'A001'
         ID 'VTWEG' DUMMY
         ID 'SPART' DUMMY
         ID 'ACTVT' FIELD '03'.

If there are multiple Sales Organizations to check there are usually two options:

  1. Select all available Sales Organizations in the SAP system. Then LOOP over the result set, do the authorization check and build a range table that contains all allowed Sales Organizations. This range will then be added in the WHERE condition of your SQL statement.

  2. Select the data first. Then LOOP over the database result, do the need authorization checks, and remove the data which the user has no authorization for from the result set.

The second option has the obvious disadvantage that eventually more data gets selected from the database than required. Even though in-memory database systems like SAP HANA are fast this should be avoided.

Class CL_AUTH_OBJECTS_TO_SQL gives some handy methods to achieve the first option with less coding.

Generate WHERE condition

First, we need to call the method CREATE_FOR_OPEN_SQL to get a new instance of CL_AUTH_OBJECTS_TO_SQL. Afterward, add the authorization objects to be checked via method ADD_AUTHORIZATION_OBJECT as shown in the below code example.

DATA(authsql) = cl_auth_objects_to_sql=>create_for_open_sql( ).

authsql->add_authorization_object(
  EXPORTING
    iv_authorization_object = 'V_VBAK_VKO'
    it_activities = VALUE #( ( auth_field = 'ACTVT' value = '03' ) )
    it_field_mapping = VALUE #(
      ( auth_field = 'VKORG'
        view_field = VALUE #( table_ddic_name = 'VBAK' field_name = 'VKORG' ) ) ) )
    it_filter = VALUE #( FOR selopt IN s_vkorg[]
      ( auth_field = 'VKORG' low = selopt-low high = selopt-high ) ) 
).   

TRY .
    DATA(where) = authsql->get_sql_condition( ).
  CATCH cx_auth_not_authorized.
    " Not authorized at all
ENDTRY.

The methods need to be called as follows.

  • IV_AUTHORIZATION_OBJECT Name of the authorization object to check
  • IT_ACTIVITIES Authorization fields and activities to be checked
  • IT_FIELD_MAPPING Field mapping to DDIC fields
  • IT_FILTER (optional) Filter to limit the values to be checked. For example, this could be based on a select-option from the selection screen to only check Sales Organizations the user wanted to select data from.

If the current user has no authorization for the specified object exception CX_AUTH_NOT_AUTHORIZED is thrown. The result of the method call is empty in case there is no restriction.

Let’s assume the current user is authorized to view the Sales Organizations S000 and S001. In this case, variable where would look like this:

( VKORG = 'S000' OR VKORG = 'S001' )

Dynamic WHERE in SQL statement

The method result can be used in a SQL statement like this:

SELECT ... FROM vbak INTO TABLE @DATA(vbak) WHERE (where).

SAP ABAP: Useful System Variables you should know

 In SAP ABAP several system variables can be used to influence program behavior or from which information can be obtained.

System variables are part of the structure sy which can be checked during debugging. A full list can be obtained from transaction SE11 for structure SYST.

The most famous variable is sy-subrc. This variable contains the return code which is set by many ABAP statements. In general, if the value is 0 (sy-subrc = 0) the statement was executed without problems.

Frequently used System Variables

System VariableDescription
sy-batchBackground Processing Active. Set to X if the ABAP program is running in the background
sy-datloLocal Date of Current User
sy-datumCurrent Date of Application Server
sy-indexLoop Index in DO or WHILE loops (starts from 1)
sy-languLanguage Key of Text Environment
sy-mandtClient ID of Current User
sy-repidName of the current ABAP program
sy-subrcReturn Code of ABAP Statements
sy-tabixRow Index of Internal Tables
sy-tcodeCurrent Transaction Code
sy-timloLocal Time of Current User
sy-unameName of Current User
sy-uzeitCurrent Time of Application Server
sy-zonloTime Zone of Current User

Parameter IDs are used for setting a default value for a particular field. The maintained value is then automatically filled in for you. It is still possible to override it manually. Adding default parameters will speed up your use of SAP by providing default values for commonly used screen fields. How to set a User Parameter Use transaction SU3 or the following SAP menu path to set parameters for your user. User transaction SU01 if you need to maintain parameters for a different user. SAP Menu Path User Parameter Switch to the Parameters tab. You will see a table with all maintained parameters. The table is sorted by parameter name alphabetically. SAP Transaction SU3 Overview New parameters can be entered in blank lines at the end of the table. After adding new entries click the save icon at the top of the screen (Ctrl + S). In this example, Parameter ID WRK (Plant) is maintained with a value of US01. This means that the default value for Plant fields will be US01 across all SAP standard transactions. SAP Transaction SU3 Maintain Parameter Modify an existing value by overwriting the existing value with the new value by clicking on the respective cell. Delete a parameter value by selecting an entry and clicking on the Delete button in the button bar above the table. How to determine the Parameter ID for a particular field In this example, we will get the Parameter ID for Sales Organization fields to set a default value. Start transaction VA01. Click in the Sales Organization field and press F1 on your keyboard. In the displayed popup press the button showing hammer and wrench. SAP Parameter Information in Transaction VA01 In the Technical Information popup, you will find the Parameter ID. For Sales Organization the ID is named VKO. SAP Parameter Sales Organization in Transaction VA01 Maintain the value as described in this article. Next time you call a transaction that displays a Sales Organization field it will be automatically filled with the parameter value. SAP Parameter Sales Organization populated automatically

 

Create a SAP GUI Shortcut

Click right on your Desktop and create a new SAP GUI Shortcut.

SAP Create new Shortcut

In case you don’t have this option just choose Text Document. Give the file a meaningful name.

Open the file in a Text Editor and paste below lines into it:

[FUNCTION]
Command=/H
Title=Debugger
Type=SystemCommand

Debugging Popup Screen

Drag and Drop the created file into the pop-up window to active the debugger mode. You should see the Debugging switched on success message in your SAP GUI Status bar.

SAP GUI Drag and Drop Debugger Shortcut

Press any button of the pop-up to continue programm execution. A debugger session will start in a new window.

How to maintain User Parameters in SAP

 Parameter IDs are used for setting a default value for a particular field. The maintained value is then automatically filled in for you. It is still possible to override it manually.

Adding default parameters will speed up your use of SAP by providing default values for commonly used screen fields.

How to set a User Parameter

Use transaction SU3 or the following SAP menu path to set parameters for your user. User transaction SU01 if you need to maintain parameters for a different user.

SAP Menu Path User Parameter

Switch to the Parameters tab. You will see a table with all maintained parameters. The table is sorted by parameter name alphabetically.

SAP Transaction SU3 Overview

New parameters can be entered in blank lines at the end of the table. After adding new entries click the save icon at the top of the screen (Ctrl + S).

In this example, Parameter ID WRK (Plant) is maintained with a value of US01. This means that the default value for Plant fields will be US01 across all SAP standard transactions.

SAP Transaction SU3 Maintain Parameter

Modify an existing value by overwriting the existing value with the new value by clicking on the respective cell.

Delete a parameter value by selecting an entry and clicking on the Delete button in the button bar above the table.

How to determine the Parameter ID for a particular field

In this example, we will get the Parameter ID for Sales Organization fields to set a default value.

Start transaction VA01. Click in the Sales Organization field and press F1 on your keyboard. In the displayed popup press the button showing hammer and wrench.

SAP Parameter Information in Transaction VA01

In the Technical Information popup, you will find the Parameter ID. For Sales Organization the ID is named VKO.

SAP Parameter Sales Organization in Transaction VA01

Maintain the value as described in this article. Next time you call a transaction that displays a Sales Organization field it will be automatically filled with the parameter value.

SAP Parameter Sales Organization populated automatically

SAP Fiori and SAPUI5: What is the difference?

 SAP Fiori and SAPUI5 are not the same. Even up until today both terms are mixed up, sometimes even interchanged.

What is SAP Fiori?

If you ask SAP, they summarize it as follows:

SAP Fiori is the UX of the Intelligent Enterprise that changes the way you work. It equips designers and developers with a set of tools and guidelines to create apps for any platform faster than ever – providing a consistent, innovative experience for both creators and users. SAP Fiori enables you to turn new ideas into great apps as quickly as the market demands.

SAP Fiori is the toolkit to ensure app development is in line with SAP’s UX strategy.

How does an action button look like? What color has the cancel button? Is “Cancel” the consistent wording or should it be “Reject”? When should I use this control?

All these design questions are answered by the Fiori Design Guidelines.

SAP Fiori Design Guideline for a Button

This speeds up your design process a lot. There is no need to discuss basic design questions. Almost all answers can be found in the Guides.

This leads inevitably to a more consistent design across all your Fiori applications.

SAP is currently in the process of applying the Fiori Design Language to all their technology platforms.

Fiori Design Principles

SAP Fiori is based on five key principles:

  1. Role-based Designed for the needs of the user’s business role
  2. Adaptive The same User Experience across all device types (Desktop, Phone, Tablet)
  3. Coherent UI Elements behave the same across all apps
  4. Simple The 1-1-3 design principle: One specific task for one specific user role should be accomplished with max. 3 levels of navigation
  5. Delightful Really just that. Neat design that is fun to use

With SAP Fiori 3, the as of today latest version of SAP Fiori, SAP provides design principles for iOS, Android, and web apps.

What is SAPUI5?

SAP User Interface for HTML5 (SAPUI5) is the development framework to build web applications that follow the Fiori design principles.

A SAPUI5 app is a web application that runs client-side in the web browser.

These apps are build using JavaScript, XML, and HTML5 and utilize other technologies like OData and JSON.

MVC Design Pattern

SAPUI5 is based on the Model-View-Controller (MVC) design pattern to give the application structure.

MVC Design Pattern Diagram

For UI5 apps the Model is usually an OData Model to consume OData Services provided by an SAP system.

The View part is covered by extensive UI controls that follow the Fiori design guidelines.

Model and View are getting their commands from the Controller.

Summary: Technology vs. Methodology

Whereas SAPUI5 provides a framework for web application development, SAP Fiori delivers the UX guidelines.

In theory, you don’t need SAP Fiori to develop a SAPUI5 application. On the other hand, it is recommended to follow the Fiori design principles to ensure a consistent user experience throughout all SAP business applications.

The Open Source version of SAPUI5, called OpenUI5, can be used by the public and is not limited to SAP customers.

SAP ABAP: Types Of Internal Table Declaration

 Declaring internal tables is an essential part of writing ABAP code as this is where most of the data will be stored.

ABAP knows the three table types STANDARDSORTED, and HASHED table. Each of these table types differs in the way they are declared, accessed, and changed during runtime.

The most simple type is the STANDARD TABLE. This works mostly like an array in other programming languages and can be used for a small set of data.

If the data should be kept in a specific order it is recommended to use the SORTED TABLE. During runtime, it is ensured that all table entries are sorted according to the defined table key. Be aware that it is not possible to add new entries with the APPEND statement .

For large sets of data that will be accessed via a table key, you should use the HASHED TABLE. Thanks to the hashed key entries can be retrieved fast and efficiently.

For the following declaration examples we use the local type ty_sales_order_item:

TYPES: BEGIN OF ty_sales_order_item,
         vbeln   TYPE vbeln,
         posnr   TYPE posnr,
         matnr   TYPE matnr,
         deleted TYPE boolean,
       END OF ty_sales_order_item.

Standard Table

  • Unsorted but can be sorted with SORT
  • Access via table index and table key
DATA: sales_order_items TYPE STANDARD TABLE OF ty_sales_order_item WITH DEFAULT KEY.

Sorted Table

  • Sorted according to the defined table key
  • Access via table index and table key
  • Fast key access thanks to binary search

Primary Key: posnr
Secondary Key: flag

DATA: sales_order_items TYPE SORTED TABLE OF ty_sales_order_item WITH UNIQUE KEY vbeln WITH NON-UNIQUE SORTED KEY delete COMPONENTS deleted.

Primary Key: table_line

DATA: sales_order_items TYPE SORTED TABLE OF string WITH UNIQUE KEY table_line.

Hashed Table

  • Access only via a unique key, no index
  • Each key value may only appear once, otherwise an exception is raised
  • Fast if all key fields are included

Primary Key: DEFAULT KEY

DATA: sales_order_items TYPE HASHED TABLE OF ty_sales_order_item WITH UNIQUE DEFAULT KEY.

Primary Key: vbeln

DATA: sales_order_items TYPE HASHED TABLE OF ty_sales_order_item WITH UNIQUE KEY vbeln.

Primary Key: DEFAULT KEY
Secondary Key: delete

DATA: it_hask TYPE HASHED TABLE OF ty_sales_order_item WITH UNIQUE DEFAULT KEY WITH NON-UNIQUE SORTED KEY delete COMPONENTS deleted.

Primary Key: vbeln, posnr
Secondary Key: deleted

DATA: it_hauksk TYPE HASHED TABLE OF ty_sales_order_item WITH UNIQUE KEY vbeln posnr WITH NON-UNIQUE SORTED KEY deleted COMPONENTS deleted.