Flipkart.com

Friday, September 20, 2013

My favorite books on SAP
1.SAP Certified Development Associate ABAP with SAP NetWeaver 7.02 This book is a must for ABAP certification. read more about it on my SAP certification Blog.

2. Design Patterns in Object-oriented ABAP
Learn Object Oriented Programming from this book
Unlike the other OOPs book, this one helps you to desing your solution based on typical practical problems. Learning it using the design patterns helps you to appreciate the OO concepts much better and helps you to use it in your everyday work.

3. Learn HR ABAP
This one is the latest book on HR / HCM ABAP and help you to get you ready working on HCM area

4. Practical Workflow
This book is form the Workflow Guru and can act as your working guide for workflow area. This also has a special page for Workflow Administration which is a invaluable guide working in Workflow support projects.











Thursday, May 10, 2012

Preparing for SAP HCM Certification


Personnel Administration

Personnel Area: 
Defaulting Payroll Area
Authorizations
Examples: Bangalore, Hyderabad, Chennai

Personnel Subarea
To specify country grouping
Country grouping is used for Pay Scale group and Processing of wagetypes
Groupings for Time Management: restricts Work Schedules, restricts Leave Types
Generate default Payscale Type and Payscale Area in IT8
Define Personnel subarea specific wage types
Public Holiday Calendar is assigned at this level


Employee Group
To default Payroll accounting Area
Default values in IT8
Authorizations
Examples: Active, Retirees, Early Retirees


Employee Subgroup
PCRs are defined at this level
Grouping for primary wagetypes: restricts validity of wagetypes for an employee group
Grouping for collective agreement provision: restricts Pay Scale groups for an employee group

Defaulting Payroll accounting area and other data entry fields




Other view

Payroll Accounting Area
Can be defaulted by Employee Subgroup

Payscale Group
Restricted by Employee subgroup grouping for collective agreement provision
Restricted by Personnel Subarea country grouping


--> Scenario for Plan version
Downsizing
Restructuring
Expansion
Outsourcing

--> While hiring, default values for Personnel Area, Personnel Subarea, Employee group and Employee Subgroup can be given by maintaining Account Assignment Features Infotype (1013) for the position.

Personnel Development

E-Recruiting

- Process starts when Requisition is raised. It can be raised by manager or recruiter.

Education Training and Event Management

Time Management is not directly integrated with OM.
All Qualifications are centrally stored in a Catalog

Qualifying Actions are grouped into Development plans

There are four main processes
1. Business event Preparation:  Creation of resources, Times schedules, Locations, Event groups, Event types
2. Business Event Catalog: Create actual events with dates/resources/locations
3. Day-to-day Activities: Booking attendance, cancelling attendance, Attendance
4. Recurring Activities: Booking events, canceling events, Locking and unlocking events

--------------------------------------------------------------------------------------------------

Multiple Actions on Same day
As we know Action infotype stores only one action per day.
Action Infotype also stores Employment Status, Special Payment Status and Customer defined status in it.

On any day, only one action that changes employee's status is allowed. The action which changes employee's status is stored in IT 0000 and the other actions get stored on IT 0302.

If there is a second action which changes employee's status is executed, then the original action will be overwritten.

IT 0302 does not have status fields.

Personal File (PA10) shows Actions and Additional Actions together.

--------------------------------------------------------------------------------------------------

PA-OM Integration is Active =>

--> "Position" is available in Action Infotype (PA40) screen
--> "Position", "Cost Center", "Job" cannot be edited in 0001 single screen

--------------------------------------------------------------------------------------------------

Personnel Subarea
--> Personnel Subarea is not available in IGMOD feature (Sequence of Infotypes screens within a infogroup)
--> Personnel Subarea is not available in NUMKR feature (Number Range)
--> Personnel Subarea cannot be used for authorization check.

--------------------------------------------------------------------------------------------------
ESG Grouping and PSA Grouping
Common groupings
  • -          Primary Wage types and Wage maintenance
  • -          Time Quota Types
  • -          Appraisals

ESG specific groupings
  • -          PCRs
  • -          Collective Agreement Provision

PSA specific groupings
  • -          Absence and Attendance types
  • -          Substitution Types and Availability Types
  • -          Attendance and Absence counting
  • -          Time recording
  • -          Premiums
  • -          Work Schedule
--------------------------------------------------------------------------------------------------
Allowance grouping is made of five components
Payscale type
Payscale area
Payscale group
Payscale level
ESG grouping for CAP

Allowance grouping is used to indirectly evaluate wagetypes.
 -------------------------------------------------------------------------------------------------








Tuesday, May 8, 2012

ABAPer's guide to SAP CRM

Let us explore SAP CRM from view point of a core ABAP developer

CRM Processes Supported
SAP's CRM software supports 4 broad processes
1. E-Marketing: Campaign, Customer Loyalty, Personalization, Store Locator
2. E-Commerce: B2B, B2C, Order-to-Cash
3. E-Service: Service order, Complaint, Status, Tracking, Payment, Feedback,
4. Web Channel Analytics

Technical Framework
BOL and GenIal are the two parts of CRM's technical framework. Genial (Generic Interaction Layer is a generic concept and BOL is a specific concept related to CRM)

BOL: Business Object Layer: This is where the data is modeled. It contains Structures, Associations, Compositions, Aggregations. I.e. BOL provides a consistent way of data modelling. At run time BOL layer holds data. There are seven different BOL object types.

GenIal: This is a Class which communicates between BOL and DB tables. Contains code which reads the business data and loads BOL objects. They are called as Genial classes.

CRM WebUI: CRM uses BSP technology for the UI. This component is called as CRM Web UI. Software component is BSP_WD_CMPWB.

SAP provides a sample package CRM_GENIL_SAMPLE which can be used for education purpose.

More on BOL:
BOL model can be viewed at Tcode: GENIL_MODEL_BROWSER
BOL Browser:  GENIL_BOL_BROWSER : Here you can test run various queries and operations provided by BOL

BOL can be any of 7 object type. Below is the list with an example each
A- Root Object                  : Order
B- Access Object               : Order Item
C- Dependent Object         : Shipment Data
D - Search Object              : Order Query, Order Item Query
E - Search Result Object    :
F - View Object
G - Dynamic Search Object

BOL layer is closely linked with the presentation layer. The BSP UI contexts are directly linked with the BOL objects.

More on GenIal:
The GenIal class specific to a business a scenario will inherit from root class CL_CRM_GENIL_ABSTR_COMPONENT. This class implements two interfaces, one for retrieving the model and other for getting the data.


Let us look at Sample Package to understand more



Thursday, November 17, 2011

Compare WebDynpro and Modulepool Architectures

To understand WD better, here is how I would compare WebDynpro architecture componenets with Module Pool architecture.

WD Component              ---->  Module Pool Program
WD Views                      -----> Module Pool Screens
WD Application (URL  )-----> Module Pool Transaction(Tcode)

Wednesday, November 9, 2011

SM30 / SM31 : Capture changes in a Transport Request

Hi friends,

Objective: You have created a custom table and want to ensure that any change happens to the table entries should be captured in a customizing trasnport request.

Solution: One of the option is to manually add the entries into a transport request. This can be tedious if you have to do it repeatedly. Instead you can make the system to ask for transport request every time a change is made.

To make this, go to the table maintenance generator.
In the below part of the screen, select "no, or user, recording routine". Save your table maintenenace generator. Now, whenever you change entries using SM30 or SM31, a transport request will capture the changes.

Have a nice day. :-)

Tuesday, August 16, 2011

SAP Workflow Interview Questions & Answers

What are the different types of WF Agents?
1.Possible Agents
Users who are authorized to execute the task
Configured during Task definition (Org Unit, Position, User, Work Center, Role, Rule)
If a Task is configured as General Task, then all users become possible users.

2.Responsible Agents
The users to whom the work item needs to be sent.
This is set during Step definition. Note that Possible agents are defined during Task definition. (Org Unit, Position, User, Work Center, Role, Rule, Container Element)
Note: The work item recipients is determined by intersection of Possible Agents and Responsible Agents.

3.Actual Agents
Actual user who executed the dialog task

4.Excluded Agents
Users who are not supposed to execute the dialog task (even if they are in possible agents)

A very good Book for learning and Practicing Workflow

Practical Workflow for Sap 2ed

What are the agent determination techniques?
    Rule Resolution with responsibility: Helpful when a set of static positions are responsible for action.
    Rule resolution with Function (FM): Helpful when agents are determined dynamically from business logic.
    Rule resolution with OM: Usually used in CRM. Have not used
    Rule resolution with Function, but asynchronously: This is through a class and a method. Initially WI is created in status ready without agent. Later agent is assigned. This is suitable for agent determination having complex logic.
    Users: Rarely used.
    Role: Ex: ABAP_DEVELOPER
    OM objects (Position, Org Unit, work center)
    Expression: A container element containing the agents.

Containers
    Workflow Container:
    Task Container:

SWC_GET_CONTAINER
SWC_GET_TABLE
SWC_SET_CONTAINER
SWC_SET_TABLE

Event Container:
Method Container:
Rule Container: For resolving rules

Business Objects
    Key Fields:
    Attributes:
        Database: Automatically gets populated by system code
        Virtual: You determine the content and use SWC_SET_CONTAINER to populate
    Methods: Can be created using FM, Transaction, Report, Dialog Module, Other
        Synchronous: Finish execution before handling the control back to the task.
        Asynchronous: Return the control back immediately. Cannot have export parameters. They depend on events to return results back to the calling program.

Dialog: Something to user
Background: Cannot have messages or exceptions


What are the options to implement method of a BO?
    FM
    BAPI
    Tcode
    Dialog Module
    Report
    Other (BO program)

How to extend a BO?
Got SWO1 and enter a BO that you want to extend. Click on ‘New Subtype’ Give all the details.
Go back to SW01, enter the BO, and goto Settings Delegate.
Example:
BUS7051: Notification,
BUS1001: Material,
BUS2012: Purchase Order,
BUS1065: Employee

Various status of BO
    Modeled: Not accessible at runtime
    Implemented: Not ready to be used, Internal use only
    Released: For customer to use
    Obsolete: Don’t use anymore

 To change attribute values from methods of a BO
    SWC_GET_CONTAINER
    SWC_SET_CONTAINER

Events:
How to create Events?
        HR Tables: SWEHR2/3
        ABAP Code user Exit: SWE_EVENT_CREATE
        Change Document: SWEC
        Status management:
        Message Control:
    Event Linkage: SWE2

Subtype:
Key field cannot be created. Methods and attributes can be created.

Delegate:
    If you want to change the functionality of a method, define a sub type, redefine the method, delegate the parent business object to child object.
   
Interface
    Interface is a combination of Attributes, Methods and Events, to reduce the redundancy in definition.
    IFSAP: Common interface for all BOs. It has following methods
        Method: Display
        Method: Existence Check
        Attribute; ObjectType

Different Workflow Steps activities
    Condition:
    Multiple Conditions:
    Until Loop:
    Fork:
    Send Mail:
    Container Operations:
    Event Creator:
    Wait Event:
    Process Control

Different deadline conditions
    Requested Start: When this date is met, only then the work item will start execution, or available for taking action (dialog).
    Latest Start: When a date mentioned here is met, it can send an email, or can be modeled to do something action.
    Requested End: Same as Latest Start
    Latest End: Same as Latest Start

Important Tcodes
    Workflow Toolbox: SWUS
    Simulate Event: SWU0
    Business Object Repository: SW01
    Event Trace: SWEL (S)
    Workitems per task: SWI2_FREQ
    SWUE: Event simulate
    SWEL: Event log
    SWELS: Set event log ON
    SWE2: Linkage between Event and Workflow
    SWEHR2: Event linkage in HR
    SWU3: Workflow customizing
    SWU_OBUF: Synchronize buffers
    SWI5: Look into other user’s SBWP
   
What are the Important background Jobs for workflow?:
    SWWDHEX          For deadline monitoring
    SWWERRE           For error Monitoring
    SWEQSRV           For Event Queue Delivery
   
Workflow experience:
    What are the workflows created by you? Worked upon by you?

Function Module that creates workflow
    SAP_WAPI_START_WORKFLOW:
    SAP_WAPI_CREATE_EVENT
    SAP_WAPI_WORKITEM_RECIPIENTS
    SAP_WAPI_GET_WORKITEM_DETAIL

When a infotype action is performed, an event should trigger, and a workflow subsequently. How can I configure it?
    Answer: Tcode SWEHR2

When a infotype action is performed, an FM should trigger, and a workflow subsequently. How can I configure it?
    Answer: Tcode SWEHR2

Workflow is not triggering... what can be the reason?
    What are the different ways of triggering a workflow?
          Triggering Events, which are set up in SWE2 (generic), SWEHR2 (HR)
    SAP_WAPI_START_WORKFLOW

Workflow triggered, but it did not come to the user, why?

What are the difference between a Business Object and a Class?

How to achieve dynamic parallel processing?
    There are three ways a parallel processing can be implemented
        Dynamic parallel processing using a multi-line container element
        Fork (3 out of 5)        Work queue
    In dynamic processing the type of each entry in the table have to be of same type.
    Same task will be processed for each line of the multi-line container. It can be a dialog or background task. Deadline monitoring, binding, agent determination will be same for each work item generated To achieve, go to “Miscellaneous” in the activity, and enter the multi line container element.


How to notify a user immediately in R/3 that he has got an email?
    Mark the priority as ‘1’ Express

How can we debug a workflow?
        If it is a dialog task, you can set breakpoint in the method called by the task
        If it is a method that you want to debug, use SWO1, and create a instance of the object and debug the methods
        If it is a background task, and you are in development client, you can do the following. Create an infinite loop in the method you want to debug. Go to SM50 (processes overview) and select the relevant item, and select debug from option.

Huge number of events is getting created in a short duration of time, and thus creating a huge load on the system and making it very slow. Solution?
        Enable event queue. It will ensure that triggered events are received in a phased manner. This needs to be done while providing event linkages.

Why ‘Process Control’ is used? What are its features?
    ‘Process Control’ is used to manipulate another work item of the workflow during runtime.
    ‘Process Control’ is usually used to model the workflow when deadlines are reached. SAP offers 4 standard behaviors as part of process control.

Cancel Work item: Target WI is logically deleted. Subsequent tasks are not executed. Precondition is that Process control and the target WI have to be in different branches of the same fork.
Set Work item to obsolete: The target WI is set to complete, and processing continues in the branch processing obsolete.
Cancel Workflow: Current workflow is set to ‘Complete’. If this is the sub workflow, then the control goes to super-ordinate workflow.
Complete (terminate) Workflow: Same as above, but the branch of super-ordinate workflow which contains the current sub-workflow will not be continued.
Cancel Workflow including all callers: Same as above, but all callers also will be ‘COMPLETE’d.

What is the integration point with ESS Portal?
Tcode SWFVISU
Portal config file for UWL

What are the types of work items?
    Dialog Work item - W
    Background work item
    Workflow work item
    Work queue work item
    Missed deadline work item: When a deadline is missed a missed deadline workitem with the message appears in inbox
   
What are the different statuses of a work item?
    Waiting
    Ready
    Reserved
    Inprocess
    Executed (‘confirm end of processing’ in task definition)
    Completed
    Logically deleted
    Error
   
Difference between Asynchronous and Synchronous methods in a task
    A work item created as part of synchronous in locked until end of the method execution. But in asynchronous, work item is locked only until start of method execution.
    At least one terminating event is required for a task using Asynchronous task

What is the use of secondary methods in an Activity?
          A modal call
          Before work item executing
          After work item execution

What is the BO method called for the task which calls UWL WD screens? Why?
EXTSRV --> PROCESS

What are Programmer exits? And why are they used?

What is the use of “Advance with dialog”?
If this indicator is set for an activity, workflow system checks if the processer of current task is also a recipient for next task. If yes, then the next task will be executed immediately.

-----------To be continued--------------------

Meanwhile this is a very good book if you want to learn and practice workflow. The workflow Admin chapter is invaluable if you are working in a support project.

Practical Workflow for SAP

Tuesday, August 2, 2011

Hacking SAP (Ethical :) )

YOU ARE RESPONSIBLE FOR ANY LOSSES ARISING OUT OF USING ANY OF THE BELOW CONTENT. USE IT IN YOUR OWN DISCRETION

In my understanding hacking is nothing but getting access which you are not supposed to get. Here I explain various ways of getting access to various things in SAP. This is also an education to SAP Security team, andd they can analyze these loopholes. That is why I call it ethical.

Ensure that you use these techniques only in your development or test systems. Never try in Production.

Execute a unauthorized Tcode ? Use SA38
What will you get?
To execute a Tcode for which you do not have access

What do you need to have? 
Access to Tcode SA38,
This applies only to Report Tcodes, not to Module-pool Tcodes

How to do it? 
Login to any system where you have access to the target Tcode. (Example : AL08)
Go to System --> Status and find the name of the program which is triggered by your target Tcode.
Now go to SA38 and execute this program. In this case it is RSUSR000. This hack works because there is no authorization check inside the program. Rather the check is at Tcode level.



What is the trail?
Unless you are monitored using system trace, there is no trail you will leave behind.


Updating contents of a table (SE16 - Classic debugger)
What will you get?
- You can create/edit/delete table entries using SE16. This hack makes use of earlier ability available in SE16 to create/edit/delete entries. 

What do you need to have? 
- SE16 access
- Change access in debug mode

How to do it?
Go to SE16 -->Display and select the entry you want to delete/edit/copy -->switch on the debug mode -->Press F7 --> Switch to Classic debugger (from menu 'Debugger')-->In the classic debugger press F7 -->You see below screen.

Now change SHOW to EDIT and press F8. You are in the edit mode now. Similarly you can Edit/delete/create entries.


What is the trail?

Unfortunately this does not leave any trail. So impossible to detect, unless trace is set on the performing user.


Any authorization you want temporarily? table USRBF2
What will you get?
Any authorization you want. It will remain for around 2 to 3 hours. 


What do you need to have? 
Change access to table USRBF2

How to do it?
Find out the authorization object required by you.
Create an entry in table USRBF2 using debugging access.

What is the trail?
Entry in this table will say that you have the access. But this entry will get deleted after 2-3 hours.
System trace will show that you get the access due to this table.

Want SAP* access? Table USREFUS
What will you get?
SAP* access, that is ALL the access is the system


What do you need to have? 
- SE16 access
- Change access in debug mode

How to do it?
Create an entry like below using the debugging access in SE16


What is the trail?
- Entry in the table will mean that you have the access. The access will remain as long as the entry remains.

Hope you enjoyed!
-KK

Monday, August 1, 2011

Huge SELECTs reuslting in Time out: What is the solution?

 I have an SQL statement which is timing out. It uses primary key and all usual options of tuning have been tried. What do you suggest?


Cursors with “Package SIZE” are useful to avoid time-out issues while fetching huge number of records.

A SELECT statement transfers entire result set into the application server. Where as when CURSOR is used with PACKAGE SIZE, only the number of rows mentioned in PACKAGE statement is copied in one go.

For example if your result set has 5 million records, using a SELECT statement would time-out. This is because in one database fetch, all 5 million records would be tried to transfer into the application server, thus timing out.

But if I use a CURSOR with 10,000 as package size, there would be 500 database fetches, but there would not be any time-out since only 10,000 records will be fetched in one go.

But, yes, there is a sacrifice we have done due to 499 extra fetches. What if we use a package size of 1 million?

Thursday, July 7, 2011

Enhancement concept in SAP

SAP Provides five types of enhancement techniques. These are the ways to deviate/enhance from the SAP provided code/logic.


User Exits: The first type of modification/enhancement technique introduced by SAP. This is predominantly available in SD module and very rare in other modules. This is in fact a modification to SAP code, hence needs "Access Key".Through user exits changes can be done only to code (thus business logic), not to screens or menus. SAP provides empty FORM - ENDFORM routines, in which programmer can write his code. You can search for a user exit in a program using the key word "USEREXIT"

Customer Exits: This was the next type of technique provided by SAP after user exit. This is available generally in all modules. Unlike User Exits, this is not a modification, hence you do not require an access key to implement it. In addition to code changes, you have option to enhance screens and menus as well. SAP provides Z includes which get called by standard code. Programmers write the code in this Z include. You can search for a customer exit using the key word "CALL CUSTOMER"

BADI (SE18) 
BADI is a relatively new enhancement concept based on OOPs. BADI’s are predefined with an adapter class. Developer’s will create an instance of the adopter class of the BADI.
BADI will have a standard interface which describes the methods and parameters. A custom class needs to be created which will implement this interface.

Finding a BADI
a. In Status -> Program search for CL_EXITHANDLER
b. SPRO -> Business Add in

Multiple implementations possible? (SE19)
a.      You can make create implementations based on filter values. For Example, each country you can create different implementations. The filter value should be linked to a data element which should be linked to a domain. The domain should have fixed values.
b.      While defining if you select checkbox ‘Reusable’, then multiple implementations can be created and multiple implementations can be active and called. Else multiple implementations can be created but only one will be active anytime.

Enhancement Spots:Explicit and Implicit enhancement points
Implicit are available for all SAP programs at specified generic places. For example, After/Before all standard selection screen declaration, after all subroutines implementation, end of reports, beginning of FORMs, end of FORMs etc.
An enhancement spot can be two types. 1. Code 2. BADI
Explicit are SAP provided hooks/places where custom logic can be written.  (In addition to Implicit) Two types, SPOT and SECTION

Tuesday, July 5, 2011

PA and OM Integration

Hi friends,

PA-OM integration is one of the complex issues or one of the most 'problematic' issue in SAP-HR. Let us look at usual 'problems' and solutions.


--> 
Problem: Updating infotypes Planned Compensation (1005), Account Assignment (1008) and Emp Group/Subgroup (1013), is not flowing into Org assignment (0001).
Solution: These three OM infotypes are used to default values or propose valid values for the OM objects. These values can always be overwritten in the PA side. When the integration is active, and the data entered in PA side do not match with the valid/default values mentioned in these infotypes, a warning message will be shown at PA side, and you can still overwrite it.
As we can understand, with the above functionality, these OM infotypes cannot be expected to flow to PA. See the similar explanation in SAP Note 1429161

-->
Problem: The Position/Org unit description were changed in infotype 1000, but the same are not reflecting in IT0001
Example scenario:  Infotype 0001 is from 1/1/2011 to 31/12/9999. The position in this infotype has a record in infotype 1000 from 1/1/2011 to 31/12/9999.
Now I am going to PP01 and changing the name of the position from XXXXX to YYYYY effective 15/01/2011 and expect this to reflect in infotype 0001.

Solution:
--> Any change in to OM attributes do not automatically flow into PA (even with RHINTE*). In such cases it is better to create a record from the same effective date in PA as well (i.e. 15/01/2011). In that case the new changed attributes will be shown in PA side.

-->
Problem: When bulk updates happens through BDC/LSMW integration does not happen, and we have to run RHINTE* reports for the integration to reflect.
Solution: When bulk uploads and BDC sessions, integration is switched off. SAP clarifies this in SAP note as well So after such updates you need to run the RHINTE* reports.



-->
Problem: When few updates happen through ABAP code using standard FMs, integration to other module does not happen (Ex: RH_INSERT_INFTY, RH_CUT_INFTY_1001_EXT)
Solution: Ensure that in such FMs, vtask = 'D'. That is update happening in dialog mode.

Tuesday, June 14, 2011

Comparing "Function group" and "Class"

Function group is considered to be the closest to the OOPs concept in procedural programing. Knowing similarities and difference between "Function group" and a "Class" can help us understand more about OOPs.

Let us look at similarities
- Like a Class, FG too has attributes and methods (FMs)
- The attributes of a FG can only be accessed through FMs. That is data declared in a FM is global to its methods, but not accessible by FMs of other FGs. Similarly, in a class, its private attributes can only be accessed through its methods. This ensures consistency of data.


Now let us look at the differences
- In a Function group
Variables(attributes) are always Private
Function modules are always Public.

- When a FM is called, an instance of FG is created and the FG attributes are loaded into internal session memory. If you call another FM of the same FG, or call the same FM again, no new instance of FG is created. You have only one instance of the FG. That is an ABAP program can work with several instances of a same class (objects), but it cannot work with several instances of a FG.


Note: Because of the limitations of FG, it is more often used as a modularization technique not as a OO technique. I.e. A programmer rarely uses a FG to declare variables, rather he declares local variables inside a FM. So data gets stored in the calling program and FM is just used to manipulate it.

I will not compare the other OOPs concepts with FG, since FG does not provide any comparable abilities. Hope this article was useful. Let me know your comments.

Tuesday, April 12, 2011

Hiding repetitive 'Top of Page' and column headers in spool output of a report

Hi team,

Scenario: You run a report in background and get the output in a spool, and you have output spanning multiple pages. Since the spool output has multiple pages, there will one page header and one column heading for each page.


Problem: When you download the spool into an spreadsheet, spreadsheet will have multiple headers and column headings, which is unnecessary in the spreadsheet hence needs to be cleaned up. This is a manual intervention and clients usually do not want it.

Requirement:  Spool to have only one 'top of page', and only one column header.

Solution 1: When you schedule a report in background mode, you will be asked to enter  a dummy printer, which will also ask the format of the output.

Click on Properties,

Note: I have entered 60000 in rows column. That means that spool will create one page for 60000 rows. hence there will be only one Top-of-page and only one column header for 60000 rows. 60000 is the maximum limit with this solution.

Solution 2: 
This solution is at "Top-of-Page" event.   
Here is the code.
if sy-pagno EQ 1.
  Call the top-of-page event code.
endif.

Saturday, March 19, 2011

Error messages in ESS Leave application

Hi friends,

Leave is one of the most commonly used application in ESS.
Standard error messages in ESS Leave application are too technical and average user finds it tough to understand. It is very important to review different error, warning and information messages and make changes to them to make them user friendly.

There are two options.

Option 1: This is the easiest option.

Personnel Management -> Employee Self-Service->Service specific Settings->Working Time -> Leave Request -> Processing Processes-> Configure Output of messages
Here you need to mention the message class, message type and message number of the SAP standard message. Next you need to mention the intended behavior in next columns. If you want to suppress the error message completely, click the check box "Do not show message". Else if you want to show a warning message instead of a error message, you can enter message type and needed custom message class and numbers as well.

Example: In the below example, "Payroll are IN locked" error message is suppressed. (Error message is in German)





Option 2. : If you need complex changes, you can use Enhancement Spot (SE18)
PT_GEN_REQ, method MODIFY_APPLICATION_MESSAGES
Note that only one implementation of this Enhancement Spot is possible. Hence check for existing implementation of the Enhancement Spot in your system.

Tuesday, March 8, 2011

Logical Units of Work in ABAP, (LUWs in SAP)

LUWs are one of the least understood concept in ABAP, even by experienced ABAPers. More over it is one of the most important concept in ABAP.

Knowledge of SAP Transactions, SAP LUW and Database LUW is crucial in ensuring that your database updates does not result in inconsistent data.

Let us take an example: 
Consider a Transaction (ABAP program), where intention is to Debit Rs 50 from account A, and credit those Rs 50 into account B.
Say debit from account A is successful. But when there was a credit of Rs 50 to account B, an error happens hence crediting did not happen. Bust as you have noticed, debiting from account A is already odne, and now this Rs 50 is lost. ( Neither in Account A, nor in Account B )

Transaction: An application transaction, possibly containing multiple screens, where multiple tables need to be updated.


Database LUW: System's approach of updating database. Either an update happens completely or does not happen at all. System has fixed rules, based on which a DB LUW ends/starts.

SAP LUW: A series of logically related updates. Ideally an SAP LUW should contain only one DB LUW, to enure that data in consistent. If a SAP LUW is spread across several DB LUWs, it can result in inconsistent data.

Rules related to Database LUW
Current DB LUW ends, and new one starts:
1. While moving form one screen to another screen (as soon a dialog step completes).
2. While calling a RFC
3. While exiting from and RFC
4. When encouters a WAIT statement
5. When any message is sent to dialogue. (Information, warning, error)
6. When COMMIT WORK statement is encountered
7. When function module DB_COMMIT is called.


Example of defective programming.
<-------------------------------SAP Transaction----------------------------------->
<---------------SAP LUW-------------><-------------SAP LUW----------------->
<--DB LUW--><--DB LUW--><--DB LUW--><--DB LUW--><--- DB LUW-->


Example of right programming technique.
<-------------------------------SAP Transaction----------------------------------->
<---------------SAP LUW-------------><-------------SAP LUW----------------->
<--------------DB LUW---------------><-----------------DB LUW--------------->

Why cant I use ROLLBACK statement?
ROLLBACK statement scope in only within a DBLUW. I.e. only the changes done within the current DB LUW will be undone. Changes done in previous DB LUWs will not be undone.

How to ensure that an SAP LUW contains only one DB LUW?
There are two approaches
1. Using CALL FUNCTION  ............... IN UPDATE TASK statement.
2. Using PERFORM ....... ON COMMIT statement.

Other approach
This approach can be specially used/needed in HR Function modules.
Example: Creating a Org Unit and relationships. Requirement is that either Org Unit and all its relationships should get created, else nothing should get created.

In this approach we use FMs that provide option to handle buffers. These FMs have an import parameter VTASK, If VTASK is passed as 'B', update will happen only in buffer, not in DB. Once all update FMs are called with VTASK = B, call the FM RH_UPDATE_DATABASE to update the database.

Hope the article was helpful. Please let me know if you have any questions or comments.

Wednesday, January 5, 2011

Another experience of SAP Certification Exam - ABAP C_TAW12_70 SAP

This experience was contributed by fellow blogger and reader Noha Salah. Thanks Noha for sharing.

Here it is.
-----------------------------------------------------------------------------------------------

I studied mainly from the TAWs, I mainly used this book Use this if your are in US and other countries where Amazon is available. (Search in Amazon) with the topics that were only in TAW 11 which is an online course & unavailable on the internet.

If you are in India, use the flipkart link Search In FlipKart

I also checked practice questions on codeexcellence.com

In the exam I spent the first 10 minutes surfing a tutorial that guides me through the rules of the exam.
The passing score was 52% and appears at the beginning of the exam.

The questions weren’t like any sample questions I practiced before. They mainly need someone who has a good understanding of all the topics of the syllabus to solve them correctly.

General notes on the questions:
1-      I was asked about Update Modules in SQL includes.  2 q’s
2-      I was given a case in web dynpro to analyze it about inbound & outbound plugs.
3-      I was asked which table type doesn’t take into consideration the number of entries (Hashed)
4-      I was asked about inner joins & help views.
5-      The adv. Of Unicode.
6-      In Abap debugger you could: Change contents of internal tables & structures
7-      Foreign key table & check table questions given a case.
8-      Events in ALV grid control
9-      Field Catalog can do what?
10   Workbench usage: difference between navigation area and tool area
11   Concentrate on : Netweaver overview, Internal table definition & usage, Table relationships,
SQL stmts & inclusive update strategies.
I hope this helps.

Sample Q’s

1.   During debugging a program you can find that only in certain constellations an error application watchpoint could help you inn
A.            Several watchpoints can be combined with AND or OR
B.            A watchpoint can be deferred in abap editor via the menu path Goto-> create watchpoint
C.            You can create watchpoint only from within debugger.

2.   you want to add some fields to standard SAP table using Append. What do you hav to keep in mind about this technique.
A.            The field of  append must start with ZZ or YY.
B.            Append structures are not possible for tables containing a long field.
C.            Appen structure must be compared with the SAP original in a release upgrade.
Answers are: A,B

 3.  AN SAP programmer has written a standard program in a way that it can call customer coding. What want to implement this coding . what is this technique called?
A.            Personalization
B.            Modification
C.            Correction
D.            Repair
E.            Enhancement
Answers: E

4. What kind of enhancements badi provide?
A. screen
B. menu
C. functional
D. Data element
E. table
Answers : A,B,C.

5. you want to write an ABAP prog. That makes use of the SAP GUI. Which of the following UI types can you use?
A.            BSP
B.            Selection screen
C.            Classical screens (ALV)
D.            ABAP Web Dynpro
 Answer :  C,A

6. which view type allows a read access?
A.            Projection view with one table.
B.            Database view with more than one table.
C.            Maintenance view
Answer: B

7. why doesn’t SAP recommend standard SAP Programs.
A.            To avoid performance problems.
B.            To ensure smooth support.
C.            To protect SAP’s intellectual property.
D.            To simply upgrades to the new release.
Answers: B,D.

8. you detect an error in the standard SAP Prog. You need to correct this error in your development system and transport in to your system. What is this called?
A.            Modification
B.            Hot fix
C.            Repair
D.            Support package.
Answer: A

9. you want to implement BADI hat provides functional enhancements. What do you need to do?
A.            Create a enhancement project with CMOD
B.            Define an interface for BADI
C.            Implement a class which implements the BADI interface.
D.            Call the BADI.
Answer: C
------------------------------------------------------------------------------------------------------------
Here is another experience of ABAP Certification Exam
http://learnhrabap.blogspot.com/2010/08/my-experience-of-sap-certification-exam.html