How to save hours of frustration when working SAP Application Process Designer (APD)

Posted by on Jan 14, 2010 in SAP Business Intelligence | 5 comments

A client requests a specific report to be saved as a flat file.

In this case, the format is a comma space vertical (CSV) delimited file, which is a common workaround for Microsoft Excel’s limitation of 65,000 rows. That sounds easy enough.

Working with SAP Application Process Designer (APD), however,
was anything but straight-forward. The Business Explorer (BEx) query report was
showing one set of numbers while the flat-file seemed to display whatever it
wanted at the moment. After hours of banging my head against my desk, I have
discovered 3 tips that will help to save you the frustration and recoup several
hours from your workday.  Here is a summary of the three tips followed by
a more detailed explanation.

Three Rules for Working with SAP APD

1. Unhide all fields

2. ‘Display Data’

3. Create formulas in APD

Before explaining the three rules in detail, I want to
show you a before picture.  Below is a screen-capture, comparing the query
results with the generated flat file.  The value of “50″ for
Safety Stock in the report is correct but the value of “0.000″ in
the APD flat file is wrong. (Click on the image below for a larger picture)

image001.jpg To drive the point home, here is another view of the same
record.  Notice how the value of “50″ for Safety Stock (in the
query) appears under “Reorder Point” (in the APD flat-file)?
Also, how the value of “24″ for Open SO Quantity in the query
appears under Max Stock Value in the APD flat-file.

image002.jpg

What is causing the values to jump around and be displayed
in arbitrary columns?  For that, we will need to take a closer look at the
query definition.

Notice below how there are a series of green and blue icons
in the columns section of the query designer.  The green icons are your
visible fields and the blue icons signify that a field (key figure,
calculation, formula, restricted key figure, etc.) is hidden from view.
Not only is that field hidden in the report output but it is hidden from the
APD mapping as well.

image003.jpg

Rule 1: Unhide all fields in APD

Your life will be much better for it. See below.

image004.jpg

Apparently, un-hiding the fields in Query Designer help APD
to put the output values in the correct buckets.  Otherwise, selectively
displaying and hiding column fields will make numbers omelet look like
scrambled eggs.

So now that you are displaying all of the report fields, how
do you go about verifying that the flat-file output will match the Business
Explorer (BEx) query?  Well, you test the APD of course!  How you go
about testing the APD is another thing altogether.

To start this topic, here is a sample APD. Notice there are
five distinct steps between the initial query result (step 1) to the final
flat-file layout (step 5).

image005.jpg

So the question is “If the query result from step 1
does not match the data in the final flat-file in step 5, then how do you find
out what went wrong and where it went wrong“?

One approach (that I am embarrassed to admit guilt of doing)
is to run the ADP, compare the results from step 1 and step 5, and adjust the
APD.  That is, I tried adjusting the join in step 2. When that
didn’t work, I tried adjusting the calculation in step 3. When that
didn’t work, I tried adjusting the display/hide field mapping in step 4.
When that didn’t work, I would bang my head against the desk, rinse, and
repeat.  It’s not the best approach or most methodical approach.


Rule 2: Display Data

A more pragmatic approach is to use the “Display
Data”. See below:

image006.jpgimage007.jpg

Performing a Right-Click on a node (steps 1 through 5) will
display the data at it exists at that point in the execution of the APD
transformation.

For instance, I realized that my selective display and hide of the
report fields was causing an issue after having verified the query results by selecting
“Display Data” on the Query Result node at Step 1.

Rule 3: Create formulas in APD

After verifying the query output in the APD at step 1
matches my expectations, I select “Display Data” at the Join node
in Step 2. At this stage, I find that my calculation for Open Purchase Order
Quantity and Open Sales Order quantity was displaying the results in scientific
notation.  For example, the
value
“24″ was displayed as
“2.4000000000000000E+01″.
That was easily fixed by performing the calculation in the APD as a node, instead
of the performing the calculation in the query.

Well, those are my 3 tips to making
working with APD a better experience. I hope the tips saved you a few hours. =D

Related posts:

  1. Estimating Complexity for SAP Netweaver BW BI
  2. Runtime Error with BEx Variables
  3. Success! SAP Netweaver BI Administration Cockpit
  • Vijaisai67

    Very useful information. Also I have a question as when we use display data , for me it is possible to view only 2000 records, is there a way to view all the records.

  • http://www.haungo.com/ Hau Ngo

    The “display data” option in the APD tool is to verify that field mapping and output is correct following that node.nnOnce you have confirmed that the mapping were configured correctly, then you should perform an execution of your APD.nnUsing the example above with the CSV file as the final output, you should have a flat-file that is not constrained by the 2000 record display limitation.nn

  • Ram

    Hi , It was a nice blog. Just Wanted to check , WE have a requirement , where we need rnto out put the Query result to flat file either CSV or .txt .. Say for exaple , if you run the bex query , rnmay be i am getting 2 milloin records ..how to make in to flat file or CSV.. .rnrnCan i use the Open hob or APD. what are the steps. Thanks for your help.rnrnMaggernrn

  • http://www.haungo.com/ Hau Ngo

    Hello Magge,nnYou will find this to be a common request where end-users like to remix the query results.nnIf you are simply looking to bypass the record count limitation, then storing the results of your query as a flat-file is a quick and easy approach: nnhttp://bit.ly/f32Zv3nnEnjoy!

  • Apvision 2014

    Simple and direct to the point …Good Blog