Saturday, July 9, 2016

The cost of rewrite : Business Object

A business object requiring a change is a headache in project.

Lets say u need to add a new status field to an existing bean.

Run sql scripts and add these to migration scripts.

Then you have a completely new object. You must change all constructors.

Check member methods to change related member methods.

Check service methods.

Add tests to unit tests.

...

List is long. Often managers underestimate these kind of things.
"I only wanted one new field"
Maybe change seems simple but it breaks all former code.

Friday, July 8, 2016

Junior Idea : "Why do not we write a new program"

All juniors(including me) comes with the idea of rewriting the program in 1st month of employment.
And when they are rejected they are surprised.
They think they offer a better version but they were rejected :)

What one understands over time :

1)A full complete project running in an old language/style is much better
then an unknown version with new language/style.

2)Juniors are too fast to propose a rewrite. It is obvious that they did not see
whole system and is not aware of former problems.

3)A junior is a new worker. It is not certain how long he will work at
that place. So no company can depend on him.

Why projects fail?


In Programming world , you always see unsatisfied customers and developers.
After years of development I can understand a project will fail or not from beginning
if there are some signs like below.

1) Low price
Projects specs are announced and price is asked to companies.And then companies bid for lowest price.
What is lowest price? Can you afford to make a project will 2 juniors instead of 1 senior?
1 2 3 or whatever Junior is not one senior.
There is no replacement in programming.

2) Who knows the industry?
Programmers often underrate project domain. They think most important thing in project
is technical part. I never see a big project where domain knowledge is not important.
Programmers must respect domain knowledge and understand it as much as they can.

3)Unclear breakpoints.
At 1st stages people code fast and come to a stage.
At that stage ,customer says this is not what we want.

Will you continue with problematic logic?
Can you afford a re-write?

Program plan must have some milestones and specs to reply
these questions.



My simple rule for a project :

A project will fail or will be in a low quality :

If there is no one int the team who has done a technical similar project


Monday, June 27, 2016

SAP Hana Analytical Privilege for Team Logic



You have a context calculation view and want to implement a manager user who can see content of his team .

For this purpose you opened an Authorization table with 2 columns (KEY_NAME KEY_VALUE)


Table AUTH_OPINT

KEY_NAME KEY_VALUE
U1 U4,U5
   



According to this table U1 has a team consisting of U2 and U3 .

Your view has a column as approverid, which is the column for storing approverid.
By definition a manager user can see items he approved or items approved by his team.

We have entries at this table for defining our teams , so a query like below :
select KEY_VALUE from YOURSCHEMA.AUTH_OPINT where KEY_NAME = SESSION_USER

will bring "U4,U5"

instr is a function searching second argument in 1st, so
instr( "U4,U5","approverid" ) will return bigger than 1 if approverid is either U4 or U5



TOTAL SCRIPT

("approverid" = SESSION_USER ) or
(
instr( (select KEY_VALUE from YOURSCHEMA.AUTH_OPINT where KEY_NAME = SESSION_USER) ,"approverid" ) >= 1
)

SAP Hana Analyrical Privilege Implement Super User


You have a context calculation view and want to implement a super user who has access to all contents in cockpit.


For this purpose you opened an Authorization table with 2 columns (KEY_NAME KEY_VALUE)


Table AUTH_OPINT

KEY_NAME KEY_VALUE
SUPERUSER U1,U2,U3
   


According to this table U1, U2 and U3 are super users.
When you define below sql as dynamic sql

It will return 'SUPERUSER' if current SESSION_USER is a substring of KEY_VALUE ( "U1,U2,U3" ).



'SUPERUSER' =
(
SELECT KEY_NAME FROM YOURSCHEMA.AUTH_OPINT where KEY_NAME = 'SUPERUSER'
and KEY_VALUE like concat(concat('%', SESSION_USER ),'%')
)

Tuesday, June 14, 2016

SAP OPINT problem Failed to acquire scenario lock; either a background process is processing the scenario or another user is performing operations on the scenario:



when you try to generate a scenario on Hana Studio you get following error :

Failed to acquire scenario lock; either a background process is processing the scenario or another user is performing operations on the scenario:

You have to execute below Sql to delete locks by replacing .
Package Name is project name under contennt.
Scenario name is name of hprbusinessscenario file name.

If you are not sure about this name open table
"SYS_PROCESS_VISIBILITY"."sap.opi.pv::SPVD_SCENARIO_METADATA"
and search scenario_name and find full qualified name.


delete from "SYS_PROCESS_VISIBILITY" . "sap.opi.pv::SPVR_SCENARIO_DEFINITION_LOCK" where
"SCENARIO_DEFINITION_ID" in (
select "SCENARIO_DEF_ID" from "SYS_PROCESS_VISIBILITY" . "sap.opi.pv::SPVD_SCENARIO_METADATA"
t1 join "SYS_PROCESS_VISIBILITY" . "sap.opi.pv::SPVR_SCENARIO_DEFINITION_LOCK" t2 on
t1.SCENARIO_DEF_ID = t2.SCENARIO_DEFINITION_ID
where t1. "SCENARIO_NAME" = '' group by "SCENARIO_DEF_ID" )

Saturday, June 11, 2016

SAP OPInt , Reporting Logic for Workflow

In classical programming we have database which is a row based representation of data.
Rows point each other and we have complete logic in code.

In BPM programming we have flow at BPM and data is either at db or BPM engine.

Classical reports are aggregation of columns. Aggregations are
sum,average,count .... which is a summary data for mass data.

But our jobs are not consisting of aggregates. Jobs consist of task. So classical reporting does not show
anything about smallest piece of our job.

SAP OPInt is a reporting tool on tasks.
It shows you which tasks are at critical,
which processes are overdue.

It show your task flow and can predict completion time of tasks.
It enables you to take preemptive action about your tasks.