Commas For Currency feild

Hello
I have SAP-Script i which i am taking cuurency feild into 1 variable and diplaying it in SAP-Script it is displaying the amount nicely but without any commas i want to place commas in international maths format . i have tried it by making variable like currency and quantity feilds but also it is not showing.
Do help  me
Points for sure

You can use like this:
P1  &L_DMBTR(T)&
This will remove the commas from the amount.
Regards,
Naimesh Patel

Similar Messages

  • COMMA IN CURRENCY VALUE FOR INR

    value is coming like this 970,167,543.21
    i need the indian currency value  in this format  97,01,67,543.21 .
    i have used write statement with currency addition ...and am checking for any fm ot put the comma for indian currency .
    definitely this function module CONVERT_TO_LOCAL_CURRENCY will wont work....
    so any help on this ....

    Hi,
    Please find the code Below
    Define the variable W_amount as character:
    data: W_amount TYPE p LENGTH 8 DECIMALS 2 VALUE '10000.00'.
    data: w_amount(10).
    Then write the below statement
    write: w_amount to w_amount no-grouping.
    This statement will move the value of w_amount to w_amount without separator.
    Hope this helps.
    Thanks
    Kalyan B

  • Display comma for numeric values

    Hi,
    I want to display comma for numeric values.I know we can use strlen and concatenate, but any one can give me an example.
    Ex: 1,234  and 12,234 , 1,22,500  ( iam expecting)
    Thanks,
    Veeru

    it depends on ur data...
    if it is currency then u can use
    WRITE.... CURRENCY...
    if it is qty then u can use
    WRITE....UNIT....
    or u simply pass it to a packed field and it will take the default decimal settings of the user profile...
    Reward points if helpful

  • Is that possible to remove that "," comma for year.

    Dear All,
    Please help me how to remove  "," comma for year.in attached analyzer report screen shot.(the year is the formula variable).
    Regards,
    shan

    Hi Shan,
    please check below screen shots while defining the formula variable
    select the replacement path and reference object is the calender day
    choose the currency/unit - date.
    please create the one more formula variable then try it.
    Thanks,
    Phani.

  • Urgent Plsseeeeeeeeeeeee Currency Feild

    Hi Experts,
    I need to display Output in ALV when i press print button a spool need to be generated.
    I am having two currency feilds one i am getting from database and the other i am calulating in the program which is multipled with percent feild.  
    In my program if i comment the caluclated currency feild feild catlog every thing is fine the spool is generated. But if i un comment the program is going to DUMP.
    i am attching the code below . I bold code is the caluclated currency field.
    *& Report  ZAFGU070
    REPORT  ZAFGU070 NO STANDARD PAGE HEADING
              line-size 132                                            V05
              line-count 65                                            V05
                LINE-SIZE 170                                           "V05
                LINE-COUNT 58                                           "V05
                MESSAGE-ID ZF.
                         CONSTANTS                                           *
    CONSTANTS : C_COMP_CODE TYPE BUKRS VALUE '0001',                  " constant fields
                C_SPL_PURP_ACCT TYPE HKONT VALUE '710000',
                C_NET_AMT TYPE P DECIMALS 2 VALUE '1.00'.
    CONSTANTS : C_CHECK TYPE C VALUE 'X',                             " constant fields
                C_PROJ_REPOST TYPE BLART VALUE 'IL',
                C_GI_OR_GD TYPE BLART VALUE 'WL',
                C_DEBIT TYPE SHKZG VALUE 'S',
                C_DEBIT_IND TYPE BSCHL VALUE '40',
                C_CREDIT_IND TYPE BSCHL VALUE '50',
                C_LANG TYPE SPRAS VALUE 'E'.
    CONSTANTS : C_TCODE1(03) TYPE C VALUE 'VL%',
                C_CON_LAND1 TYPE LAND1 VALUE 'US',
                C_REC_TYPE TYPE RRCTY VALUE '0'.
    CONSTANTS : BEGIN OF IS_CONST,                                    " constant fields
                   PROG_HEAD(08) TYPE C VALUE 'SAPMF05A',             " header prog
                   PROG_CODG(08) TYPE C VALUE 'SAPLKACB',             " coding block
                   DYN_0002(04)  TYPE C VALUE '0002',                 " dynpro 0002
                   DYN_0100(04)  TYPE C VALUE '0100',                 " dynpro 0100
                   DYN_0300(04)  TYPE C VALUE '0300',                 " dynpro 0300
                   MKOAR(01)     TYPE C VALUE 'D',                    " account type
                   PERIV         TYPE PERIV VALUE 'AM',               " fisc yr variant
                   CURRENCY      TYPE WAERS  VALUE 'USD',             " currency
                   RATE(09)       TYPE C VALUE '0' ,                  " exchange rate
                   DOC_TYPE(02)   TYPE C VALUE 'SA',                  " Doc Type
             Begin of change (D08k900809)
                  BUS_AREA(04)   TYPE C VALUE '0106',               " bus area
                   PROFIT_CENTRE(10) TYPE C VALUE 'C_110601',         " Profit Center
             End of change (D08k900809)
                   TEXT_HEAD(25)  TYPE C VALUE 'Tax Calc. for CC consump.',
                END OF IS_CONST.
                        P A R A M E T E R S
    *PARAMETERS:
        P_BUKRS    LIKE BSIS-BUKRS DEFAULT '0001',        " Company Code
        P_HKONT    LIKE BSIS-HKONT DEFAULT '0070685001',  " GL Accounts
        P_NETAMT(4)   TYPE P DECIMALS 2 DEFAULT '0.84'.   " Net amount
    *SELECT-OPTIONS:
        S_BUDAT    FOR BSIS-BUDAT.
    **selection-screen begin of line.       " 3.0 syntax change  v02
    *SELECTION-SCREEN ULINE.
    **selection-screen end of line.         " 3.0 syntax change  v02
    *PARAMETERS:                            " Parameters for BDC stuff
    P_BDCNM     LIKE APQI-GROUPID        " UPG45B
           DEFAULT SY-REPID OBLIGATORY,   " BDC name for combined file
    P_DEVICE    LIKE USR01-SPLD,
    P_ERRLP     AS CHECKBOX DEFAULT 'X'.
    DATA : BUDAT TYPE BUDAT.
    PARAMETERS:
                 P_BUKRS      TYPE BUKRS DEFAULT C_COMP_CODE,          " Company Code
                 P_HKONT      TYPE HKONT DEFAULT C_SPL_PURP_ACCT,      " GL Accounts
                 P_NETAMT(4)  TYPE P DECIMALS 2 DEFAULT C_NET_AMT.     " Net amount
    SELECT-OPTIONS:
                    S_BUDAT FOR BUDAT.
    SELECTION-SCREEN BEGIN OF LINE.                                    " 3.0 syntax change  v02
    SELECTION-SCREEN ULINE 1(80).
    SELECTION-SCREEN END OF LINE.                                      " 3.0 syntax change  v02
    PARAMETERS:                                                        " Parameters for BDC stuff
                P_BDCNM     TYPE APQ_GRPN                       " UPG45B
                            DEFAULT SY-REPID OBLIGATORY,               " BDC name for combined file
                P_DEVICE    TYPE RSPOPNAME,
                P_ERRLP     AS CHECKBOX DEFAULT C_CHECK.
                             TYPE-POOLS
    TYPE-POOLS : SLIS.
                              D A T A
    **DATA: BEGIN OF t_bsis OCCURS 2000,                                V05
    *DATA: BEGIN OF T_BSIS OCCURS 0,                                   "V05
           KOSTL  LIKE BSIS-KOSTL,        " Cost Center
           BELNR  LIKE BSIS-BELNR,        "FI document                V05
           GJAHR  LIKE BSIS-GJAHR,        "Fiscal year                V05
           AMOUNT LIKE BSIS-DMBTR,        " amount
           WAERS  LIKE BSIS-WAERS,        " Currency key    UPG45B
         END OF T_BSIS.
    TYPES : BEGIN OF TY_BSIS ,
              GJAHR  TYPE GJAHR,           " Fiscal year                V05
              BELNR TYPE BELNR_D,          " FI document                V05
              WAERS  TYPE WAERS,           " Currency key         UPG45B
              AMOUNT TYPE DMBTR,           " amount
              KOSTL  TYPE KOSTL,           " Cost Center
            END OF TY_BSIS.
    DATA : BEGIN OF IS1_BSIS,
              GJAHR TYPE GJAHR,
              BELNR TYPE BELNR_D,
              WAERS TYPE KOSTL,
              SHKZG TYPE SHKZG,
              DMBTR TYPE DMBTR,
              KOSTL TYPE KOSTL,
           END OF IS1_BSIS.
    DATA : IS2_BSIS TYPE TY_BSIS,
           IT_BSIS TYPE STANDARD TABLE OF TY_BSIS.
    *DATA: BEGIN OF T_JV_ITEM OCCURS 2000,
           POST_KEY(2)     TYPE C,        " post_key
           ACCOUNT(10)     TYPE C,        " account
          amount(16)      TYPE c,        " amount                     V05
           COST_CENTER(10) TYPE C,        " cost_center
           BUS_AREA(4)     TYPE C,        " business area
           AMOUNT LIKE BSIS-DMBTR,        " amount                    "V05
         END OF T_JV_ITEM.
    TYPES : BEGIN OF TY_JV_ITEM,
              POST_KEY(2)     TYPE C,        " post_key
              ACCOUNT(10)     TYPE C,        " account
            amount(16)      TYPE c,        " amount                   "V05
              COST_CENTER(10) TYPE C,        " cost_center
              PROFIT_CENTRE(10) TYPE C,      " Profit Centre
              AMOUNT TYPE DMBTR,             " amount                   "V05
            END OF TY_JV_ITEM.
    DATA : IS_JV_ITEM TYPE TY_JV_ITEM,
           IT_JV_ITEM TYPE STANDARD TABLE OF TY_JV_ITEM.
    *DATA: BEGIN OF T_ERROR OCCURS 500,
           COST_CENTER(10) TYPE C,            " cost center
           ACCOUNT(10)     TYPE C,            " account
           AMOUNT          LIKE BSIS-DMBTR,   " amount
           BUKRS           LIKE BSIS-BUKRS,   " company code            V05
           BELNR           LIKE BSIS-BELNR,   " document number         V05
           GJAHR           LIKE BSIS-GJAHR,   " fiscal year             V05
           KUNNR           LIKE KNA1-KUNNR,   " customer                V05
           COUNTRY(3)      TYPE C,            " country
           REGION(3)       TYPE C,            " region/state
           WAERS           LIKE BSIS-WAERS,   " CURRENCY KEY   UPG45B
          message(50)     type c,            " message                 V05
           MESSAGE(60)     TYPE C,            " message                 V05
         END OF T_ERROR.
    TYPES : BEGIN OF TY_ERROR,
              COST_CENTER(10) TYPE C,        " cost center
              ACCOUNT(10)     TYPE C,        " account
              AMOUNT          TYPE DMBTR,    " amount
              BUKRS           TYPE BUKRS,    " company code            V05
              BELNR           TYPE BELNR_D,  " document number         V05
              GJAHR           TYPE GJAHR,    " fiscal year             V05
              KUNNR           TYPE KUNNR,    " customer                V05
              COUNTRY(3)      TYPE C,        " country
              REGION(3)       TYPE C,        " region/state
              WAERS           TYPE WAERS,    " CURRENCY KEY           UPG45B
            message(50)     type c,        " message                V05
              MESSAGE(60)     TYPE C,        " message                V05
            END OF TY_ERROR.
    DATA : IS_ERROR TYPE TY_ERROR,
           IT_ERROR TYPE STANDARD TABLE OF TY_ERROR.
    *DATA:  BEGIN OF CONST,                 " constant fields
            PROG_HEAD(08)  VALUE 'SAPMF05A',             " header prog
            PROG_CODG(08)  VALUE 'SAPLKACB',             " coding block
            DYN_0002(04)   VALUE '0002',  " dynpro 0002
            DYN_0100(04)   VALUE '0100',  " dynpro 0100
            DYN_0300(04)   VALUE '0300',  " dynpro 0300
            MKOAR(01)      VALUE 'G',     " account type
            PERIV          LIKE T009B-PERIV VALUE 'AM',  " fisc yr variant
            CURRENCY       LIKE BKPF-WAERS  VALUE 'USD', " currency
            RATE(09)       TYPE C VALUE '0' ,            " exchange rate
            DOC_TYPE(02)   TYPE C VALUE 'SA',            " Doc Type
            BUS_AREA(04)   TYPE C VALUE '0106',          " bus area
            TEXT_HEAD(25)  TYPE C VALUE 'Tax Calc. for CC consump.',
                                                         "#EC NOTEXT   V05
          END OF CONST.
    *DATA:  BEGIN OF IS_CONST,                                   " constant fields
            PROG_HEAD(08) TYPE C VALUE 'SAPMF05A',             " header prog
            PROG_CODG(08) TYPE C VALUE 'SAPLKACB',             " coding block
            DYN_0002(04)  TYPE C VALUE '0002',                 " dynpro 0002
            DYN_0100(04)  TYPE C VALUE '0100',                 " dynpro 0100
            DYN_0300(04)  TYPE C VALUE '0300',                 " dynpro 0300
            MKOAR(01)     TYPE C VALUE 'D',                  " account type
            PERIV         TYPE PERIV VALUE 'AM',               " fisc yr variant
            CURRENCY      TYPE WAERS  VALUE 'USD',             " currency
            RATE(09)       TYPE C VALUE '0' ,                  " exchange rate
            DOC_TYPE(02)   TYPE C VALUE 'SA',                  " Doc Type
            BUS_AREA(04)   TYPE C VALUE '0106',                " bus area
            TEXT_HEAD(25)  TYPE C VALUE 'Tax Calc. for CC consump.',
                                                         "#EC NOTEXT   V05
          END OF IS_CONST.
    for holding data of the table T900X.
    DATA : IS_ZAFGTCR001 TYPE ZAFGTCR001.
    *DATA:  BEGIN OF BDC OCCURS 1000.       " BDC table
           INCLUDE STRUCTURE BDCDATA.     " structure for BDC file
    *DATA:  END OF BDC.                     " end of BDC table
    DATA : IS_BDC TYPE BDCDATA,
           IT_BDC LIKE STANDARD TABLE OF IS_BDC.
    *DATA:
      W_BUKRS             LIKE BSIS-BUKRS VALUE '0001',
      W_KOSTL             LIKE BSIS-KOSTL,
      W_VALID_DATA        TYPE C,
      W_TAX_AMOUNT        LIKE BSIS-MWSTS," Tax amount
      W_CR_ACCOUNT        LIKE BSIS-HKONT," Credit Account #
      W_REC_COUNT         TYPE I,
      W_POST_DATE(8)      TYPE C,
      W_PRE_ACCOUNT(10)   TYPE C.
      w_rpt_type         TYPE c.
    W_PRE_AMOUNT(16)    TYPE C.
    DATA:
       W_BUKRS             TYPE BUKRS VALUE C_COMP_CODE,
       W_KOSTL             TYPE KOSTL,
       W_VALID_DATA        TYPE C,
       W_TAX_AMOUNT        TYPE MWSTS,                                  " Tax amount
       W_CR_ACCOUNT        TYPE HKONT,                                  " Credit Account #
       W_REC_COUNT         TYPE I,
       W_POST_DATE(8)      TYPE C,
       W_PRE_ACCOUNT(10)   TYPE C.
      w_rpt_type          type c.
    W_PRE_AMOUNT(16)    TYPE C.
    Data declarations for finding shipt-customer state tax rate
    *DATA:   MSEG_WEMPF LIKE KNA1-KUNNR,                                "V05
           T3(80).                                                    "V05
    Data declarations for finding shipt-customer state tax rate
    DATA:   MSEG_WEMPF TYPE KUNNR,                                      "V05
            T3(80)     TYPE C.                                          "V05
    **begin V07
    *CONSTANTS: c_TCODE1(03) VALUE 'VL%',
    **CONSTANTS: TCODE1(04) VALUE 'VL01',                                "V05
              TCODE2(04) VALUE 'VL02',                                "V05
    **end V07
    *begin V07
    *CONSTANTS: C_TCODE1(03) TYPE C VALUE 'VL%',
    *CONSTANTS: TCODE1(04) VALUE 'VL01',                                "V05
              TCODE2(04) VALUE 'VL02',                                "V05
    *end V07
    **start of pcr 9558
              CON_LAND1 LIKE KNA1-LAND1 VALUE 'US'.
    **end of pcr 9558
    *start of pcr 9558
              CON_LAND1 TYPE LAND1 VALUE 'US'.
    *end of pcr 9558
    Internal table for KNA1 records                                   V05
    *DATA : BEGIN OF T_KNA1 OCCURS 0,                                   "V05
              KUNNR LIKE KNA1-KUNNR,                                  "V05
              LAND1 LIKE KNA1-LAND1,                                  "V05
              REGIO LIKE KNA1-REGIO,                                  "V05
          END OF T_KNA1.                                              "V05
    Internal table for KNA1 records                                   V05
    DATA : IS_KNA1 TYPE KNA1,
           IT_KNA1 LIKE STANDARD TABLE OF IS_KNA1.
    For holding data for tables T001B,CSKT.
    DATA : IS_T001B TYPE T001B,
           IS_CSKT TYPE CSKT.
    For holding Error Data
    DATA : BEGIN OF IS_FINAL_ERROR ,
              COST_CENTER(10) TYPE C,
              KTEXT TYPE KTEXT,
              AMOUNT          TYPE DMBTR,                               " amount
              EXT_AMOUNT   TYPE DMBTR,
              BUKRS           TYPE BUKRS,                               " company code    V05
              BELNR           TYPE BELNR_D,                             " document number V05
              GJAHR           TYPE GJAHR,                               " fiscal year     V05
              KUNNR           TYPE KUNNR,                               " customer        V05
              COUNTRY(3)      TYPE C,                                   " country
              REGION(3)       TYPE C,                                   " region/state
              WAERS           TYPE WAERS,                               " CURRENCY KEY    UPG45B
              MESSAGE(60)     TYPE C,                                   " message         V05
          END OF IS_FINAL_ERROR,
          IT_FINAL_ERROR LIKE STANDARD TABLE OF IS_FINAL_ERROR.
    For ALV Gird
    DATA : IT_FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV,
           IS_FIELDCATALOG TYPE SLIS_FIELDCAT_ALV,
           GD_REPID     TYPE SY-REPID,
           TIME TYPE SY-UZEIT.
                           INITIALIZATION
    INITIALIZATION.
      PERFORM INIT_POST_DATE.              " Initial posting date for open
      " fiscal period
                     AT SELECTION-SCREEN
    AT SELECTION-SCREEN ON P_NETAMT.       " Validate Net amount is > 0
      IF P_NETAMT < 0 OR P_NETAMT > 1.                          " and < 1.
        MESSAGE E999 WITH TEXT-003.
      ENDIF.
                    START-OF-SELECTION.
    START-OF-SELECTION.
      PERFORM AUTH_CHECK.
      PERFORM RETRIEVE_DATA.
      PERFORM TAX_CALCULATION.
      DESCRIBE TABLE IT_JV_ITEM LINES W_REC_COUNT.
      IF W_REC_COUNT > 0.
        PERFORM PROCESS_BDC.
      ELSE.
       WRITE: / TEXT-014.
      ENDIF.
                     end of selection
    END-OF-SELECTION.
      PERFORM ERROR_REPORT.
                           Subroutines
    FORM INIT_POST_DATE.             " find allowable (open) fiscal period
    Find last day of first open period determined from t001b
    fill key fields with : fy variant  =  'AM'
                         : fiscal year =  fiscal year from t001b
                         : fiscal per  =  fiscal per  from t001b
    *DATA: W_OPEN_PERIOD    LIKE BKPF-MONAT.
      DATA : L_OPEN_PERIOD    TYPE MONAT,
             L_BUDAT_LOW      TYPE BUDAT,
             L_BUDAT_HIGH     TYPE BUDAT.
             SELECT * FROM T001B WHERE
                      RRCTY EQ '0'            AND
                      BUKRS EQ W_BUKRS        AND
                      MKOAR EQ CONST-MKOAR.
             ENDSELECT.
             IF SY-SUBRC NE 0.
               MESSAGE E999 WITH TEXT-001 W_BUKRS CONST-MKOAR.
             ENDIF.
             W_OPEN_PERIOD = T001B-FRPE1.
      SELECT * FROM T001B
               INTO IS_T001B
               WHERE RRCTY EQ C_REC_TYPE     AND
                     BUKRS EQ W_BUKRS        AND
                     MKOAR EQ IS_CONST-MKOAR.
      ENDSELECT.
      IF SY-SUBRC NE 0.
        MESSAGE E999 WITH TEXT-001 W_BUKRS IS_CONST-MKOAR.
      ENDIF.
      L_OPEN_PERIOD = IS_T001B-FRPE1.
    CALL FUNCTION 'PERIOD_DAY_DETERMINE'
          EXPORTING
               I_GJAHR              = T001B-FRYE1
               I_MONAT              = W_OPEN_PERIOD
               I_PERIV              = CONST-PERIV
          IMPORTING
               E_FDAY               = S_BUDAT-LOW       " First day
               E_LDAY               = S_BUDAT-HIGH      " Last day
          EXCEPTIONS
               ERROR_PERIOD         = 01
               ERROR_PERIOD_VERSION = 02
               FIRSTDAY_NOT_DEFINED = 03
               PERIOD_NOT_DEFINED   = 04.
    IF SY-SUBRC <> 0.
       MESSAGE E999 WITH TEXT-002 : CONST-PERIV W_OPEN_PERIOD T001B-FRYE1.
    ENDIF.
      CALL FUNCTION 'PERIOD_DAY_DETERMINE'
        EXPORTING
          I_GJAHR              = IS_T001B-FRYE1
          I_MONAT              = L_OPEN_PERIOD
          I_PERIV              = IS_CONST-PERIV
        IMPORTING
          E_FDAY               = S_BUDAT-LOW            " First day
          E_LDAY               = S_BUDAT-HIGH           " Last day
        EXCEPTIONS
          ERROR_PERIOD         = 01
          ERROR_PERIOD_VERSION = 02
          FIRSTDAY_NOT_DEFINED = 03
          PERIOD_NOT_DEFINED   = 04.
      IF SY-SUBRC <> 0.
        MESSAGE E999 WITH TEXT-002 : IS_CONST-PERIV L_OPEN_PERIOD IS_T001B-FRYE1.
      ENDIF.
      APPEND S_BUDAT.
    ENDFORM.                    "INIT_POST_DATE
    *&      Form  AUTH_CHECK
    FORM AUTH_CHECK.
    AUTHORITY-CHECK OBJECT 'ZAZBATCH'
                     ID 'P_GROUP'  FIELD '*'
                     ID 'P_ACTION' FIELD '*'
                     ID 'ACTVT'    FIELD '*'.
    IF SY-SUBRC <> 0.
       MESSAGE E999 WITH TEXT-990 SY-REPID.
    ENDIF.
    ENDFORM.                    "AUTH_CHECK
          FORM RETRIEVE_DATA                                            *
          retrieves data frome BSIS                                     *
    FORM RETRIEVE_DATA.
    select * from bsis client specified
       where   hkont = p_hkont and
               bukrs = p_bukrs and
               mandt = sy-mandt and
               budat in s_budat and
               ( blart = 'IL' or blart = 'WL' ).               " v01
    04/06/98 YTAI change select where clause  V02
    select * from bsis                                                V05
    SELECT BELNR GJAHR SHKZG DMBTR KOSTL WAERS                       "V05
            INTO (BSIS-BELNR, BSIS-GJAHR, BSIS-SHKZG, BSIS-DMBTR,     "V05
                  BSIS-KOSTL, BSIS-WAERS)                             "V05
            FROM BSIS                                                 "V05
        WHERE   HKONT = P_HKONT AND
                BUKRS = P_BUKRS AND
                BUDAT IN S_BUDAT AND
                ( BLART = 'IL' OR BLART = 'WL' ).
    end of changes
      SELECT GJAHR BELNR WAERS SHKZG DMBTR KOSTL                        "V05
             INTO CORRESPONDING FIELDS OF IS1_BSIS                      "V05
             FROM BSIS                                                  "V05
             WHERE HKONT =  P_HKONT AND
                   BUKRS =  P_BUKRS AND
                   BUDAT IN S_BUDAT AND
                   (  BLART = C_PROJ_REPOST OR BLART = C_GI_OR_GD ).
        PERFORM POPULATE_DATA.
      ENDSELECT.
    ENDFORM.                    "RETRIEVE_DATA
          FORM POPULATE_DATA                                            *
          Populate data                                                 *
    FORM POPULATE_DATA.
      W_KOSTL = BSIS-KOSTL.
    READ TABLE t_bsis WITH KEY w_kostl BINARY SEARCH.                  V05
    READ TABLE T_BSIS WITH KEY KOSTL = W_KOSTL                        "V05
                                BELNR = BSIS-BELNR                     "V05
                                GJAHR = BSIS-GJAHR                     "V05
                                BINARY SEARCH.                         "V05
    IF SY-SUBRC <> 0.                    " record not exists
       T_BSIS-KOSTL = W_KOSTL.
       T_BSIS-BELNR = BSIS-BELNR.                                      "V05
       T_BSIS-GJAHR = BSIS-GJAHR.                                      "V05
       IF BSIS-SHKZG = 'S'.
         T_BSIS-AMOUNT = BSIS-DMBTR.
       ELSE.
         T_BSIS-AMOUNT = BSIS-DMBTR * -1.
       ENDIF.
       T_BSIS-WAERS = BSIS-WAERS.         " UPG45B
       INSERT T_BSIS INDEX SY-TABIX.      " Create new record
    ELSE.                                " record exists
       IF BSIS-SHKZG = 'S'.               " Debit
         T_BSIS-AMOUNT = T_BSIS-AMOUNT + BSIS-DMBTR.
       ELSE.                              " Credit
         T_BSIS-AMOUNT = T_BSIS-AMOUNT - BSIS-DMBTR.
       ENDIF.
       MODIFY T_BSIS INDEX SY-TABIX.      " update amount
    ENDIF.
      W_KOSTL = IS1_BSIS-KOSTL.
    READ TABLE t_bsis WITH KEY w_kostl BINARY SEARCH.                  V05
      READ TABLE IT_BSIS INTO IS2_BSIS WITH KEY KOSTL = W_KOSTL         "V05
                                 BELNR = IS1_BSIS-BELNR                 "V05
                                 GJAHR = IS1_BSIS-GJAHR                 "V05
                                 BINARY SEARCH.                         "V05
      IF SY-SUBRC <> 0.                                      " record not exists
        IS2_BSIS-KOSTL = W_KOSTL.
        IS2_BSIS-BELNR = IS1_BSIS-BELNR.                                "V05
        IS2_BSIS-GJAHR = IS1_BSIS-GJAHR.                                "V05
        IF IS1_BSIS-SHKZG = C_DEBIT.
          IS2_BSIS-AMOUNT = IS1_BSIS-DMBTR.
        ELSE.
          IS2_BSIS-AMOUNT = IS1_BSIS-DMBTR * -1.
        ENDIF.
        IS2_BSIS-WAERS = IS1_BSIS-WAERS.                     " UPG45B
        INSERT IS2_BSIS INTO IT_BSIS INDEX SY-TABIX.         " Create new record
      ELSE.                                                  " record exists
        IF IS1_BSIS-SHKZG = C_DEBIT.                         " Debit
          IS2_BSIS-AMOUNT = IS2_BSIS-AMOUNT + IS1_BSIS-DMBTR.
        ELSE.                                                " Credit
          IS2_BSIS-AMOUNT = IS2_BSIS-AMOUNT - IS1_BSIS-DMBTR.
        ENDIF.
        MODIFY IT_BSIS FROM IS2_BSIS INDEX SY-TABIX.         " update amount
      ENDIF.
    ENDFORM.                    "POPULATE_DATA
          FORM TAX_CALCULATION                                          *
    *- OLD -1. validate cost center against table CSKS                    *
    V05   1. find originating material document and shipt-to in FI doc. *
          2. retrieve tax rate which is based on table T900x which is   *
             derived by country and region                              *
          3. calculate tax amount
    FORM TAX_CALCULATION.
    *CLEAR T_BSIS.
    LOOP AT T_BSIS.
       PERFORM VALIDATE_LINE_ITEM.
       IF W_VALID_DATA = 'X'.             " Valid data
    subtotal of each cost center, times net amount % and times tax rate
         W_TAX_AMOUNT = T_BSIS-AMOUNT * P_NETAMT
                          * ( T900X-TAX_RATE / 100 ).
         IF W_TAX_AMOUNT > 0.
           PERFORM SAVE_JV_ITEM USING '40' '50'.          " JV Line item
         ELSE.
           W_TAX_AMOUNT = W_TAX_AMOUNT * -1.
           PERFORM SAVE_JV_ITEM USING '50' '40'.          " JV Line item
         ENDIF.
       ENDIF.
    ENDLOOP.
      CLEAR IS2_BSIS.
      LOOP AT IT_BSIS INTO IS2_BSIS.
        PERFORM VALIDATE_LINE_ITEM.
        IF W_VALID_DATA = C_CHECK.                                 " Valid data
    subtotal of each cost center, times net amount % and times tax rate
          W_TAX_AMOUNT = IS2_BSIS-AMOUNT * P_NETAMT
    ( IS_ZAFGTCR001-TAX_RATE / 100 ).
          IF W_TAX_AMOUNT > 0.
            PERFORM SAVE_JV_ITEM USING C_DEBIT_IND C_CREDIT_IND.   " JV Line item
          ELSE.
            W_TAX_AMOUNT = W_TAX_AMOUNT * -1.
            PERFORM SAVE_JV_ITEM USING C_CREDIT_IND C_CREDIT_IND.  " JV Line item
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "TAX_CALCULATION
          FORM VALIDATE_LINE_ITEM                                       *
          validate cost center and retrieve tax rate from table t900x   *
    FORM VALIDATE_LINE_ITEM.
    DATA: BKPF_AWKEY LIKE BKPF-AWKEY.                                "V05
    CLEAR W_CR_ACCOUNT.
    V05 - start of deletion
    SELECT * FROM CSKS                   " Validate cost center
       WHERE KOKRS = P_BUKRS AND
             KOSTL = T_BSIS-KOSTL AND
             ( DATBI >= SY-DATUM AND DATAB <= SY-DATUM ) AND
             BKZKP = ' '    AND
             BKZKS = ' '    AND
             BKZER = ' '.
       EXIT.
    ENDSELECT.
    V05 - end of deletion
    V05 - start of insertion
    CLEAR MSEG_WEMPF.
    CLEAR T_KNA1.
    Read BKPF ( FI document header ) to find reference material document.
    Check original transaction was delivery create or change (VL01/VL02)
    SELECT SINGLE AWKEY INTO BKPF_AWKEY FROM BKPF
                            WHERE BUKRS = P_BUKRS
                              AND BELNR = T_BSIS-BELNR
                              AND GJAHR = T_BSIS-GJAHR
    **Begin V07
                              AND  ( TCODE = TCODE1 OR TCODE = TCODE2 ).
                         AND  TCODE like c_tcode1.
    **END V07
    IF SY-SUBRC NE 0.
        PERFORM ERROR_LOG USING TEXT-015. " not originated from SD
        EXIT.
    ENDIF.
    Read material document - only first item because the goods recipient
    will be the same even if there are multiple items - because the
    originating document was a delivery doc.
    SELECT WEMPF INTO MSEG_WEMPF FROM MSEG UP TO 1 ROWS
                                 WHERE MBLNR = BKPF_AWKEY(10)
                                   AND MJAHR = BKPF_AWKEY+10(4)
                                   AND WEMPF NE SPACE.
    ENDSELECT.
    IF SY-SUBRC NE 0.
        PERFORM ERROR_LOG USING TEXT-016. "no goods recipient
        EXIT.
    ENDIF.
    Find ship-to customer and country, state - use internal table to
    prevent redundant reads from database
    READ TABLE T_KNA1 WITH KEY KUNNR = MSEG_WEMPF BINARY SEARCH.
    if not stored yet collect and save in table
    IF SY-SUBRC NE 0.
       SELECT SINGLE KUNNR LAND1 REGIO INTO T_KNA1
                                 FROM KNA1
                                 WHERE KUNNR = MSEG_WEMPF
                                 AND LAND1 NE SPACE
                                 AND REGIO NE SPACE.
       IF SY-SUBRC NE 0.
          PERFORM ERROR_LOG USING TEXT-017. " No ship-to address
          EXIT.
       ELSE.
          INSERT T_KNA1 INDEX SY-TABIX.
       ENDIF.
    ENDIF.
    V05 - end of insertion
    V05 - start of deletion
    if sy-subrc = 0.
      if csks-land1 = space or csks-regio = space.     " check cost center
        perform error_log using text-004." address
      else.
        select single * from t900x       " retrieve tax rate
           where land1 = csks-land1 and
              regio = csks-regio.
    V05 - end of deletion
    V05 - start of insertion
    Retrieve tax rate
    SELECT SINGLE * FROM T900X
                     WHERE LAND1 = T_KNA1-LAND1
                       AND REGIO = T_KNA1-REGIO.
    V05 - end of inserting
         IF SY-SUBRC = 0.
           W_VALID_DATA = 'X'.
           W_CR_ACCOUNT = T900X-HKONT.
         ELSE.
           PERFORM ERROR_LOG USING TEXT-006.
         ENDIF.
      endif.                                                         V05
    else.                                                            V05
      perform error_log using text-005.                              V05
    endif.                                                           V05
      DATA: BKPF_AWKEY TYPE AWKEY.                                     "V05
      CLEAR W_CR_ACCOUNT.
    V05 - start of deletion
    SELECT * FROM CSKS                   " Validate cost center
       WHERE KOKRS = P_BUKRS AND
             KOSTL = T_BSIS-KOSTL AND
             ( DATBI >= SY-DATUM AND DATAB <= SY-DATUM ) AND
             BKZKP = ' '    AND
             BKZKS = ' '    AND
             BKZER = ' '.
       EXIT.
    ENDSELECT.
    V05 - end of deletion
    V05 - start of insertion
      CLEAR MSEG_WEMPF.
      CLEAR IS_KNA1.
    Read BKPF ( FI document header ) to find reference material document.
    Check original transaction was delivery create or change (VL01/VL02)
      SELECT SINGLE AWKEY INTO BKPF_AWKEY FROM BKPF
                             WHERE BUKRS = P_BUKRS
                               AND BELNR = IS2_BSIS-BELNR
                               AND GJAHR = IS2_BSIS-GJAHR
    *Begin V07
                              AND  ( TCODE = TCODE1 OR TCODE = TCODE2 ).
                          AND  TCODE LIKE C_TCODE1.
    *END V07
      IF SY-SUBRC NE 0.
        PERFORM ERROR_LOG USING TEXT-015. " not originated from SD
        EXIT.
      ENDIF.
    Read material document - only first item because the goods recipient
    will be the same even if there are multiple items - because the
    originating document was a delivery doc.

    Hi Cruz,
    I am sending you the code that i modifed and the dump . I am getting the output but when i press print button the spool is not generated but it is going to dump. When i obsered the point where it is going to dump it is the program written by SAP.
        is_FIELDCATALOG-FIELDNAME   = 'W_EXT_AMOUNT'.
        is_FIELDCATALOG-SELTEXT_M   = 'Extended Amount'.
        is_FIELDCATALOG-COL_POS     = 4.
       is_FIELDCATALOG-DO_SUM      = 'X'.
       IS_FIELDCATALOG-OUTPUTLEN   = 16.
        IS_FIELDCATALOG-DO_SUM = 'X'.
        is_FIELDCATALOG-REF_FIELDNAME     = 'WAERS'.
        is_FIELDCATALOG-REF_TABNAME     = 'T001'.
        is_FIELDCATALOG-ddictxt         = 'M'.
       IS_FIELDCATALOG-CFIELDNAME  = 'DMBTR'.
        is_fieldcatalog-ctabname = 'BSIS'.
        APPEND is_FIELDCATALOG TO it_FIELDCATALOG.
        CLEAR  is_FIELDCATALOG.
    DUMP analysis.
    What happened?
        Error in the ABAP Application Program
        The current ABAP program "SAPLKKBL" had to be terminated because
        come across a statement that unfortunately cannot be executed.
      You attempted to access an unassigned field symbol
      (data segment 95).
      This error may occur if
      - You address a typed field symbol before it has been set with
        ASSIGN
      - You address a field symbol that pointed to the line of an
        internal table that was deleted
      - You address a field symbol that was previously reset using
        UNASSIGN or that pointed to a local field that no
        longer exists
      - You address a global function interface, although the
        respective function module is not active - that is, is
        not in the list of active calls. The list of active calls
        can be taken from this short dump.
    SourceCde
    2785   case gs_out-field_colcount.
    2786     when 001.
    2787       if gs_out_flags-slave ne 'X'.
    2788         assign <fm01> to <field>.
    2789         gs_fc = gs_mfc01.
    2790       else.
    2791         assign <fs01> to <field>.
    2792         gs_fc = gs_sfc01.
    2793       endif.
    2794     when 002.
    2795       if gs_out_flags-slave ne 'X'.
    2796         assign <fm02> to <field>.
    2797         gs_fc = gs_mfc02.
    2798       else.
    2799         assign <fs02> to <field>.
    2800         gs_fc = gs_sfc02.
    2801       endif.
    2802     when 003.
    2803       if gs_out_flags-slave ne 'X'.
    2804         assign <fm03> to <field>.
    2805         gs_fc = gs_mfc03.
    2806       else.
    2807         assign <fs03> to <field>.
    2808         gs_fc = gs_sfc03.
    2809       endif.
    2810     when 004.
    2811       if gs_out_flags-slave ne 'X'.
    <b>>>>>         assign <fm04> to <field>.</b>2813         gs_fc = gs_mfc04.
    2814       else.
    2815         assign <fs04> to <field>.
    2816         gs_fc = gs_sfc04.
    2817       endif.

  • Document Split for Currency Exchange while posting Incoming payment

    Hi Experts,
    Scenario:
    > Post incoming Customer payments using F-28
    > posting entered today (14 Jan 2009), but posting date is 30 Dec 2008)
    > Tested in Clients 001 and 005 (same setup in terms of GLs, Customers, Vendors, etc)
    I was able to post the incoming payment in Client 005.  However, in Client 001, I got error message:
    *Ex.rate diff.accts are incomplete for account 0000140000 (Trade Debtors/Customers) currency SGD
    Message no. F5063
    Diagnosis
    The accounts for posting exchange rate differences could not be determined. For the specified G/L account and the specified currency key, the accounts are only specified incompletely. Either the accounts for the implemented exchange rate difference, the accounts for the valuation differences or the balance sheet adjustment account are missing.
    System Response
    The system cannot generate the exchange rate difference posting.
    Procedure
    By pressing ENTER, you achieve that the document is reset to a status without automatic posting. In another window, you can complete default settings for exchange rate differences and post the document afterwards.
    Proceed*
    When I clicked Proceed, the system took me to OBA1, with "Document Split for Currency Exchange" option highlighted in blue.
    Does this mean that I need to create a new GL account to post Document Split for Currency Exchange?
    Note: Setup for OBA1 both 001 and 005 are the same. But I only encountered the error in 001.
    Hope someone can help me.
    Thanks...

    problem solved: add relevant Open Item GLs in OBA1 (Account Determination for OI Exchange Rate Differences)

  • 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

  • Commit for every 1000 records in  Insert into select statment

    Hi I've the following INSERT into SELECT statement .
    The SELECT statement (which has joins ) has around 6 crores fo data . I need to insert that data into another table.
    Please suggest me the best way to do that .
    I'm using the INSERT into SELECT statement , but i want to use commit statement for every 1000 records .
    How can i achieve this ..
    insert into emp_dept_master
    select e.ename ,d.dname ,e.empno ,e.empno ,e.sal
       from emp e , dept d
      where e.deptno = d.deptno       ------ how to use commit for every 1000 records .Thanks

    Smile wrote:
    Hi I've the following INSERT into SELECT statement .
    The SELECT statement (which has joins ) has around 6 crores fo data . I need to insert that data into another table.Does the another table already have records or its empty?
    If its empty then you can drop it and create it as
    create your_another_table
    as
    <your select statement that return 60000000 records>
    Please suggest me the best way to do that .
    I'm using the INSERT into SELECT statement , but i want to use commit statement for every 1000 records .That is not the best way. Frequent commit may lead to ORA-1555 error
    [url http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:275215756923]A nice artical from ASKTOM on this one
    How can i achieve this ..
    insert into emp_dept_master
    select e.ename ,d.dname ,e.empno ,e.empno ,e.sal
    from emp e , dept d
    where e.deptno = d.deptno       ------ how to use commit for every 1000 records .
    It depends on the reason behind you wanting to split your transaction into small chunks. Most of the time there is no good reason for that.
    If you are tying to imporve performance by doing so then you are wrong it will only degrade the performance.
    To improve the performance you can use APPEND hint in insert, you can try PARALLEL DML and If you are in 11g and above you can use [url http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_parallel_ex.htm#CHDIJACH]DBMS_PARALLEL_EXECUTE to break your insert into chunks and run it in parallel.
    So if you can tell the actual objective we could offer some help.

  • Struggling with Comma for an amount in sap script

    Hi Experts
    I am strugling with comma for an amount in sap script .
    For ex: 1234.56  and i need 1,234.56
    I tried  system->userprofile->owndata->Default(Tab)->Decima Notation 1,234,567..89(Selected)
    and i did use /:Edit Mask Field name  but i am not getting comma.
    Thanks & Regards
    Reddy

    Hello,
    In the driver program, assign the amount to a variable of type P and use that variable to display in the script. You will get the commas.
    Vikranth

  • Decimal Places for Currencies

    Impact on the processes of change at MM decimals for Currencies.
    We want to use foreign currency to 6 decimals anand two decimal places for the currency of society

    Dear José Luis Flores ,
    Please always make sure your business process not reach the limitation of overflow during
    the conversion as the Price it is always with 11 characters with 2 Decimal place (9,2) in standard.
    All together 13 characters.
    If this limitation was reached, you will received the dump message. This is normal and you had to
    make sure it suits your business requirement in the beginning to avoid any changes later . You
    had to plan it before do this type of customizing in very beginning.
    Thanks
    Ian

  • Changing decimal places for currencies

    Hi everyone,
    I'm a complete begginer to SAP BI and I need to change a value in SPRO > General Settings > Currencies > Set Decimal Places for Currencies, but the option that I want doesn't exist.
    I need to add a new entry with the value: currency - EUR6 and decimals 6, but there is no 6 available. Can anyone tell me where can I add this or what is the table where this information is???
    Thanks in advance!
    Rogério Brá

    ok I think it works - just try and play
    This is what I did (sort of same scenario - if you get my drift)
    Currency Key MGF - translation ratio 1000:1
    Exchange rate is : 11:02750 to the Euro
    Invoice entered for 1,000,000.00
    Currency calculated as 90.68 eur
    (ie 1,000,000/(11.02750 * 1000))
    You can play aroudn with direct/indirect to ge the factors right
    But it works (I thought it did - I am qualified FICO honest!!)
    This wont get you around displaying 6 decimals - BUT it will help with currency conversion

  • Question about decimal places for currencies

    hi ,experts ,
       here is the problem , when i use mb5s, i found the net price has been enlarged 1000 times . I  also found the data of the table EKPO has been enlarged 1000 times. So ,i check the decimal places for currencies , i found there are five decimal places , the standard system is two decimal places . 
       Does this mean that we cann't  change the decimal places in SAP?  If we can change , what should we do for configuration ? 
    Jarod

    When running OY04, you are receivingin the following message:
    Before you continue, please read the following        
    text carefully.                                       
    If you do not heed this note, you can cause
    irreparable damage to the system with this            
    transacton.                                           
    In the R/3 System tables currency fields are          
    stored as decimal figures with a variable number      
    of decimal places. The decimal point is not           
    stored in the field in the database. Instead,         
    each currency field refers to a currency key          
    field. In this transaction you assign the number      
    of decimal places to this currency key uniquely.      
    Example: If you have set currency USD to have         
    two decimal places and you post an amount of 100      
    USD, an amount of 10000 USD is stored in the          
    Do you want to change the decimal places despite      
    all recommendations?

  • Changing Decimal Places for Currencies (Table V_TCURX)

    The instance is ECC 6.0
    We need to change the decimal places for a currency from 0 to 2 decimal places. Is there any impacts of doing that?
    Also need to add some currencies which are not in the table. Is there anything need to be careful while doing this. If this table is updated, do we need to update any other tables also which may be impacted?

    Hi,
    It is not recommended that when postings have already been made, that a change in the currency be done, as amounts posted can become invalid or incorrect as a result (ie USD 100->1.00), which is most critical in production environment Please go through the note 137626 When you made changes via OY04, the effect of which is across all clients.
    To change the number of decimal places for a currency already in use, you must convert all the tables in the R/3 System that contain currency fields, so that the data integrity remains. This cannot, however, for both organizational reasons and under the runtime aspect, in a productive system.
    You must never change decimal places in a productive system if you have documents posted with this currency. Such a change could lead to inconsistencies in these documents already posted.
    In case you really decide to use decimals you may consider to use SAP conversion services for them to convert all documents aready posted as explained in note 434349.
    Additional inforamtion:
    Note No.  137626 - FAQ: Decimal places for currency codes
                     126857 - Display of amts with correct decimal places in SE16
                       53206 - Processing of currency fields
                         9574 - Currency fields on selection screens
    Regards
    Ravinagh Boni

  • Defining rates for currency in Travel Management

    Hi All,
    Can anyone please advise me how to define rates for currencies in Travel management module ?
    Scenario : When i return from a trip to US, I enter my claims in USD which shud be then converted into INR and then shud be posted to FI.
    Please advise where the rates can be defined for the same.
    Also, how to have the accurate rate everyday..............
    Regards,
    Reema

    Thanks Ram for the hepful answer. Can u please advise if the rates have to be maintained manually everytime or it can be done from the system.
    Please advise.

  • Search help for currency field

    I am not able any search help for currency field , CUKY of lenght 5
    If anyone knows it please tell

    You can use the data element WAERS / refer to field BKPF-WAERS.  The search help will show up automatically as the field BKPF-WAERS, has check table TCURC.
    Also see the "Origin of Input help" column in "Entry help/ check" tab in SE11 for table BKPF, it says - "Input help implemented with check table".
    For example in tcode FB01, the currency field on the selection screen is BKPF-WAERS. The search help is displayed
    Hope it helps

Maybe you are looking for

  • JMS message selector

    hi there, any one used JMS message selector field in the JMS sender adapter. I want to filter out messages that are relevant for various interfaces. where do i set the filter value. i read java docs, it says the filter is possible for message header

  • HELP!!!! How to get Pages on both users!

    I downloaded and paid for pages under my husband's username but when I went to mine, the pages app is still under trial! How do I get the app to function properly under both usernames? Or do I have to pay for it twice? Please help!!

  • FCP to ProTools LE

    I am trying to export a Quicktime movie from FinalCut Pro v6.0.5 that contains 16-tracks of audio; I have set up the Sequence Settings in FCP to output to 16 different channels, but get errors code when doing so: "The current audio device does not su

  • ISU function module bapi_utilinstallation_chanfact

    hi, i hv to use bapi_utilinstallation_chanfact to replace due date field BIS in ETTIFN table to the sy-datum.what are the parameters that i hv to pass & which table should i pass(i am currently passing it the AMOUNTTABLE structure).what parameters hv

  • HTTP response code 401 when trying to import webservice

    Hi, I've created a Webservice how descripted in http://help.sap.com/saphelp_erp2005/helpdata/de/24/186440bdd39a0ae10000000a155106/content.htm. Now I try to import it in NWDS. I followed the step by step guide "81 Using a Web Service as External Servi