Skip to Content
avatar image
-1
Former Member

Negative sign at end of the Value in Adobe Forms

Hi

I am displaying a table data in the Adobe form, My requirement is display the '-'ve sign at end of the value if the value is less than zero, but right now it is coming in front of the value.

Could you please help me out.

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Mar 22 at 12:35 PM

    Hi Sri ,

    I would make a characteristic variable and convert it myself. Please check below code.

    DATA: gv_amount type konp-kbetr.
      DATA: gv_amount_text(15)  type c. 
    
    gv_amount = 100.
      WRITE:/ 'Positive Value : ', gv_amount. 
    
    gv_amount = gv_amount * -1. 
    
    WRITE:/ 'Negative Value : ', gv_amount. 
    
    gv_amount_text = gv_amount. 
    
    CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
        CHANGING
        value  = gv_amount_text. 
    
    WRITE:/ 'After Shifting : ', gv_amount_text RIGHT-JUSTIFIED.
    
    Output ;
    
    Positivie Value : 100.00
    Negative Value : -100.00
    After Shifting : 100.00-
    Add comment
    10|10000 characters needed characters exceeded

  • Mar 22 at 11:06 AM

    Hi Sri,

    You can either handle negative values in interface (multiply by -1, convert into character and concatenate minus sign) or you can use java script in Adobe.

    if (this.rawValue < 0)
    {
    	this.rawValue = this.rawValue * -1;
    	this.rawValue = this.rawValue.toString();
    	this.rawValue = this.rawValue + '-';
    }
    

    Regards,

    Mangesh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 12 at 03:29 PM

    Thanks for your reply

    I have used the Patterns option - num{$z,zzz,zz9.99s} (s - will be replaced with '-ve' sign in case the value is less than zero)

    Add comment
    10|10000 characters needed characters exceeded