Skip to Content
Author's profile photo Nanda Anantha

APD Report Output with Negative Sign

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.00- , while updating same data to flat files , you might need to prefix sign instead at the end of value. (Ex -100.00

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


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



ls_source TYPE y_source_fields,
TYPE y_target_fields,

   res_amt(60) type c.

data: w_len type i.

LOOP AT it_source INTO ls_source.


FIND FIRST OCCURRENCE OF ‘-‘ IN ls_sourceamount


if sy-subrc eq 0.

 W_LEN STRLEN( ls_sourceamount ).
W_LEN W_LEN – 1.

 CONCATENATE ‘-‘ ls_sourceamount+0(W_LENINTO ls_source-sign_amt.
CONDENSE ls_source-sign_amt NOGAPS.


ls_source-sign_amt. = ls_source-amount.

CONDENSE ls_source-sign_amt..



APPEND ls_target TO et_target.


  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,


Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.