SAP ABAP Quality

Life throws me interesting tasks. The other day I was thinking about ABAP code quality automation. There is a tool to control ABAP quality and it’s called ATC – ABAP Test Cockpit. Guess, we can setup system to verify ABAP code for quality in ABAP Code Inspector where we set rules for naming, code blocks, conventions, etc. We can ask the system to schedule code checks before any transport request moves forward to quality or production. The system will stop any transfer in case there are mistakes in code or even variables naming.

 

Testing ABAP Code in SAP

testing ABAP code in SAP (image owner/author is unknown)

Read More


Import LinkedIn Certificate into SAP

Many companies starting in implement different integations with interger services.

Let’s start with LinkedIn. We need to make a connection to LinkedIn API. To make SSL connection to LinkedIn we need to import certificate from LinkedIn into SAP system.

Firstly download certificate from web siteapi.linkedin.com
linkedin_ssl

Read More


Decoupled infotypes

Have you seen Decoupled infotypes branch in SPRO? Opened it several times, closed and opened again. No results. Looks really complex. Couple days ago I decided to make a move and figure out what’s that.

Main thesis’ are, which I’ve found in different sources:

  • PA20/30 works with both old and new technology. PM01 transaction creates infotypes with both techs. Also it knows how to migrate infotype.
  • Main advantage is decoupled infotypes more look like classic MVC programming model, where M = Model, V – View, C – Controller. Different levels of responsibility and strong communication between levels. It’s convenient model for developers.
  • For end users it means faster interaction, more speed, new glamour features like all data in one screen, fastest ad-hoc reporting in BW way and etc. HR renewals, let’s say.
  • Some ESS/MSS services don’t work with old infotypes anymore. You need to migrate. Globally SAP advise to start migration to decoupled infotypes right away.

Generally speaking what’s decoupled infotypes? It’s a way to save all data in transparent tables instead of packing them into something else like cluster tables. Just imagine how much time do you need to extract one wage types from cluster table (load everything, unpack all internal tables, loop through them for a record) or just do one select statement on indexed table? It’s times of time!


Infotype 0130

H.

I’ve decided to test procedures infotype 0130. It allows to restrict access to history records for some infotypes. You know that regular permission system doesn’t allow to manage access over the period. If you have access you can change record independently of its date. What if we need to restrict access in “closed periods”? Use infotype 0130.

Test procedure – subtype of 130’s infotype. Infotypes are assigned to test procedure. For example, “Time data” test procedure with 7, 2001, 2002, 2003 infotypes could restrict access to previous records. Just to avoid any changes in history.

Set AUTSW APPRO value in OOAC transaction.

The procedure itself is quite easy. It’s need to create 130 infotype with correct subtype – test procedure – for employees whom you need to restrict history data change. Let’s say it’s May 1st is entered into infotype. It means data before May couldn’t be changed for time infotypes (in case you set Time test procedure).

You’d better to use LSMW to create infotype 130.

To lock or unlock data entry in mass use RPTAPPU0 program.

Advice. To setup procedure don’t forget to add infotype 130 into P_ORGIN object in your roles. And split it by subtypes of 130 infotype. Everybody entering time data should have read access to 130 infotype. Administrator should have change access.


Positive time accouting

Positive accounting is a tricky thing. Seems to be easy – come in/go out – check in/out and everything should work fine, But.. Positive accounting is when time is registered by actual time worked in days or hours, with time events (in, out, lunch). There are special statuses in infotype 7th, special time evaluation schemas TM00, TM01. How does it work?

We’ve implemented positive accounting with biometric fingerstamps. When an employee comes he enters personnel number, swipe finger and time event is stored in SAP. 3rd party vendor collects time events, process them to avoid errors and post to SAP every 5 minutes. It’s performed with standard SAP interface PDC – PT80 transaction.

Read More


STVARV variables

Here is a deal. You can simplify users’ life with STVARV transaction. You can store variables in STVARV. Most developers are aware of this transaction while consultants are not. Convenience is in the ability to create variables, define their values and (bonus!) assign variables to fields in report variants.

Let’s say we create variable “Gross wages” where put all wage types referenced to gross income. Than we use this variable in all payroll reports in variants. Old style way is to define wage types directly in each variant in each report. In case you add even one wage type you need to adjust all variants for all reports. Nightmare!

New way is to create one variable, assign wage types and next time you need to add just one wage type to gross income you just do one change in STVARV and it works everywhere. Brilliant!

So…

Read More


Extending renumeration statement (PE51)

Hi!

Are you ready to break renumeration statement form. You can add your own fields in PE51 transaction that are lack in standard system.

You need to do three steps to add your field or table into PE51 form.

  1. Add structure definition into include RPCEDDZ9
  2. Fill that structure in include RPCEDSZ9
  3. Add that structure in PE51_CHECKTAB transaction.

Here is a note to help you with :) 320257 – HR-EDT: Print of customer-specific data and infotypes

And some examples: http://scn.sap.com/docs/DOC-40350


Standard payroll posting variant

Did you know that deleting “SAP” posting variant (V_T52E2 view) is a cause of system dumps? SAP support confirmed that.

Don’t ever delete this variant, just copy to yours and use it.


Customize HR Process Workbench (PUST)

Hi.

I hope most of you have heard about PUST transaction. This is convinient  tool to build payroll close process. It’s idea is a chain of steps build from programms that we use in payroll close procedure. We can set variants for each program, build them in a sequence and run all at once (or step by step autmatically). User all needs is to hit Run button and watch it. While it’s running it will show logs for each step/programm and user will understand possible issues with easy.

There is no need to explain all customizing in detail as it’s pretty simple. At first setup Workflow as some particular elements use it for notifications. To do this run though SAP Note 133182 – Process Manager: No process is started.  Program starts – event fires. Program stops – event fires. It allows to run several programms in parallel and use workflows for example to payroll agreements.

For a user it will look like.

pust_2

Read More


SAP Scripting

Small instruction about SAP scripting.

Activate SAP Scripting in GUI settings (SAP Logon settings).

Open SAP and hit “Record macro” in GUI menu. Run all needed steps and stop recording.

As a result you’ll get file with script. For example I’ve a script of creating 0015 infotype record:

If Not IsObject(application) Then
Set SapGuiAuto = GetObject(“SAPGUI”)
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, “on”
WScript.ConnectObject application, “on”
End If
session.findById(“wnd[0]”).maximize
session.findById(“wnd[0]/tbar[0]/okcd”).text = “pa30”
session.findById(“wnd[0]”).sendVKey 0
session.findById(“wnd[0]/usr/subSUBSCR_PERNR:SAPMP50A:0110/ctxtRP50G-PERNR”).text = “609”
session.findById(“wnd[0]”).sendVKey 0
session.findById(“wnd[0]/usr/tabsMENU_TABSTRIP/tabpTAB01/ssubSUBSCR_MENU:SAPMP50A:0400/subSUBSCR_ITKEYS:SAPMP50A:0350/ctxtRP50G-CHOIC”).text = “15”
session.findById(“wnd[0]/usr/tabsMENU_TABSTRIP/tabpTAB01/ssubSUBSCR_MENU:SAPMP50A:0400/subSUBSCR_ITKEYS:SAPMP50A:0350/ctxtRP50G-SUBTY”).text = “0030”
session.findById(“wnd[0]/usr/tabsMENU_TABSTRIP/tabpTAB01/ssubSUBSCR_MENU:SAPMP50A:0400/subSUBSCR_TIME:SAPMP50A:0330/ctxtRP50G-BEGDA”).text = “100914”
session.findById(“wnd[0]/usr/tabsMENU_TABSTRIP/tabpTAB01/ssubSUBSCR_MENU:SAPMP50A:0400/subSUBSCR_ITKEYS:SAPMP50A:0350/ctxtRP50G-SUBTY”).setFocus
session.findById(“wnd[0]/usr/tabsMENU_TABSTRIP/tabpTAB01/ssubSUBSCR_MENU:SAPMP50A:0400/subSUBSCR_ITKEYS:SAPMP50A:0350/ctxtRP50G-SUBTY”).caretPosition = 4
session.findById(“wnd[0]/tbar[1]/btn[5]”).press
session.findById(“wnd[0]/usr/txtQ0015-BETRG”).text = “11”
session.findById(“wnd[0]/usr/txtQ0015-BETRG”).setFocus
session.findById(“wnd[0]/usr/txtQ0015-BETRG”).caretPosition = 18
session.findById(“wnd[0]”).sendVKey 11

Then you can put this script as VBA macro into MS Excel, handle it in a right manner (i.e. make a cycle) and automate you regular tasks or data upload/ mass change.

Important: scripting doesn’t understand system errors, system messages. eCATT and SAP Personas understand.