Shifting -ve sign from right side of a value to left side in an alv report

HI GURUS,
i'm doing an alv report which displays grand totals of numeric fields as well.
tab-othercost = itab-netwr - itab-wavwr - itab-kzwi2 - itab-kzwi5.
when othercost value is -ve, the -ve sign is cuming right to the value.
i'm using fm 'CLOI_PUT_SIGN_IN_FRONT' and shifting the -ve sign frm right to left of value.
L_FIELDCAT-FIELDNAME = 'OTHERCOST'.
  L_FIELDCAT-TABNAME = 'TAB'.
  L_FIELDCAT-SELTEXT_M = 'OTHER COST'.
  L_FIELDCAT-COL_POS = 9.
  L_FIELDCAT-DO_SUM = 'X'.
  L_FIELDCAT-DATATYPE = 'CURR'.
  APPEND L_FIELDCAT TO L_FIELDCAT.
  CLEAR L_FIELDCAT.
but in the grandtotal value i'm getting -ve sign in the right side of value.
plz let me wht to do to change the sign in grnadtotal value as well...

Hi,
do all the calculations in a currency variable...and then finally move it to the character variable..
Also try commenting this line.
*L_FIELDCAT-DATATYPE = 'CURR'. "Commented
Ex..
DATA: v_netwr TYPE netwr.
DATA: v_netwr_c TYPE char20.
v_netwr = 100 - 200.
WRITE: v_netwr TO v_netwr_c CURRENCY 'USD'.
CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
  CHANGING
    value = v_netwr_c.
WRITE: / v_netwr_c.
Thanks
Naren

Similar Messages

  • How to shift Negative sign from Right to left

    Hi friends,
    please tell me How to shift Negative sign from Right to left for quan data type i am getting on right side but i want to display it on left exactly preceding my output number display.

    hi yogesh
    check this function module..
    <u><i><b>CLOI_PUT_SIGN_IN_FRONT</b></i></u>
    this will move the negative sign from the left hand side of a number, to the right hand side of the number. Note that The result will be left justified (like all character fields), not right justifed as numbers normally are.
    chck this example..
    data: a1 type i value 56 ,
    a2 type i value 60,
    res type i.
    res = a1 - a2.
    data: res1(10).
    res1 = res.
    CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
    CHANGING
    VALUE = res1
    write res1.
    I<u><i><b>MPORTANT</b></i></u>
    You can use this FM CLOI_PUT_SIGN_IN_FRONT.
    But you need to declare the amount field as char.
    Or you can code like this
    data int type i.
    data char(10).
    int = -4.
    int = int * -1.
    write int to char.
    concatenate '-' char into char.
    reward if useful..
    Message was edited by:
            navjot sharma

  • Iphoto causes half my screen to be reversed (screen split with the right side half now on the left side) and computer freezes. Any suggestions about a fix?

    iphoto causes half my screen to be reversed (screen split with the right side half now on the left side and the left hand side on the right.) and screen gets multiple blurry copies. Also the computer freezes. Any suggestions about a fix? Can I delete iphoto and reinstall? If so, will I lose my photos?

    Please post a screenshot that shows what you mean. Be careful not to include any private information.
    Start a reply to this message. Click the camera icon in the toolbar of the editing window and select the image file to upload it. You can also include text in the reply.

  • Transferring the negative sign from Right to Left for a currency field.

    Hi All,
    I am trying to transfer the negative sign in a currency field from right to left but in doing that i am not getting the comma seperators of the currency field.
    For eg : If the value is 12,345,678.00- then after converting it i am getting it as
    -12345678.00 and i am loosing the commas.
    I am trying to transfer the negative sign by first converting the currency field into character field.
    Kindly help for the same.
    Thanks,
    Sharadendu

    Hi,
    Use FM CLOI_PUT_SIGN_IN_FRONT.
    Try this code as well
    data: var(10),
    length type i.
    var = '300-'.
    write var.
    length = strlen( var ).
    length = length - 1.
    replace first occurrence of '-' in var+length(1) with ''.
    concatenate '-' var into var.
    write:/ var.
    Regards,
    Satish
    Message was edited by:
            Satish Panakala

  • Shifting -ve sign from end to start in Keyfigure

    Hi,
    I am exporting BI data to external Flat files--
    There i need to shift some of the -ve signs of the field values which are existing at end to the starting point of the field value--
    Ex: 20098- to -20098.
    for that in the routine i am writing code as below:
    if result_fields-keyfigure LT 0.
           shift result_fields-keyfigure RIGHT CIRCULAR.
         endif.
    This coding was working fine earlier.
    But now it throws error msg saying keyfigure has to be of string type to carry on this operation.
    is there any way i could acheive the above said result?
    Simran

    Hi Sunmit,
    Thanks for the reply.
    Yes i did the same-- ( Operated number as char but the -ve sign remains as it was)
    I am using new open hub destination object and transformation to acheive the same.
    In the open hub detination we maintain the fields what we want to have in flat file . There you have in the field definition tab and there is a column conversion routine.
    Against the fields names for which i want to shift the -ve sign, i had created conversion routine and declared this particular number as char instead of using template of infoobject
    When i run DTP, to my surprise the result is as same as before ---
    are these conversion routines are not supported in opne hub destination objects????
    There must be some proviosion that SAP must have provided . Otherwise you cannot shift -ve sign for external systems just sounds absurd for me as no one uses the -ve sign after the number
    Any clues?
    Edited by: S Simran on Feb 11, 2009 10:25 AM

  • Hello I have problem of external speakers, right side speaker is working but left side speaker is silent

    Hello all
    I am using iPhone 4s from 3 months
    It was Gud but from a few days itz right side external speaker is working but left side is silent

    If one is speaker and other is mic
    Why the sound of ringtones got very slow even the volume in the settings is at maximum level

  • Why are my pictures from my Powershot SX130IS blurry on the left side only?

    I have had my Powershot SX130Is for less than a year.  Initially it took lovely pictures.  Now all of the pictures are blurry on the left of each image.  I use the easy or auto setting.  I am very dissappointed with the picture quality.  Any suggestions?

    LibbiePayne,
    I agree that making sure the lens is clean may be all that is needed here.  You can clean the lens by gently wiping it down with a soft, lint free cleaning cloth, similar to what you would typically use to clean eyeglasses.
    If the images are still blurry on the left side, this may require more in-depth troubleshooting. Feel free use this Contact Us link to contact us directly if you continue to experience this issue.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • Help me please , Only Left side no sound !

    had a ipod 30Gb in xmas, very happy. but T.T
    yesterday, i found right side is lounder than left side . then a hours later , left side has no sound!
    i had tested lots headphone and power speak, still can't hear left side. T.T
    I had tested the music on diff Mp3 player, make sure the plus is straight etc..
    i still got oine year Warranty , so could i just send it back to Apple and let them fix it ? or i have to phone / email them first.
    If any1 had same problem with me, please tell me what to do.Thanks you very much.
    ipod 30Gb   Windows XP Pro  

    I'm also having this problem even thought it worked perfectly well before
    it's only been two months since i got my ipod
    i don't have warranty though and i didn't buy it in the apple store
    do you think the apple store might take it in and fix it?
    if anyone has any suggestions can you please email me at [email protected]

  • How to call an alv report from another program and return back

         Hello ,
    I am calling one abap program (Prgm B) from another program (Prgrm A).
    Here, Prgm B is an ALV report. I have fetch some data from Prgem B that gets stored in an internal table.
    Now, I am using below code in Prgrm A,
      SUBMIT Prgrm B VIA SELECTION-SCREEN
                          WITH SELECTION-TABLE rspar
                          EXPORTING LIST TO MEMORY
                          AND RETURN.
    When Prgrm A executed, it lead me to selection screen of Prgrm B and when I click F8, it shows me the report output, In short, it doesnt return back to Prgrm A. It ends up showing me the alv report if Prgrm B even afetr using RETURN statement.
    I want to get back to Prgrm A by fetching some data from Prgrm B.
    Please let me know, if i am missing something.
    Regards,
    Seema

    Hi Seema,
    Refer below code.
    DATA: v_matnr LIKE mara-matnr.
    DATA: t_listobject TYPE abaplist OCCURS 0 WITH HEADER LINE.
    DATA: t_mara TYPE mara OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF t_ascilist OCCURS 0,
             line(200).
    DATA: END OF t_ascilist.
    data var(3) type c.
    SELECT-OPTIONS: s_matnr FOR v_matnr.
    var = '  3'.
    START-OF-SELECTION.
       SUBMIT ztestaks1 WITH s_matnr IN s_matnr EXPORTING LIST TO MEMORY
       AND RETURN.
       CALL FUNCTION 'LIST_FROM_MEMORY'
            TABLES
                 listobject = t_listobject
            EXCEPTIONS
                 not_found  = 1
                 OTHERS     = 2.
       IF sy-subrc <> 0.
         MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
       ELSE.
         CALL FUNCTION 'LIST_TO_ASCI'
    *     EXPORTING
    *       LIST_INDEX               = -1
    *       WITH_LINE_BREAK          = ' '
           TABLES
             listasci                 = t_ascilist
             listobject               = t_listobject
           EXCEPTIONS
             empty_list               = 1
             list_index_invalid       = 2
             OTHERS                   = 3.
         IF sy-subrc <> 0.
           MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
         ELSE.
           WRITE:/ 'Below are the lines from the submitted program.'.
           LOOP AT t_ascilist.
             WRITE:/ t_ascilist-line.
           ENDLOOP.
           SKIP 2.
         ENDIF.
       ENDIF.
       IMPORT t_mara FROM MEMORY ID 'T_MARA'.
       WRITE:/
    'Here is the output from the table exported from the submitted program.'
       LOOP AT t_mara.
         WRITE:/ t_mara-matnr.
       ENDLOOP.
    Submitted program
    REPORT  ZTESTAKS1.
    DATA: v_matnr LIKE mara-matnr,
           v_maktx LIKE makt-maktx.
    DATA: t_mara TYPE mara OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF t_makt OCCURS 0,
             matnr LIKE makt-matnr.
    DATA: END OF t_makt.
    SELECT-OPTIONS: s_matnr FOR v_matnr,
                     s_maktx FOR v_maktx.
    START-OF-SELECTION.
       SELECT matnr INTO TABLE t_makt
                    FROM makt
                   WHERE matnr IN s_matnr
                     AND maktx IN s_maktx.
    if not t_makt[] is initial.
       SELECT * FROM mara
                INTO TABLE t_mara FOR ALL ENTRIES IN t_makt
               WHERE matnr = t_makt-matnr.
    endif.
       EXPORT t_mara TO MEMORY ID 'T_MARA'.
       WRITE:/ 'This list is from the submitted program'.
       SKIP 1.
       LOOP AT t_mara.
         WRITE:/ t_mara-mtart.
       ENDLOOP.
    Hopes this helps you.
    Thanks,
    Ashok.

  • Macbook air 2012 a strange noise on the left side

    Strange noise on the left side. If i push left side button caps lock, noise is disappears. Macbook never had damage.
    What could it be?

    Back up everything and take it in to an Apple store for testing.

  • Y ? i can not see my DVD drive in favorites, on the left side. TQ.

    y ? i can not see my DVD drive in favorites, on the left side.
    TQ.

    On the left side of what, the Finder?
    Open Finder Preferences, click on Sidebar and see if CDs & DVDs is selected under devices.

  • Move the "X" from the left side to the right side in the Document Name Tab

    I just installed CS5 MC for MAC and realized that the "X" to close the file is by default located to the left side of the Document  Name in the Tab or Bar rather than to the right when multiple files are open in an application.  I haven't checked all the Adobe Apps yet, but found this to be the case so far in AI, PS, ID.
    Where do I go in the master or individual app settings to reconfigure the file name/document name tab or bar so the little "X" that closes the file is to the right of the name rather than the left?
    I did notice that in many of Deke's Lynda training videos, the "X" was on the left in a few sessions, but most were on the right.  Really hope this isn't a MAC/PC centric thing or that it is mandatory to download Deke's custom settings for the fix.
    Thanks to anyone with the magic answer!!!
    Cheers!

    Bob --- Thank you for that very quick response.
    Bugger for the unfortunate answer, but thank you for advising/confirming the sad reality.
    Sure wish some code would fall from the sky and do a fix or workaround on this so users have the option.  I may be one of the few hung up on this, but it sure would be nice.
    Seems this is yet another "...centric" reason to use a PC in lieu of a MAC when working with Adobe products these days.
    Flip/Flop go the platforms!
    Cheers!

  • 5800 no sound from right side in headphones

    I've tried changing headphones and made sure the right option is selected in the menu that comes when you plug in the headphones but I can hear sound only from the left side. It applies to both music player and radio. This is a brand new phone.
    Solved!
    Go to Solution.

    First go to music player. Select options>audio settings> balance. Is it in the middle?
    If yes then might be hardware issue. Take your phone to nearest nokia care. Let them have a look on your phone.
    But take a backup before going to nokia care.
    Mark my posts as helpful if anyone finds it! After all you will make us improve.
    Thanks for kudos if you give!

  • Hi from few days onwards i found one abnormality in my iphone4s .That is if i observe my phone settings screen from right side of the device top navigation appearing rightside height is more than the left side. In reverse manner from the left side.

    Hi from few days onwards i found one abnormality in my iphone4s .That is if i observe my phone settings screen from right side of the device top navigation bar appearing rightside height is more than the left side. In reverse manner from the left side. I dnt know whether it is default feature of iphone or not but i am really disappointed due to this. So please anyone help me in this issue and let me clear my doubt and make me happy. Thanks in advance.

    I believe what you are seeing is an optical illusion when viewing the screen from the side. Try to align one of the one of the options in Settings, like General, with the navigation bar you'll see it does the same thing.
    Hope that helps

  • Move dynpro field text from right side on yhe left.

    Hi experts. I have a DDic field (char1 as chebox) on screen. I need to move the DDic text for this field from right side to the left side of the checkbox. How can I do it? Is it neccesary to split this one object into two? To create a new text field and handle it in program?
    Thanks for your answer.

    hi Mark,
    in the Graphical Screen Painter you have to right click on the field and you'll have some helpful options...
    ec

Maybe you are looking for

  • App store won't let me download anything because I got a new apple ID?

    So I'm moving out soon and I've been sharing my apple ID with my parents. They wanted me to create my own account, so I did and it was going fine until I accidentally deleted the Twitter app on my phone. When I went to go download it again, it acted

  • My song art is all screwed up!!!

    some songs on my iPod (not in iTunes) have different album artwork than it should. i don't know what to do, and i'm not even sure what i did to get it this way. Please help!!!

  • Lightroom - Photoshop Integration breaks for more than one file

    This message is for those of us who process lots of images. I just spend a n afternoon working with Lightroom 1.0 to process the 900+ images taken at a sporting event over the weekend. My task is to find the keepers, and then run a custom action in P

  • Business area wise TDS certificate

    How to take out TDS certificate on business area wise Plz guide I will assign points Regards Raj

  • Forms Error Message Documentation

    Dear Colleague, Could someone please give me a link to documentation that contains the explanations of the Forms Error Messages, e.g. FRM-99999 etc. I have not been able to find it in OTN. Kind regards, Randy