Populate negative sign to amount fields
Dear SDNers,
i need to populate a amout in local currency and amount in document currency fields with negative sign based upon debit./redit indicator. that is if debit/credit indicator gives s means we need to populate neagtive sign to for those fields, if it gives H nothing has to be populate.
this is possible in update rules. plesae provide the code or else posible in bex.
fields
/BI0/OIOI_DMBTR-----amount in local currency
/BIC/OIZWRBTR----amount in document currency
/BI0/OIFI_DBCRIND---- Debit/Credit Indicator
need the code for in update rules.
help me on that
Hi ,
i am getting the following the error while checking the update routine
E:Field "COMM_STRUCTURE-OIFI_DBCRIND" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA"statement.
PROGRAM UPDATE_ROUTINE.
$$ begin of global - insert your declaration only below this line -
TABLES: ...
DATA: ...
$$ end of global - insert your declaration only before this line -
The follow definition is new in the BW3.x
TYPES:
BEGIN OF DATA_PACKAGE_STRUCTURE.
INCLUDE STRUCTURE /BIC/CSZADPAY.
TYPES:
RECNO LIKE sy-tabix,
END OF DATA_PACKAGE_STRUCTURE.
DATA:
DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
WITH HEADER LINE
WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
FORM startup
TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring
MONITOR_RECNO STRUCTURE RSMONITORS " monitoring with record n
DATA_PACKAGE STRUCTURE DATA_PACKAGE
USING RECORD_ALL LIKE SY-TABIX
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
CHANGING ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
$$ begin of routine - insert your code only below this line -
fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
to make monitor entries
IF COMM_STRUCTURE-OIFI_DBCRIND = 's' .
RESULT = COMM_STRUCTURE-OIOI_DMBTR * -1.
ELSEIF COMM_STRUCTURE-OIFI_DBCRIND = 'h' .
RESULT = COMM_STRUCTURE-OIOI_DMBTR.
ENDIF.
if abort is not equal zero, the update process will be canceled
ABORT = 0.
$$ end of routine - insert your code only before this line -
ENDFORM.
Similar Messages
-
Changing SIgn for Amount field
Hi:
We have a requirement where we need to change +/- sign on amount field in Infocube during the data loading. How this can be done?
ThanksHi Sunil,
In the update rules, in the key figure you want, instead of assigning a source key figure from communication structure (first option), select the formula and press create. Name your formula, and then, in the formula editor, double click your key figure so it appears in the upper part. Then press the * button. and finally press constant button and enter -1 in the text box it appears. This should do it.
Hope it helps.
Regards,
Diego Lombardini -
Adobe form not showing negative sign before amount
Hi Experts,
We are having a strange problem. Our developers displaying
negative
amount in my adobe output. Its working fine in our development
system.
But for the similar set of data in testing system, negative sign before
the amount is not coming. The same adobe form, layout and print
program
is there in both development and test environment systems. Please
help.
Thanks,
SunnyHi Sunny ,
Check with the development team .. The field attribute while display types which you can restrict in the adobe form layout settings.
I am pretty sure this will help you and revert back if you have any questions in this regard.
Thanks ,
Gowrisankar -
Negative sign for DMBTR field in ALV output
Hi Experts,
Before posting I have searched for more than 3 hours in the forums to get a solution for this.
I did not get any solution so I am posting this problem which I need to resolve.
I have to display the DMBTR field in ALV output for which a grand total will have to be displayed.
Here for all the values in DMBTR which are negative are getting displayed as '- 6673.56','- 289956.23' as I am using the edit mask 'V_____________.__'.
I have to get the value shown as '-6673.56', '-289956.23'.
I tried to use convert this DMBTR to String and have successfully displayed the negative sign correctly in front of the value but I am not getting the totals which I need to have
PLease check and suggest for a solution.
Regards
KishoreHi,
If this is the case, then you can use character field to display the sign on the left. Sum up the total and use the event end of list to display the same. Remember to set the TECH and NO_OUT in the field catalog.
Hope this helps.
Regards,
Siva -
Adding -ve sign to amount field.
Hi all,
I have an amount field . I want to add -ve sign to it and then perform addition or substraction using that field.
I have added -ve sign to the field by declaring another variable as character type, but i am not able to use the field for adition or substraction since its a character field.
please help.
Thanks,
Bharat.Hi Bharat,
In order to put the '-' in front, you must have a character field. The reason for the * is because the field is not big enough to hold the value. So make the character field a length of 12, move the type p to the type c, and use the function module which i have mentioned.
function module
CLOI_PUT_SIGN_IN_FRONT
Reward If helpful.
Regards,
Harini.S -
Can we modify a query to add negative sign '-' in one field ?
Hi All,
I have created a query from SQVI by linking VBRK and VBRP. I know we cannot delete tables from the query but can we add a negative sign to all the quantities when the type is 'RE' in query ?
Thanks,
VimalHi Priya,
I can not modify the query in code as it asks for the access key.
Thanks,
VIMAL -
Negative sign before amount in report display(urgent)
i have one condititon in a rerport that if
SHKZG is debitor then before that amount no sign means positive
and if it is creditor then a minus sign should come before tha amount in list display.
for example-
if rs 100 is credit then it should display -100 otherwise hundred
depending on SHKZG field which is creditor or debitor field .so depending on it only it has to display like above.
plz its urgent .hi sanjeev,
welcome to sdn!!!
data : l_amt(15) value '435.46-'.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
VALUE = l_amt.
write : l_amt.
reward if helpful -
Can we remove the negative sign from amounts.
Hi guys,
When we run F110 , SAP gives us the list of all payments.
The payments wil be like 7000 - . There will be a negative symbol in the output generated in the layout.
Is it possible to remove the - sign from the layout?
Thanks a lot in advance..
Regards,
Srikanth.Hi
SAP will understand the Dr and Cr on the bases of signs, that mewans all -Ve sign refers to credit. you can not remove this sign. however you can remove this sign once you export the same to excel and from with the help of CNTRL+FIND you can remove in the excel sheet. -
Negative sign for Currency fields
Hello experts,
If a currency field containt -Ve sign (86.47-) then, i have to move it this sign to Left sinde. I have do this as follow by moving the currency field value to Charractor field
DATA: w_total1 (18).
MOVE w_total To w_total1.
IF w_total1 CA '-'.
SHIFT w_total1 RIGHT CIRCULAR.
ENDIF.
CONDENSE w_total1 NO-GAPS.
But don't want to move this to Chanddacter field for other pupepose. Now how can i **** the -Ve sign to left side for currency field, IF bsid-shkzg EQ 'H'.
Thanks.Hi sandhya ,
Try this :
DATA: w_total type string ,
w_total1 type string.
w_total = '1,4567.7-'.
MOVE w_total To w_total1.
IF w_total1 CA '-'.
SHIFT w_total1 RIGHT CIRCULAR.
ENDIF.
* CONDENSE w_total1 NO-GAPS.
write : / w_total1.
Hope all your issues are fixed now .
Regards ,
lokesh
Edited by: Lokesh Pattnayak on Oct 11, 2010 10:23 AM -
Negative Sign in the front for amount
Hi Friends,
i am facing problem in negative sign
while using fm : cloi_put_sign_in_front which accepts char variable.
In my report amount type is char15 and here negative sign appears after using this fm but when i download this data in one other char structure DATA: BEGIN OF itab_proextract OCCURS 0,
line(502) TYPE c,
END OF itab_proextract.
Amount is right justified always..but afterusing this amount gets displayed in left due to this my other variable which are getting downloded after amount comes as concatenated for ex...
Before :
00102384NALCUS/406FED 00AX 4.26- 5126.84-
After
00102384NALCUS/406FED 00AX-4.26 -5126.84
Please help me....Hi,
You can reer to the following links:
negative sign in front.
negative sign before amount in report display(urgent)
or
try this code
data : l_amt(15) value '435.46-'.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
VALUE = l_amt.
write : l_amt.
or
you can try this :
DATA : BEGIN OF IG_DOWNLOAD OCCURS 0,
F1(4),
F2(4),
F3 TYPE DMBTR,
F4 TYPE I,
F5 TYPE NETPR,
F6,
END OF IG_DOWNLOAD.
DATA : BEGIN OF IG_DOWNLOAD1 OCCURS 0,
F1(4),
F2(4),
F3(16),
F4 TYPE I,
F5(16),
F6,
END OF IG_DOWNLOAD1.
DATA : VALUE(16).
IG_DOWNLOAD-F1 = 'AAAA'.
IG_DOWNLOAD-F2 = 'BBBB'.
IG_DOWNLOAD-F3 = '-3.86'.
IG_DOWNLOAD-F4 = 1.
IG_DOWNLOAD-F5 = '4.58-'.
IG_DOWNLOAD-F6 = 'A'.
APPEND IG_DOWNLOAD.
CLEAR IG_DOWNLOAD.
LOOP AT IG_DOWNLOAD.
MOVE-CORRESPONDING IG_DOWNLOAD TO IG_DOWNLOAD1.
VALUE = IG_DOWNLOAD-F3.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
VALUE = VALUE.
IG_DOWNLOAD1-F3 = VALUE.
VALUE = IG_DOWNLOAD-F5.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
CHANGING
VALUE = VALUE.
IG_DOWNLOAD1-F5 = VALUE.
APPEND IG_DOWNLOAD1.
CLEAR IG_DOWNLOAD1.
ENDLOOP.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = 'C:\A1.xls'
FILETYPE = 'ASC'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = IG_DOWNLOAD1.
Thank You.
Regads,
Dhanalakshmi L -
Negative sign mapping handling for amount field
hi Experts,
From SAP ecc to PI we are receiving - negative sign after the amount value 1000 - . can you please suggest the suitable graphical mapping or UDF whenever amount value in -ve should give the ouput result as -1000. .
Regards,
Krushi.Hi Krushi - I don't see any complexity in it..
Use graphical function "endswith" to check if the amount has "-"
If yes then use replace function to replace "-" and then again conact it with "-"
amount then amount->replacevlaue "-"-> concat + "-",amount
endswith if
- else amount
For graphical function look at the below blog-
Standard Functions in PI 7.0 - Process Integration - SCN Wiki -
To prefix an amount with a negative sign
Hi All,
I want to prefix a positive amount with a negative sign...for display...
How will I be able to do that ?
Regards,
Archanaamount = -1 * amount.
if it does not work then you might need to change the type of amount field.
Thanks,
Ram -
Negetive signe prob for a amount field
i m selecting data from DBtable into my internal table there i have a field type packed length 15 in the table i have negetive amount like (152523 -) . i want to place the negetive sign from the suffix to the prefixx.
means (- 152523) i can do this but i want to know the best possible way to do this without modifying the DBtable fields .
waiting for your reply
Message was edited by:
pawan kumar jhaI also had a similar problem. My problem was for currency field and I had to display it with negative sign in front as well as I need to use the same for subtotals. What I did was: I had declared that field in internal table as character and then that negative sign will be in front. I had used ALV method to display the same. Then while adding that column in the fieldcatalogue I have metioned fieldcat-datatype = curr, then it worked for me.
You can also try it in same way by decalring that field as character in your internal table.
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers -
Properly displaying currency amounts (negative sign) via WRITE statement
Dear forumers,
Using the WRITE statement, how may I properly display a currency amount that has a negative value?
In my program, the variable, V_AMOUNT to be displayed is originally of the type "WERTV12".
Using the WRITE statement for this, nothing gets displayed in the screen (blank only).
So, I assigned V_AMOUNT to another variable of the type "P DECIMALS 2", V_AMT.
Using the WRITE statement for this, the amount is displayed in the screen.
But, if the amount has a negative value, the negative sign is not displayed there.
I.e. If V_AMT has the value '500.00-', only '500.00' is displayed in the screen.
Finally, I changed the type of V_AMT as type string.
This works - any amounts with negative sign is displayed in the screen properly.
But, with this approach, I'm unable to "customize" the display of amounts according to currency, like this:-
DATA int TYPE i VALUE 12345678.
WRITE int CURRENCY 'EUR'.
The output of the WRITE statement is "123456,78".
Is there a better way to achieve this?SAP display amounts/quantities as positive numbers with another field that denotes whether positive or negative. You could change the value to a character field and put the negative where you need it (or put an additional field next to the amount with the sign)... but using a character field probably would negate the currency display, too....
-
Negative sign display for CURR field in ALV grid report
I have a field BETRG defined as CURR field of length 15, decimal places 2. The value may be negative or positive. In case of negative values I am using EDIT_MSK option in the field catalog to bring the negative sign to the left of the value as shown below.
Quote
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'LT_FINAL'
i_inclname = sy-repid
CHANGING
ct_fieldcat = fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
LOOP AT fieldcat.
CASE fieldcat-fieldname.
WHEN 'BETRG'.
fieldcat-ctabname = ' '.
fieldcat-cfieldname = ' '.
fieldcat-edit_mask = 'RRV_______________.__'.
ENDCASE.
MODIFY fieldcat.
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_buffer_active = 'X'
i_callback_program = sy-repid
i_grid_title = 'ABCD'
is_layout = gs_layout
it_fieldcat = fieldcat[]
i_save = 'A'
is_variant = gs_save
it_events = gs_events
TABLES
t_outtab = lt_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
Unquote
On displaying the report using 'REUSE_ALV_GRID_DISPLAY' as shown above, when the value of BETRG is a smaller number like say 624, then the ALV output appears as '- 624.00' instead of '-624.00'.
Is there any way that I can remove the space in between the negative sign and the number before displaying the ALV output using 'REUSE_ALV_GRID_DISPLAY'?Hi Deepak,
I tried this and found that this doesn't work in case of currency field. Once you move back the char field (with negative sign to the left and condensed) to the currency field, the negative sign again moves back to the right.
I think that the only way a negative sign can be brought to the left of the currenct field is by using edit_mask of field catalog as I have shown above.
Regards,
Shayeree.
Maybe you are looking for
-
I have an iphone 5 synced to my mac and also connected a samsung s3 to kies(samsung alternative to itunes). For some reason i now have all my dads contacts as well as my own and vice versa. How can i stop this happening?
-
RecordNow version 7.32.1 build 08e update problem - Intrnal Error 03f2.8007007b
Hello All! Machine is T30 with WinXP Professional SP2 (RecordNow ver 4.10 preinstalled) There is RecordNow 7.32.1 update accessible from ThinkVantage System Update (listed as optional). When I try to install it I get Internal Error 03f2.8007007b fro
-
Asynchro receiver ABAP-Proxy with unexpected response
Hi Guys, I have an asynchro senario HTTP --> PI7.1 --> ABAP-Proxy (SAP backend ECC6.0) to update a SAP table. Once the senario runs the data in the backend table will be correcttly updated, however the SAP backend sends back a response to PI and caus
-
Flash Player 16.0.0.296 Not working
I use a Windows 8.1 Lenovo laptop. Yesterday I tried watching a flash player video which worked fine except there was no sound. I also tried youtube just to check if the problem is in my laptop but it was working fine with sound. So i updated my flas
-
Adjustments not carried over to external editor?
I've noticed that all my adjustments are not carried over to my external editor (niksoftware). Is this intended? Is there an option I'm missing that would allow me to do so? Because basically this forces my workflow to first do any adjustment externa