Re: Printing currency (INR,ISK) beside subtotal or  grandtotal in alv

hi to all,
  i developed an alv report i want to display a currency beside subtotalor grandtotal .
  can any one help in this regard
regards
  raj

Hi,
check this sample code..
REPORT  ZTEST_ALV_REPORT.
* This program lists orders (VBAK) with sort and sub-total for        *
* 'sold-to-party' (KUNNR) and 'Sales organization' (VKORG)            *
TABLES : vbak.
TYPE-POOLS: slis.                      " ALV Global types
SELECT-OPTIONS :
  s_vkorg FOR vbak-vkorg,              " Sales organization
  s_kunnr FOR vbak-kunnr,              " Sold-to party
  s_vbeln FOR vbak-vbeln.              " Sales document
SELECTION-SCREEN :
  SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.
PARAMETERS p_max(2) TYPE n DEFAULT '20' OBLIGATORY.
SELECTION-SCREEN END OF LINE.
  DATA:
    ls_fieldcat TYPE slis_fieldcat_alv,
    lt_fieldcat TYPE slis_t_fieldcat_alv,
    lt_sort     TYPE slis_t_sortinfo_alv,
    ls_sort     TYPE slis_sortinfo_alv,
    ls_layout   TYPE slis_layout_alv.
DATA:
  BEGIN OF gt_vbak OCCURS 0,
    vkorg LIKE vbak-vkorg,             " Sales organization
    kunnr LIKE vbak-kunnr,             " Sold-to party
    vbeln LIKE vbak-vbeln,             " Sales document
    netwr LIKE vbak-netwr,             " Net Value of the Sales Order
    waerk LIKE vbak-waerk,             " Document currency
  END OF gt_vbak.
types:
  BEGIN OF t_vbak,
    vkorg LIKE vbak-vkorg,             " Sales organization
    kunnr LIKE vbak-kunnr,             " Sold-to party
    vbeln LIKE vbak-vbeln,             " Sales document
    netwr LIKE vbak-netwr,             " Net Value of the Sales Order
    waerk LIKE vbak-waerk,             " Document currency
  END OF t_vbak.
  DATA: IT_VBAK TYPE T_VBAK OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
   I_PROGRAM_NAME               = sy-repid
   I_INTERNAL_TABNAME             = 'IT_VBAK'
   I_INCLNAME                   = SY-REPID
  CHANGING
    CT_FIELDCAT                = lt_fieldcat
EXCEPTIONS
   INCONSISTENT_INTERFACE       = 1
   PROGRAM_ERROR                = 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.
ENDIF.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
   I_PROGRAM_NAME               = SY-REPID
   I_INTERNAL_TABNAME           = 'GT_VBAK'
   I_INCLNAME                   = SY-REPID
  CHANGING
    CT_FIELDCAT                  = lt_fieldcat
EXCEPTIONS
   INCONSISTENT_INTERFACE       = 1
   PROGRAM_ERROR                = 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.
ENDIF.
INITIALIZATION.
  v_1 = 'Maximum of records to read'.
START-OF-SELECTION.
  PERFORM f_read_data.
  PERFORM f_display_data.
*      Form  f_read_data
FORM f_read_data.
  SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_vbak
           FROM vbak
             UP TO p_max ROWS
          WHERE kunnr IN s_kunnr
            AND vbeln IN s_vbeln
            AND vkorg IN s_vkorg.
ENDFORM.                               " F_READ_DATA
*      Form  f_display_data
FORM f_display_data.
  DEFINE m_fieldcat.
    add 1 to ls_fieldcat-col_pos.
    ls_fieldcat-fieldname   = &1.
    ls_fieldcat-ref_tabname = 'VBAK'.
    ls_fieldcat-do_sum      = &2.
    ls_fieldcat-cfieldname  = &3.
    append ls_fieldcat to lt_fieldcat.
  END-OF-DEFINITION.
  DEFINE m_sort.
    add 1 to ls_sort-spos.
    ls_sort-fieldname = &1.
    ls_sort-up        = 'X'.
    ls_sort-subtot    = &2.
    ls_sort-group     = '*'.
    append ls_sort to lt_sort.
  END-OF-DEFINITION.
  DATA:
    ls_fieldcat TYPE slis_fieldcat_alv,
    lt_fieldcat TYPE slis_t_fieldcat_alv,
    lt_sort     TYPE slis_t_sortinfo_alv,
    ls_sort     TYPE slis_sortinfo_alv,
    ls_layout   TYPE slis_layout_alv.
  m_fieldcat 'VKORG' ''  ''.
  m_fieldcat 'KUNNR' ''  ''.
  m_fieldcat 'VBELN' ''  ''.
<b>  m_fieldcat 'NETWR' 'C' 'WAERK'.
  m_fieldcat 'WAERK' ''  ''.</b>
  m_sort 'VKORG' 'X'.                  " Sort by vkorg and subtotal
  m_sort 'KUNNR' 'X'.                  " Sort by kunnr and subtotal
  m_sort 'VBELN' ''.                   " Sort by vbeln
*  ls_layout-cell_merge = 'X'.
  LS_LAYOUT-WINDOW_TITLEBAR = 'test window'.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
            is_layout   = ls_layout
            it_fieldcat = lt_fieldcat
            it_sort     = lt_sort
       TABLES
            t_outtab    = gt_vbak.
ENDFORM.                               " F_DISPLAY_DATA
Regards
vijay

Similar Messages

  • Writing Subtotal and Grandtotal in ALV Report

    Dear All,
    I have a requirement that instead of  *  and  **  in Subtotal and Grandtotal, I will require to write text "Subtotal" and "Grandtotal" written. Can you please help me out?
    Thanks and regards,
    Atanu

    HI
    http://help.sap.com/saphelp_sm32/helpdata/en/ee/b99d37e188a049e10000009b38f8cf/content.htm
    Use "Subtotal_text" in events table.
    here GTOTAL is field in itab on which we sortindf data, and use your own field on which field u want to sort...
    refresh gt_event.
    clear gw_event.
    call function 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    i_list_type = 0
    IMPORTING
    et_events = gt_event.
    Subtotal
    read table gt_event with key name = slis_ev_subtotal_text into gw_event.
    if sy-subrc = 0.
    move 'SUBTOTAL_TEXT' to gw_event-form.
    append gw_event to gt_event.
    endif.
    form subtotal_text using uw_subtot_line type ty_main
    uv_subtottxt type slis_subtot_text. "#EC CALLED
    if uv_subtottxt-criteria = 'GTOTAL'.
    uv_subtottxt-display_text_for_subtotal = 'TOTAL'.
    endif.
    *FORM build_sort .
    refresh gt_sort.
    gw_sort-spos = 1.
    gw_sort-fieldname = 'GTOTAL'.
    gw_sort-tabname = 'GT_MAIN'.
    gw_sort-up = 'X'.
    gw_sort-subtot = 'X'.
    APPEND gw_sort TO gt_sort.
    CLEAR gw_sort.

  • Is it possible to set  Local Currency - INR in SAP B1 8.81

    Hi,
    In SAP B1 Version  8.81 , i have taken Type -Chart of Accounts - as Global
    and  Localization - United Kingdom  And just tell me is it possible to set
    Local Currency - INR in SAP B1 8.81

    Hi,
    You can set any currency till the time there is no transactions in the database.
    Please do remember that the on selection of the Localization UK, the legal aspects and the tax law pertaining to the UK will be applicable and also you have to check for the exchange rate calculation based on settings (direct/indirect).
    Also, taking INR as LC will lead to INR being the main currency and hence the reports generation and reconciliation of all the Multi-Currency will be performed in the Lead Currency.
    All the Best.
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • How  can i print currency symbol in smart form?

    how  can i print currency symbol in smart form?
    i want to print the currency symbol with grant total based on the vendor currency.
    pls hepl............

    Hi,
    think You can't print the symbols for currency like $ and Pound etc
    see this doc if needed
    A variable in SAPscript is called a symbol. There are the following types.
    • System symbol (e.g. the number of the current page)
    • Standard symbol (usable in any document)
    • Program symbol (value from the print program)
    • Text symbol (“local variable”)
    The value of a symbol is text for using within SAPscript code and is represented by the symbol-name enclosed by ampersands. On seeing the tell-tale ampersands in SAPscript code, you sometimes need to figure out the symbol type.
    goto any PAGEWINDOW's Text elements in Script (SE71)
    from the Menu-> INSERT-> Symbols
    you find all symbols here
    System symbols
    System symbols in a SAPscript form are comparable to system fields like SY-UZEIT in an ABAP program, and include these. The graphical editor offers three types of system symbol.
    1. General system symbols
    See the table TTSXY. PAGE is the most widely used. The list given in our BC460 training manuals is out of date.
    2. SAPscript system symbols
    See the dictionary structure SAPSCRIPT. SAPSCRIPT-FORMPAGES is the most widely used.
    3. ABAP system symbols
    For the ABAP system field SY-UNAME, say, the symbol is SYST-UNAME. http://SYST is the dictionary structure for ABAP system fields.
    Sample code:
    User: &SYST-UNAME&
    Page &PAGE& of &SAPSCRIPT-FORMPAGES(C3)&
    Standard symbols
    Standard symbols are maintained centrally (in the table TTDTG via transaction SE75) for use in any document. Menu path:
    Tools
    Form Printout
    Administration
    Settings
    Some standard symbols are SAP-standard and others are custom. Curiously, table TTDTG is cross-client although SAPscript forms are not.
    The value of a standard symbol has to be defined for each language used. This gives a way to make a single SAPscript form multi-lingual.
    We can take advantage to an extent of the central maintenance, though there is no guarantee that the available standard symbols will used in every appropriate context.
    Standard symbols complicate searching a SAPscript form, since text like ‘Charity registration 211581’ may be hiding in a standard symbol.
    Text symbols
    A text symbol is declared and assigned to within the SAPscript code, and so obviously applies only to the current document. The command DEFINE is used, requiring /: in the tag column, as in the following examples.
    /: DEFINE &COMP_NAME& = ‘University of Warwick’
    /: DEFINE &WS_RATE& = &TAX_SUMM_C&
    Reward points for useful Answers
    Regards
    Shiva Kumar

  • Exchange rate diff.accts are not defined for account 13100100 currency INR

    We are facing issues with doing BRS and getting the following message,
    Exchange rate diff.accts are not defined for account 13100100 currency INR
    We have tried all possible steps mentioned on SCN,please note the acoount mentioned above does not have the open item management.
    Assigned GL accounts on transaction DSA-Difference arising on G/L acct clearing.

    Hi ,
    THis question has been Asked and answered lot of time .
    Can you Please go to OB09 and define your GL account to solve this problem
    Many Thanks

  • Print Currency as symbols in SAPSCRIPT/Smartforms

    Hi all,
    My customer want to print currency not as text but as symbols , for example "S" instead of "USD" .
    Does somebody know how to make it?
    Is there a dynamic solution ?
    Best regards.

    Hi
    U should check if in your system there's the currency symbol and if it supports it.
    The other problem can be in the printer, it need to know if it can understand that symbol.
    U can get all symbols available in your system from table TCP01.
    Here the symbol corresponds to a number has to be used in the sapscript/smartform.
    For example Euro sing is 156, so in the sapscript it need to insert <156>, the dollar shoul be 36, so <036>.
    Anyway you can't be sure your device can print the symbol.
    Max

  • Currency INR convert in EURO currency in MIRO

    Hello MM Sapperu2019s,
    Let me know the reason from forum when I enter the tax code in MIRO autoamcaally the Currency INR convert in EURO currency. Please provide your inputs what could be the reason for this and how I can resolve this case.
    Cheers,
    Kumar.S

    HI,
    Because your main vendor has currency EURO so its coming there  and IN po your currecny will be EURO
    check vendor currency
    If you don want it thne
    do following
    in MIRO after execution before giveing PO number chnage currency to INR and enter and then give PO number it will not chnage then
    Regards
    Kailas Ugale
    Edited by: kailasugale on Feb 9, 2012 11:51 AM

  • Exchange rate diff.accts are not defined for account 16138579 currency INR

    The following message is coming,while trying to clear vendor account of capital services.Exchange rate diff.accts are not defined for account 16138579 currency INR
    Please help us to resolve the issue.

    Hello Kishore,
    Use TCode: OB09 and maintain FX determination account for G/L account 16138579. In case you have local currency 2 then you will also need to maintain FX determination see below example:
    Additional setting in case you have local currency 2

  • Printing Currency Fields

    Hi,
    How to Print Currency Fields in Smartforms [in tables node]
    Thanks & Regards,
    Ajith

    hi
    use sth like this
    data: lv_neto type string,
             wa_tabla-to_neto like bseg-dmbrt.
    write wa_tabla-to_neto to lv_neto currency 'CLP'.
    then in ur text of the smartform write &lv_neto&, doing that ur amount will be showed fine.
    Regards

  • Message 5702:A balance has occured in transaction currency INR

    A balance has occurred in transaction currency 'INR' with the following details:
    Exchange rate '00', amount '        52,998.00' and currency key 'INR'.
    The data in the transaction currency were transferred from the calling application.
    System Response
    Your data cannot be processed in FI.
    Procedure
    The error is probably in the calling application
    Please help us how to solve and the steps for solving this issue
    and the share the message to this email id:
    Thanks for

    Hi,
    Derived depreciation areas could no handle APC differences unless you activate the indicator "Treat Derived Depreciation Area As Real Area" under the following menu:
    SPRO -> Asset Accounting -> Valuation -> Depreciation Areas -> Define Depreciation Areas).
    If you set this indicator, then the system posts the real difference. If you would like to apply this indicator you have to complete the account assignment in the configuration, too.
    You can switch the derived area from a special reserves area to a "handled as real" area in transaction OADB. There is no other possibility to get the derived area post APC differences, which you definitely have on some assets.
    Please also review and apply the following Notes:
    759890 Depreciation run ends with error F5 702
    1094330 F5 702 with retirement on group asset
    1024598 Incorrect values with repeated simulation
    regards Bernhard

  • Will my Printer not print Currency?

    I have an HP Photosmart Premium Printer.  Using Windows 7 64 bit OS.
    This morning I was trying to copy the Currency that I was depositing in our rental account (the tenant paid a deposit in cash).  I printed the deposit slip and the first two bills and it printed with no problem.  When I loaded the next three bills, it would start to print, get about the top 1/4" or so of the bill and stop.  It is printing and copying everything else ok but refuses to copy the currency.
    Is this something that is a safeguard built into the printer so that it won't copy currency?  I'm thinking it might be to avoid someone trying to copy bills illegally.
    Thanks for any help you can give me. 
    This question was solved.
    View Solution.

    That is correct as it is a Federal Offense to copy money and you can get arrested.  All printers have built in sensors that will not print currency.
    Say thanks by clicking the Kudos Thumbs Up to the right in the post.
    If my post resolved your problem, please mark it as an Accepted Solution ...
    I worked for HP but now I'm retired!

  • Printing currency symbols(like $ for dollar)for all countries in smartforms

    Hi friends,
    I have to print currency symbols (like $ for dollar) for all countries in SRM PO Smartform.
    Is there any character set which has all the currency symbols in it?
    If so, how to print those in Smartforms?

    Hi
    There are two ways to maintain format of Currency,
    1. Transaction : OY01 Customize: set up countries
    2. Menu->System->User profile-> Own data -> Defualt
    Just check the country seeting as well as user setting
    before run the smart form.
    U can use SET COUNTRY command to set country format which is specified into OY01.
    Use Write stament to convert into required currency format.
    ... CURRENCY w
    Effect
    Correct format for currency specified in the field w.
    Treats the contents of f as a currency amount. The currency specified in w determines how many decimal places this amount should have.
    The contents of w are used as a currency key for the table TCURX; if there is no entry for w, the system assumes that the currency amount has 2 decimal places.
    Regard ,
    Vinod

  • How doi print Any variable at the end of page in ALV report?

    Hi,
    Anyone can tell me that How do i print Any variable at the end of page in ALV report?
    Exmale: at the ende of alv report i want to print total no of employee who has taken house loan or education loan.

    Hi,
    Go through these links
    Thread in sdn regarding FOOTER IN ALV
    [ALV  FOOTER;
    Wiki in sdn regarding HEADER AND FOOTER IN ALV
    [https://wiki.sdn.sap.com/wiki/display/Snippets/ABAP%20Objects%20-%20ALV%20Model%20-%20Using%20Header%20and%20Footer]
    Header and Footer in ALV
    [http://www.sap-img.com/abap/test-alv-display-with-header-footer.htm]
    Hope this helps.
    Thank you,
    Pavan.

  • Subtotal Text in Dynamic ALV

    I have faced the problem with Subtotal Text in Dynamic ALV.
    I don't know why it is not get into "FORM subtotal_text " .
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
         i_callback_program             = sy-repid
       IS_LAYOUT                        = gw_layout
         it_fieldcat                    = gi_fieldcat[]
         it_sort                        = gi_sort[]
         it_events                      = gi_events
        TABLES
          t_outtab                       = <gi_dyntable>
       EXCEPTIONS
         program_error                  = 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.
      ENDIF.
    and
    *&      Form  subtotal_text
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM subtotal_text USING  p_total type ref to data
                             p_subtottxt_info TYPE slis_subtot_text.
      break-point.
    ENDFORM.                    " alv_subtotal
    Thanks in advance

    I put the form name to gi_events
    *&      Form  event_build
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM event_build .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = gi_events.
      READ TABLE gi_events WITH KEY name = 'SUBTOTAL_TEXT' INTO gw_events.
      IF sy-subrc = 0.
        MOVE 'SUBTOTAL_TEXT' TO gw_events-form.
        MODIFY gi_events FROM gw_events INDEX sy-tabix.
      ENDIF.
    ENDFORM.                    " event_build

  • Subtotal Text in OOPS ALV

    Hello All,
                      Can any one let me know how to display the subtotal text in OOPS ALV report .
    How can v user event SUBTOTAL_TEXT in this.
    Thanks in advanced.
    -Anmol.

    Hi Anmol,
    Do as below :-
    1) Declare event table i_event TYPE slis_t_event
    2) Declare a subrouting like *PERFORM get_event.
    2) In the subroutine, Declare a variable of type l_s_event TYPE slis_alv_event  & a constant as  CONSTANTS :     
         c_formname_subtotal_text TYPE slis_formname VALUE 'SUBTOTAL_TEXT'.
    3) call function 'REUSE_ALV_EVENTS_GET.
    4) Then Read the table I_event as below :-
    READ TABLE i_event  INTO l_s_event
                        WITH KEY name = slis_ev_subtotal_text.
      IF sy-subrc = 0.
        MOVE c_formname_subtotal_text TO l_s_event-form.
        MODIFY i_event FROM l_s_event INDEX sy-tabix.
      ENDIF.
    5) Declare a subroutine as Perform subtot_text
        In the subroutine subtot_text write code as below :-
    FORM subtotal_text CHANGING
                   p_total TYPE any
                   p_subtot_text TYPE slis_subtot_text.
    * Material level sub total
      IF p_subtot_text-criteria = 'MATNR'.
        p_subtot_text-display_text_for_subtotal
        = 'Material level total'(009).
      ENDIF.
    * Plant level sub total
      IF p_subtot_text-criteria = 'WERKS'.
        p_subtot_text-display_text_for_subtotal = 'Plant level total'(010).
      ENDIF.
    Regards
    Abhii

Maybe you are looking for

  • Why won't my call go through

    I'm calling from Australia to the USA. The no. dials and then hangs up shortly afterwards, this doesn't happen when I try to call other USA no.s in other area codes. I'm trying to call a number with the area code 425

  • Info about Element entry values for an element

    Hi Im trying to get info on something. Im supposed to get entry values for a certain Sc med element. Now i know that the entry values reside in pay_element_entry_values_f. The values i need are for the input EE Contr Now when i query the pay_element_

  • Problems Accessing iPhone Photo Library - Wild

    Having some issues accessing or even finding the photos stored on my device. iPhone 4S iOS 5.1 Image Capture only sees the "Camera Roll" (500 or so pictures in there) but I can't access anything else. Here's how my Photo Library is structured on my d

  • ODI sendmail clearing error status.

    I'm running log level 0 because I only want to see errors. I've also setup odisendmail to e-mail me an error occurred. This is where the problem comes in. Even though a step failed, ODI flags the entire job green because the last step completed succe

  • JFlashplayer does not exist error

    I want to open a flash cs3 through a button in my java application. The problem is, the program keeps on throwing the following error: "package jflashplayer does not exit". I found the package and saved it in the same package as my classes and it sti