Saturday, February 17, 2007

SAP R/3 : EN-QUEUE... Becareful when using it...

Three days ago, i was helping my colleague to troubleshoot his program. His program uses EN-QUEUE and DE-QUEUE functions to lock and unlock a transparent table that the program is using.

While I was troubleshooting, the application crashed indefinitely and it wouldn't budge. So i make the very wrong move by pressing, you know what, CTRL-ALT-DELETE. The all-mighty Microsoft GOD forbidden function to kill off crashed or stalled program. Why i would say it wrong or in fact you guys out there are shooting my brains off is because when an SAP or ABAP program is running, even though it may looked stalled, but behind it - IT IS STILL RUNNING...!

So i made the terrible mistake.

When i opened up the editor to edit the program, it was locked. So again, i went to SM12 to unlock the program. However, this doesn't really solve our problem. Why? Because, you have to remember that my friend is using EN-QUEUE and DE-QUEUE functions. It means, when your program has begun an EN-QUEUE function you must always DE-QUEUE it at the end immediately. Now, because i make the ever blunder CTRL-ALT-DEL before the ABAP program got the chance to DE-QUEUE it, the report will not execute properly in the next session.

So we were turning in cycles for at least one hour and looking for an answer until someone said, "Eh, you guys should check out SM51... maybe your process is still running" By GOLLY, it was still running and it was there. We delete the session and instantly everything came back to normal.

Lesson learnt :
1. Never use the almighty God Forbidden Microsoft invented CTRL-ALT-DEL to kill off your ABAP process. Think twice before doing it.
2. SM51 to maintain and monitor processes
3. SM12 to maintain and monitor locked programs or transactions.

is sky the limit... CTRL-ALT-DEL and EN-QUEUE vis DE-QUEUE...

Friday, February 09, 2007

SAP R/3 : Profit & Loss Report - Part 1

In about three weeks from now, i have been holed up in a cubicle with two FICO functional consultants doing PS (Project System) enhancement. A massive report combining six reports (Revenue, Cost of Sales, Vendor, Vendor & Invoices, Profit & Loss, and Profit & Loss by Work Package) were plan, scope, design and implemented. The implementation was put into my hands. I developed six reports in that following three weeks. This report was crucial as it is an important requirement by company to be able to view its PNL report.

Although SAP via PS module provides the standard report to view its own PNL report but they were unable to do so due to customization of their WBS element in PS. As a result, a customized PNL is required and i had to crash my mind to come out with it.

Revenue report
A revenue report that show all of its customer by means of first and second level of project definition. It is henceforth segmented into billed and unbilled category. Billed will have the known revenue items and changed order. Unbilled is the known revenue items as well as the changed order. This will be regarded as the revenue report.

Cost of Sales report
The cost of sales report is further categorized into 3 types of report, namely, the summary of cost of sales, vendor and vendor & invoice reports. Each has its own functionality.

- Summary Cost of Sales
Based on Cost Code Group, GL account number and the unknowns (items that are bought but not specific to which project) are group into the cost of sales. Not to mention, this include known invoices which are already identified to projects.

- Vendor and Vendor & Invoice
It will display all related vendors and its invoice the summary cost of sales.

Profit & Loss/Profit & Loss By WP
Combining the Revenue report and Summary Cost of Sales report, this will become the PNL.

is sky the limit.... PNL

SAP R/3 : Spool CONVERTING report to XLS file error...

A project costing report of my client recently had a problem downloading their report via spool into an excel file. The report was not align accordingly to the cells in the xls file. All records in the report were merge as one string and assign to a single cell at the first column in the xls file.

So we grouped together a few ABAP consultants and functional consultants to figure out what was the possible solution to enable the ABAP report to be downloaded into xls via spool correctly. So to say, we need to figure out how to make each column in the ABAP report correctly downloaded into each xls column as exactly as it is.

After several days of searching, the functional found an OSS notes, 78401, that describe our problem (symptom) and prescribed a solution. The solution was to provide the ABAP report to be optically identifiable by vertical lines so the spool knows what are the columns. Currently, the report in question was a classic ABAP report and no lines to indicate what were columns in the report. That makes sense. So an ABAP consultant was set to convert the classic report into an ALV report.

The result, it solves the problems. Now, the customer can happily download their report into xls format via the spool without any problem.

OSS NOTES : 78401.

is sky the limit... no vertical lines in report can make the spool blind.