‎2009 Mar 12 10:28 AM
Hi developers,
I'm modifying a Sapscript and I need to change the way a field &field_name& is displayed.
I've got to display a negative number. In that field the number is written with the sign on the right (for example like "15-") but i need to represent it with the sign on the left (like "-15").
Is there anything that allows me to do that immediately?
Thanks,
Simone
‎2009 Mar 12 10:36 AM
‎2009 Mar 12 10:31 AM
Hi
Why can't use the Split and Concatenate mechanism for this.
Val = 15-.
Concatenate val2(1) val0(2) into val.
Write:/ Val.
Val = -15 now.
Regards,
Sreeram Kumar.Madisetty
‎2009 Mar 12 10:35 AM
Hi,
Use the control command
SET SIGN LEFTfor more information check this link
[SCRIPTS|http://saphelp.border-states.com/EN/d1/802ddb454211d189710000e8322d00/frameset.htm]
regards
sarves
‎2009 Mar 12 10:36 AM
‎2009 Mar 12 10:38 AM
&symbol(S)& Omit Leading Sign
&symbol(<)& Display Leading Sign to the Left
&symbol(>)& Display Leading Sign to the Right
Regards,
Gurpreet
‎2009 Mar 12 10:44 AM
Change your driver program with a logic to add '-' sign at start of filed.
if you atre using a statndard sap driver program,
create a small include program, write a subroutine in the same and call that perfor from sap script.
Perform <XYZ> in program 'zabc' using &field-name&
changing &filed-name& .
include zabc.
form XYZ tables input_table structure itcsy
output_table structure itcsy.
data:g_value(20) type c.
loop at input_table.
if input_table-name = 'FIELD-NAME'.
g_value = input_table-value.
end loop.
condence g_value with no-gaps..
g_n = strlen(g_value).
" if last character is negaetive
if g_value(g_n) = '-'
g_new_value(1) = '-'.
g_new_value+1(g_n) = g_value.
g_value
endif.
input_tabl
endform.