Quantcast
Channel: SAP Business Explorer (SAP BEx)
Viewing all articles
Browse latest Browse all 45

APD Report Output with Negative Sign

$
0
0

Purpose: Making data available from BW system to another system is common and regular activity.

 

When extracting data from Report or any other sources we may have negative values like 100- , while updating same data to flat files , we may have requirement inverse negative values from 200- to -200.

 

Here is the solution.

 

  1. Drag the report
  2. Add ROUTINE transformation
  3. Connect report to ROUTINE transformation
  4. Double click on ROUTINE transformation add required fields from Field List to Source Flds
  5. In TargetFlds Tab add one extra column along with normal amount filed. Here SIGN_AMT type 0txtlg

 

Untitled.png

  1. Write code as like below in ROUTINE tab of ROUTINE transformation.

DATA:


ls_source TYPE y_source_fields,
ls_target
TYPE y_target_fields,

   res_amt(60) type c.

 

 

LOOP AT it_source INTO ls_source.

if ls_source-amount lt 0.
clear: res_amt.

res_amt = ls_source-amount * -1.
concatenate '-' res_amt into
ls_target
-sign_amt.

CONDENSE ls_target-sign_amt NO-GAPS.
else.

 

ls_target-sign_amt = ls_source-amount.
CONDENSE ls_target-sign_amt NO-GAPS.
endif.

 

    APPEND ls_target TO et_target.
ENDLOOP.

 

Note:

 

  1. You have to assign remaining fields source to target
  2. Create target like Direct DSO or flat file and connect ROUTINE transformation to data target
  3. Execute APD

 

 

 

Thank you,

Nanda


Viewing all articles
Browse latest Browse all 45

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>