Currencies Formating and Validations

hi All,
I'm using ADF BC, JDev11g, Window XP, IE7.
My use case:
I'm having a table which has details in first facet, in the second facet there is a form which displays the contents of selected row in a form. In this form there are few fields like Currency and Local Currency. Once i enter the currency and tab out it should format into the form like US format or Indian Format. Also display the equivalent of the number in the local currency field.
Here my Currency is USD and Local Currency is Indian Rupee. How can i achieve this condition?
Also what are the supported formats for currency in ADF BC.
All inputs are useful and would be appreciated,
Thanks In Advance,
-Jyothi

Please give some suggestion. Its very important to make that validation and conversion.
-Jyothi

Similar Messages

  • Formatting and Validation Options for a Form:  go()  versus call()

    Hello.
    Under a Form's "Formatting and Validation Options," the screen says:
    "On successful submission of a form, execute this PL/SQL block or PL/SQL procedure:
    Hint: You can redirect your browser to a PL/SQL procedure, for example a procedure that creates a Web page, using either of these methods:
    call('<url>', '<parameter name for back url>');
    Redirects the browser to the procedure and passes a parameter containing the URL back to the form.
    go('<url>');
    Redirects the browser to the procedure but does not pass a URL to return to the form."
    I can get the go() procedure to work but not the call(). Here are the particulars:
    1. I created a simple page.
    2. I created a Form and placed it on the page.
    3. I have PL/SQL code added to the "On successful submission of a form..." section of the Form so that when the user enters a transaction this code executes.
    4. Unfortunately, the go() procedure redisplays the Form but not the underlying page.
    I'm guessing (hoping) that if I can properly format the call() procedure instead, it will successfully display the underlying page and this Form. But no matter how I format the second parameter of the call() procedure I get the error "HTTP 400 Bad Request" "The web page cannot be found"
    Can anyone provide a simple, working example for the call() procedure? Thanks for any insight.

    Hello.
    Under a Form's "Formatting and Validation Options," the screen says:
    "On successful submission of a form, execute this PL/SQL block or PL/SQL procedure:
    Hint: You can redirect your browser to a PL/SQL procedure, for example a procedure that creates a Web page, using either of these methods:
    call('<url>', '<parameter name for back url>');
    Redirects the browser to the procedure and passes a parameter containing the URL back to the form.
    go('<url>');
    Redirects the browser to the procedure but does not pass a URL to return to the form."
    I can get the go() procedure to work but not the call(). Here are the particulars:
    1. I created a simple page.
    2. I created a Form and placed it on the page.
    3. I have PL/SQL code added to the "On successful submission of a form..." section of the Form so that when the user enters a transaction this code executes.
    4. Unfortunately, the go() procedure redisplays the Form but not the underlying page.
    I'm guessing (hoping) that if I can properly format the call() procedure instead, it will successfully display the underlying page and this Form. But no matter how I format the second parameter of the call() procedure I get the error "HTTP 400 Bad Request" "The web page cannot be found"
    Can anyone provide a simple, working example for the call() procedure? Thanks for any insight.

  • Currency format and Right Align not working for messagetext in HGrid

    Hi
    We are dynamically enabling MessageTextinput inside HGrid region, it is Number type and when we set readonly to True it become left align, and currency format also not working, I tried the below various options but nothing is working.
    Option : 1
    OAMessageTextInputBean attribute = (OAMessageTextInputBean)webBean.findChildRecursive("Attribute"+i);
    attribute.setCurrencyCode("USD");
    Option :2
    OAWebBean amountDueBean2 = webBean.findChildRecursive("Attribute"+i);
    oracle.cabo.ui.validate.Formatter formatter2 = new OADecimalValidater("#,##0.00;(#,##0.00)","#,##0.00;(#,##0.00)");
    amountDueBean2.setAttributeValue(ON_SUBMIT_VALIDATER_ATTR, formatter2);
    etc options we tried
    amountDueBean2.setAttributeValue(CURRENCY_CODE,formatter2);
    amountDueBean2.setAttributeValue(OAWebBeanConstants.CURRENCY_CODE,"USD" );
    Please help on this issue.
    We are using Jdeveloper 10.1.3.3.0.3
    TiA
    Babu

    Anatoli,
    Hello!
    I don't know if my situation is the same as yours, but after a lot of head-scratching, forum searching and template rebuilding, I finally figured out my problem.
    I had one column that no matter what I did kept appearing in Excel as text. I'd format it to Number in Excel and nothing. When trying to sum the column, Excel would not recognize any of the values as numbers. I even did the reformatting on the XML Word template to number, and the currency format that Adam mentions. Still no go. The $ and ',' appeared, but column still formatted as string.
    I just finally noticed Adam's mention of the 2 extra spaces at the end of the numbers and sure enough mine was doing the same thing. Take out the 2 spaces and voila! Number!
    Every time I redid my template in Word (07 and 03), I used the wizard. (Add-ins>Insert>Table>Wizard) walked through the steps, not really changing anything. Then I would preview and the spaces would be there. The column that I was having problems with was the last column of the table, which would get the text 'end G_ASSIGNED_CC' inserted in after the field name - separated by 2 spaces. Once I took out these two spaces, so the column now shows 'COSTend G_ASSIGNED_CC', it worked fine in Excel - all numbers.
    Hope that helps someone out there as I was having a heck of a time finding anything (solutions anyway) on this.
    Thanks,
    Janel

  • Currency format and Regional Settings

    Is it possible for WebI reports to honor Regional Settings (client system or BO system or BO setup) and correctly handle the currency format without making any changes to the report?
    Neeraj Bhatia

    There might be a smarter way, but you could use alerters and the GetLocale() function.
    Create a new variable called, Currency Type with the formula
    =If GetLocale() InList("en_AU";"en_US") THEN "Dollar" ELSE "Euro"
    Or whatever. Then use an alerter where the "Filtered object or cell" is the Currency Type variable, and the Operand is "Dollar" then click Format... then at the top click Default next to Number Format and set the appropriate currency format.
    Add a sub-alerter to do the same for Euro, and whatever other currencies you must allow for.
    Hope that helps.

  • Number field - Format mask and validation

    APEX 4.2.1
    When a page item with source=DB column uses a Number type and a currency format mask (FML999G etc), when the page is rendered, it properly formats the number.
    The built-in Item is numeric validation appears to be handle this reasonably ok. i.e. both formatted values and only-digits both validate ok.
    But any after-submit validations choke on the non-numeric characters in the field! Please don't tell me I have to a) create shadow items and/or b) replace() out the non-numeric characters in the validation.
    After so many years and versions, why doesn't APEX have a simple, declarative, elegant solution to handle such a basic function?
    Am I missing something?
    Thanks

    As described in the item help
    "Select or enter a format mask. Note that format mask is applicable only to items of source type Database Column."
    In my experience, and this goes for the great web experience, not just the application you're designing - I've found the most data entry fields avoid formatting.
    Relevant information is often shown item labels.
    Any occasional the business has specifically asked for formatting, I've taken the same approach as I've needed to for years - before web development (and every time you use the to_date/to_char functions for date conversions) - validate the information as per expectation. If you think the user will be adding punctuation to a numeric field, then you must validate accordingly.
    This usually means adding TO_CHAR(value_entered, expected_format_mask) to your validation control, instead of presuming APEX will read the user's mind and know the content of that numeric field may not be numeric.
    Date entry does the same thing - ultimately there is a session date format that is implicitly used by Oracle to convert an entry of 12-10-2012 to the appropriate date -- ie, is it October or December?
    Have a think about the various websites you visit personally - plane bookings, concerts, ebay, etc - how many expect entry to be purely numeric? My recollection is most, except maybe some credit card fields, but most use some sort of regular expression to sort that out. And you can tell the validation is coded respectively.
    Generally, I reserve this sort of primping to reporting - even then it's made to be subtle - just like I'd prefer makeup to be ;-)
    Most users just care about the data, not how it looks.
    Scott
    blog: [url grassroots-oracle.com]grassroots-oracle.com
    twitter: [url twitter.com/swesley_perth]@swesley_perth
    -- please mark any useful posts as helpful or correct, in the end it helps us all

  • ALV output converted into PDF format and send that PDF to user through mail

    Hi Experts,
    I have report earlier its output was in alv grid.
    Now i want that ALV output converted into PDF format.And that PDF output send to user through mail.
    Can u please tell how to do?
    My code is here(output is displaying in ALV grid).
    INCLUDE <icon>.
    TYPE-POOLS: slis, kkblo.
    TABLES : zmsd_freight_hdr, zmsd_freight_det, zmsd_blinfo, zmsd_diheader.
    TABLES : lfa1.
    DATA : t_hdr   LIKE   zmsd_freight_hdr   OCCURS 0 WITH HEADER LINE,
           T_DET   LIKE   ZMSD_FREIGHT_DET   OCCURS 0 WITH HEADER LINE,
           t_bl    LIKE   zmsd_blinfo        OCCURS 0 WITH HEADER LINE,
           t_di    LIKE   zmsd_diheader      OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF t_det OCCURS 0.
            INCLUDE STRUCTURE zmsd_freight_det.
    DATA    type(30).
    DATA: END OF t_det.
    DATA: v_target2(30),
          v_zsammg LIKE t_det-zsammg,
          v_gsttotal LIKE t_det-zamount.
    DATA : BEGIN OF t_data OCCURS 0,
             zsammg       LIKE  zmsd_freight_hdr-zsammg,
             zdidbl       LIKE  zmsd_freight_hdr-zdidbl,
             zvkorg       LIKE  zmsd_freight_hdr-zvkorg,
             zinvno       LIKE  zmsd_freight_hdr-zinvno,
             zttlamt      LIKE  zmsd_freight_hdr-zttlamt,
             zstatus      LIKE  zmsd_freight_hdr-zstatus,
             ztype        LIKE  zmsd_freight_hdr-ztype,
             zconfirm     LIKE  zmsd_freight_hdr-zconfirm,
             zconfirmdate LIKE  zmsd_freight_hdr-zconfirmdate,
             erdat        LIKE  zmsd_freight_hdr-erdat,
             ernam        LIKE  zmsd_freight_hdr-ernam,
             erzet        LIKE  zmsd_freight_hdr-erzet,
             aedat(10),
             aenam        LIKE  zmsd_freight_hdr-aenam,
             aezet        LIKE  zmsd_freight_hdr-aezet,
             zline        LIKE  zmsd_freight_det-zline,
             zfptype      LIKE  zmsd_freight_det-zfptype,
             zchrcode     LIKE  zmsd_freight_det-zchrcode,
             zcurcode     LIKE  zmsd_freight_det-zcurcode,
             zqty         LIKE  zmsd_freight_det-zqty,
             zuom         LIKE  zmsd_freight_det-zuom,
             zrate        LIKE  zmsd_freight_det-zrate,
             zamount      LIKE  zmsd_freight_det-zamount,
             zexrate      LIKE  zmsd_freight_det-zexrate,
           zccode       LIKE  zmsd_blinfo-zccode,      "MADK991565
             zccode       like  ZMSD_FREIGHT_HDR-zfcode, "MADK991565
             zbldate(10),
             zbl          LIKE  zmsd_blinfo-zbl,
             type(3),
             waerk        LIKE  zmsd_freight_det-zcurcode,
             zamountl     LIKE  zmsd_freight_det-zamount,
           END OF t_data.
    DATA : w_layout      TYPE   slis_layout_alv,
           w_catalog     TYPE   slis_fieldcat_alv,
           t_catalog     TYPE   slis_t_fieldcat_alv,
           w_sort        TYPE   slis_sortinfo_alv,
           t_sort        TYPE   slis_t_sortinfo_alv.
    DATA   V_ZINVNO    like   T_HDR-ZINVNO.                   "MADK991565
    DATA : v_count  TYPE  i.
    SELECTION-SCREEN BEGIN OF BLOCK a0 WITH FRAME TITLE text-001.
    PARAMETERS     :  p_zvkorg LIKE zmsd_freight_hdr-zvkorg  OBLIGATORY .
    SELECT-OPTIONS :  s_zdidbl FOR  zmsd_freight_hdr-zdidbl             ,
                      s_zccode FOR  lfa1-lifnr                          ,
                      s_status FOR  zmsd_freight_hdr-zstatus            ,
                      s_ztype  FOR  zmsd_freight_hdr-ztype              ,
                      s_erdat  FOR  zmsd_freight_hdr-erdat              ,
                      s_ernam  FOR  zmsd_freight_hdr-ernam              ,
                      s_zconfd FOR  zmsd_freight_hdr-zconfirmdate       .
    PARAMETERS     :  p_zconf  AS   CHECKBOX                            .
    SELECTION-SCREEN END OF BLOCK a0.
    SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-002.
    PARAMETERS     :  p_hdr    RADIOBUTTON GROUP rad DEFAULT 'X'        ,
                      p_det    RADIOBUTTON GROUP rad                    .
    SELECTION-SCREEN END OF BLOCK a1.
    INITIALIZATION.
    AT SELECTION-SCREEN.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM process.
      PERFORM display.
    END-OF-SELECTION.
      PERFORM fm_get_num_pages.
    AT USER-COMMAND.
    AT LINE-SELECTION.
    TOP-OF-PAGE.
      PERFORM fm_top_of_page USING '7010' sy-title space.
    FORM get_data.
      SELECT   *
        FROM   zmsd_freight_hdr
        INTO   TABLE t_hdr
       WHERE   zvkorg        EQ  p_zvkorg
         AND   zdidbl        IN  s_zdidbl
         AND   zstatus       IN  s_status
         AND   ztype         IN  s_ztype
         AND   erdat         IN  s_erdat
         AND   ernam         IN  s_ernam
         AND   zconfirmdate  IN  s_zconfd
         AND   ZFCODE        IN  S_ZCCODE.                      "MADK991565
      IF p_zconf = 'X'.
        DELETE t_hdr WHERE zconfirm NE 'C'.
      ENDIF.
      CHECK NOT t_hdr[] IS INITIAL.
      SELECT   *
        FROM   zmsd_blinfo
        INTO   TABLE t_bl
         FOR   ALL ENTRIES IN t_hdr
       WHERE   zsammg = t_hdr-zsammg.
      SORT t_bl BY zsammg.
      SELECT   *
        FROM   zmsd_diheader
        INTO   TABLE t_di
         FOR   ALL ENTRIES IN t_hdr
       WHERE   zsammg = t_hdr-zsammg.
      SORT t_di BY zsammg.
    IF P_DET = 'X'. "MADK933361
      SELECT   *
        FROM   zmsd_freight_det
        INTO   TABLE t_det
         FOR   ALL ENTRIES IN t_hdr
       WHERE   zsammg  =  t_hdr-zsammg
       AND ZINVNO =  T_HDR-ZINVNO .                           "MADK991565
    SORT t_det BY zsammg zline.                            "MADK991565
       SORT T_DET BY ZSAMMG ZINVNO ZLINE.                     "MADK991565
    ENDIF. "MADK933361
    ENDFORM.
    FORM process.
      REFRESH t_data.
      CLEAR v_gsttotal.                                         "MADK933361
      LOOP AT t_hdr.
    Start of MADK933361
        CLEAR: v_target2.
        v_zsammg = t_hdr-zsammg.
        V_ZINVNO = T_HDR-ZINVNO.                                "MADK991565
       AT NEW zsammg.                                         "MADK991565
         AT NEW ZINVNO.                                         "MADK991565
          PERFORM get_gst_value.
        ENDAT.
    End of MADK933361
        PERFORM move_header.
        CHECK t_data-zccode IN s_zccode.
        IF p_det = 'X'.
    CSF Project Changes Starts   DEV34    MADK985782
        LOOP AT T_DET WHERE ZSAMMG = T_HDR-ZSAMMG..
          LOOP AT t_det WHERE zsammg = t_hdr-zsammg AND
                              zinvno = t_hdr-zinvno.
    CSF Project Changes Ends     DEV34    MADK985782
            PERFORM move_header.
            CHECK t_data-zccode IN s_zccode.
            MOVE-CORRESPONDING t_det TO t_data.
            t_data-zamountl = t_data-zamount * t_data-zexrate.
            APPEND t_data.
            CLEAR t_data.
          ENDLOOP.
        ELSE.
          APPEND t_data.
          CLEAR t_data.
        ENDIF.
        AT END OF zsammg.
          CLEAR v_gsttotal.
        ENDAT.
    *Start of changes for  IS090901289-PIA MADK991565
        AT END OF ZINVNO.
          CLEAR V_GSTTOTAL.
        ENDAT.
    *End of changes for  IS090901289-PIA MADK991565
      ENDLOOP.
    ENDFORM.
    FORM move_header.
      MOVE-CORRESPONDING t_hdr TO t_data.
      t_data-zttlamt = t_data-zttlamt + v_gsttotal.             "MADK933361
      t_data-waerk = 'SGD'.
      IF NOT t_hdr-aedat IS INITIAL.
        WRITE: t_hdr-aedat TO t_data-aedat.
      ELSE.
        CLEAR : t_data-aedat.
      ENDIF.
      READ TABLE t_bl WITH KEY zsammg = t_hdr-zsammg BINARY SEARCH.
      IF sy-subrc EQ 0.
      t_data-zccode  = t_bl-zccode.   "MADK991565
        T_DATA-ZCCODE = T_HDR-ZFCODE.   "MADK991565     
        IF NOT t_bl-zbldate IS INITIAL.
          WRITE: t_bl-zbldate TO t_data-zbldate.
        ENDIF.
        t_data-zbl     = t_bl-zbl.
        t_data-type    = 'DBL'.
      ELSE.
        READ TABLE t_di WITH KEY zsammg = t_hdr-zsammg BINARY SEARCH.
        IF sy-subrc EQ 0.
        t_data-zccode  = t_di-zdiforcode.     "MADK991565
          T_DATA-ZCCODE = T_HDR-ZFCODE.         "MADK991565
          t_data-type    = 'DI'.
        ENDIF.
      ENDIF.
    ENDFORM.
    FORM display.
      IF t_data[] IS INITIAL.
        MESSAGE s398(00) WITH 'No Data Selected'.
        EXIT.
      ENDIF.
      DATA : l_repid LIKE sy-repid.
      l_repid = sy-repid.
      REFRESH t_catalog.
      CLEAR   t_catalog.
      w_layout-cell_merge = 'X'.
      PERFORM map_fields.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program      = l_repid
                i_callback_user_command = 'ALV_USER_COMMAND'
                is_layout               = w_layout
                it_fieldcat             = t_catalog[]
                i_grid_title            = sy-title
                i_save                  = 'A'
                it_sort                 = t_sort[]
           TABLES
                t_outtab                = t_data
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
      IF sy-subrc <> 0.
      ENDIF.
    ENDFORM.
    FORM map_fields.
    Sort Order
      CLEAR v_count.
      PERFORM sf USING 'ZDIDBL'   'X'  'X'.
    Fields to be displayed
      CLEAR v_count.
      IF p_hdr = 'X'.
        PERFORM af USING :
       DESCRIPTION       FIELD        LEN   RTABLE             RFIELD
        'DI/DBL         ' 'ZDIDBL'     '14' '                ' '        ',
        'Type           ' 'TYPE'       '04' '                ' '        ',
        'Forwarder Code ' 'ZCCODE'     '14' '                ' '        ',
        'BL Number      ' 'ZBL'        '14' '                ' '        ',
        'BL Date        ' 'ZBLDATE'    '10' '                ' '        ',
        'Invoice Number ' 'ZINVNO'     '15' '                ' '        ',
        'Extraction     ' 'ZSTATUS'    '05' 'ZMSD_FREIGHT_HDR' 'ZSTATUS ',
        'Freight Type   ' 'ZTYPE'      '05' 'ZMSD_FREIGHT_HDR' 'ZTYPE   ',
        'Confirmation   ' 'ZCONFIRM'   '05' 'ZMSD_FREIGHT_HDR' 'ZCONFIRM',
        'Confirm Date   ' 'ZCONFIRMDATE' '10' 'ZMSD_FREIGHT_HDR'
    'ZCONFIRMDATE',
        'Total Amount   ' 'ZTTLAMT'    '18' '                ' '        ',
        'Created On     ' 'ERDAT'      '10' '                ' '        ',
        'Created By     ' 'ERNAM'      '10' '                ' '        ',
        'Changed On     ' 'AEDAT'      '10' '                ' '        ',
        'Changed By     ' 'AENAM'      '10' '                ' '        '.
      ELSE.
        PERFORM af USING :
       DESCRIPTION         FIELD     LEN   RTABLE             RFIELD
        'DI/DBL           ' 'ZDIDBL'   '14' '                ' '        ',
        'Type             ' 'TYPE'     '04' '                ' '        ',
        'Forwarder Code   ' 'ZCCODE'   '14' '                ' '        ',
        'BL Number        ' 'ZBL'      '14' '                ' '        ',
        'BL Date          ' 'ZBLDATE'  '10' '                ' '        ',
        'Invoice Number   ' 'ZINVNO'   '15' '                ' '        ',
        'Extraction       ' 'ZSTATUS'  '05' 'ZMSD_FREIGHT_HDR' 'ZSTATUS ',
        'Freight Type     ' 'ZTYPE'    '05' 'ZMSD_FREIGHT_HDR' 'ZTYPE   ',
        'Confirmation     ' 'ZCONFIRM' '05' 'ZMSD_FREIGHT_HDR' 'ZCONFIRM',
        'Confirm Date     ' 'ZCONFIRMDATE' '10' 'ZMSD_FREIGHT_HDR'
    'ZCONFIRMDATE',
        'Total Amount     ' 'ZTTLAMT'  '18' '                ' '        ',
        'Freight Payment  ' 'ZFPTYPE'  '14' '                ' '        ',
        'Charge Code      ' 'ZCHRCODE' '10' '                ' '        ',
        'Currency         ' 'ZCURCODE' '08' '                ' '        ',
        'Quantity         ' 'ZQTY'     '13' '                ' '        ',
        'UoM              ' 'ZUOM'     '04' '                ' '        ',
        'Rate             ' 'ZRATE'    '15' '                ' '        ',
        'Amt(Foreign Curr)' 'ZAMOUNT'  '16' '                ' '        ',
        'Exchange Rate    ' 'ZEXRATE'  '13' '                ' '        ',
        'Amt(Local Curr)  ' 'ZAMOUNTL' '16' '                ' '        ',
        'Created On       ' 'ERDAT'    '10' '                ' '        ',
        'Created By       ' 'ERNAM'    '10' '                ' '        ',
        'Changed On       ' 'AEDAT'    '10' '                ' '        ',
        'Changed By       ' 'AENAM'    '10' '                ' '        '.
      ENDIF.
    ENDFORM.
    FORM af USING text
                  field
                  len
                  table
                  reffield.
      v_count = v_count + 1.
      w_catalog-col_pos       = v_count.
      w_catalog-fieldname     = field.
      w_catalog-ref_tabname   = table.
      w_catalog-ref_fieldname = reffield.
      w_catalog-seltext_s     = text.
      w_catalog-seltext_m     = text.
      w_catalog-seltext_l     = text.
      w_catalog-outputlen     = len.
      IF field = 'ZTTLAMT' OR field = 'ZAMOUNTL'.
        w_catalog-no_zero     = 'X'.
        w_catalog-cfieldname  = 'WAERK'.
        w_catalog-datatype    = 'CURR'.
      ENDIF.
    IF FIELD = 'ZRATE' OR FIELD = 'ZAMOUNT'.
      IF field = 'ZAMOUNT'.
        w_catalog-no_zero     = 'X'.
        w_catalog-cfieldname  = 'ZCURCODE'.
        w_catalog-datatype    = 'CURR'.
      ENDIF.
      IF field = 'ZQTY' OR field = 'ZRATE'.
        w_catalog-no_zero     = 'X'.
        w_catalog-datatype  =  'DEC'.
      ENDIF.
      APPEND w_catalog TO t_catalog.
      CLEAR  w_catalog.
    ENDFORM.
    FORM sf    USING   fieldname  sortup  group.
      v_count = v_count + 1.
      CLEAR w_sort.
      w_sort-fieldname = fieldname.
      w_sort-spos      = v_count.
      w_sort-up        = sortup.
      w_sort-group     = group.
      APPEND w_sort TO t_sort.
    ENDFORM.
    FORM alv_user_command USING  in_ucomm    LIKE sy-ucomm
                                 in_selfield TYPE slis_selfield.
      DATA: lfs_data LIKE t_data.
      IF in_ucomm = '&IC1'.
        READ TABLE t_data INDEX in_selfield-tabindex INTO lfs_data.
        CHECK NOT lfs_data-zdidbl IS INITIAL.
        IF lfs_data-type = 'DBL'.
          DATA: l_zdbl LIKE zmsd_diheader-zdinum.
          l_zdbl = in_selfield-value.
          EXPORT l_zdbl TO MEMORY ID 'VBL'.
          CALL TRANSACTION 'ZMSD_BL01'.
        ENDIF.
        IF lfs_data-type = 'DI'.
          DATA: v_dinum LIKE zmsd_diheader-zdinum.
          v_dinum = in_selfield-value.
          EXPORT v_dinum TO MEMORY ID 'VDI'.
          CALL TRANSACTION 'ZMSD_DI01'.
        ENDIF.
      ENDIF.
    ENDFORM.
    FORM get_gst_value.
      LOOP AT t_det WHERE zsammg = v_zsammg
         AND ZINVNO = V_ZINVNO.                              "MADK991565
        CHECK t_data-zccode IN s_zccode.
        t_det-zamount  = t_det-zamount * t_det-zexrate.
        SELECT SINGLE  y0mmtarget2
                INTO   v_target2
                FROM   y0mmipstranslate
                WHERE  y0mmdatatype = '70' AND
                       y0mmsource = t_det-zchrcode.
        SELECT SINGLE y0mmtarget1
               INTO   t_det-type
               FROM   y0mmipstranslate
               WHERE  y0mmdatatype = '76' AND
                      y0mmsource = v_target2.
        IF t_det-type NE '3Z'.
          v_gsttotal    = v_gsttotal +
                               ( t_det-zamount * 5 / 100 ).
        ENDIF.
      ENDLOOP.
    Regards,
    Raj.

    Hello,
    Following is the procedure to convert alv output to spool and then it to PDF Format.
    After we display the ALV, we can check whether it is running in the background using system field u2018sy-batchu2018. Then,we call an function module named u2018GET_JOB_RUNTIME_INFOu2019 to get the current job information. Then go to spool request table tbtcp to get the spool id.
    Get current job details
      CALL FUNCTION u2018GET_JOB_RUNTIME_INFOu2019
           IMPORTING
                eventid                 = gd_eventid
                eventparm               = gd_eventparm
                external_program_active = gd_external_program_active
                jobcount                = gd_jobcount
                jobname                 = gd_jobname
                stepcount               = gd_stepcount
           EXCEPTIONS
                no_runtime_info         = 1
                OTHERS                  = 2.
    SELECT * FROM  tbtcp
                     INTO TABLE it_tbtcp
                     WHERE      jobname     = gd_jobname
                               AND jobcount = gd_jobcount
                               AND stepcount = gd_stepcount
                               AND listident <> u20180000000000u2032
                               ORDER BY   jobname
                                                   jobcount
                                                   stepcount.
      READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
    Finally, we can call function module u2018CONVERT_ABAPSPOOLJOB_2_PDFu2018 to convert spool reqeust(which is stored in OTF format) to PDF format. Then we can call either function module u2018SO_DOCUMENT_SEND_API1u2032 or SAP BCS (Business Communication Service) to send the pdf as an email attachment.
    CALL FUNCTION u2018CONVERT_ABAPSPOOLJOB_2_PDFu2019
           EXPORTING
                src_spoolid              = gd_spool_nr
                no_dialog                = c_no
                dst_device               = c_device
           IMPORTING
                pdf_bytecount = gd_bytecount
           TABLES
                pdf = it_pdf_output
           EXCEPTIONS
                err_no_abap_spooljob     = 1
                err_no_spooljob          = 2
                err_no_permission        = 3
                err_conv_not_possible    = 4
                err_bad_destdevice       = 5
                user_cancelled           = 6
                err_spoolerror           = 7
                err_temseerror           = 8
                err_btcjob_open_failed   = 9
                err_btcjob_submit_failed = 10
                err_btcjob_close_failed  = 11
                OTHERS                   = 12.
    Regards,
    Sayali
    Edited by: Sayali Paradkar on Apr 20, 2010 12:51 PM

  • Currency format in LAC

    Hi,
    We are working with LAC, and we have an issue.
    When we create an auction in SRM the currency format for the start price and the others is 1,234,567.89 (this is correct for us), but when we execute the applet (LAC) the format change 1.234.567,89
    The user in SRM has the correct format 1,234,567.89 then, Why in the applet the format is different????
    How can we change the format????
    We are working with EP then, we execute the transaction  bbp_auction since a Portal iview. Our single sign On between LAC and Portal was configurated, then we guess, we need to change the currency or number format in the Portal User, Is that correct?????
    What user do we need to change (currency format)????   SRM user????  Portal user???? LAC user????
    Thanks

    Hi Claudia,
    Check the following note :
    Note 666849 - Running LAC in non-US locales
    This may help you.
    Thanks,
    Pradeep.

  • Task Sequence Windows Server 2012 format and partition issue when using MDT2012

    Hi all,
    Currently I'm working on a task sequence to deploy a Windows Server 2012 image. We've integrated MDT2012 Update 1 in SCCM2012 SP1 and created a default 'Server Task Sequence'. This task sequence deploys the install.wim to a server which has multiple disks
    attached.
    We've configured multiple format and partition disk steps to create the following partition layout:
    Disk 0: 499MB BDEDrive (do not assign drive letter) + 40GB OSDisk
    Disk 1: 40GB Programs
    Disk 2: 40GB Data
    Disk 3: 25GB User
    When the task sequence is finished I've noticed the drive letters assigned to the disk are not correct. In some cases the BDEdrive gets drive letter D assigned, sometimes drive letters are assigned starting with E, thus skipping drive
    letter D. 
    The smsts.log files show an error when it's re-assigning drive letters after booting into Windows. Looks like an error in the DiskPartScript.txt.
    <![LOG[==============================[ OSDSetupHook.exe ]==============================]LOG]!><time="16:59:40.889-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776"
    file="osdsetuphook.cpp:186">
    <![LOG[Executing task sequence]LOG]!><time="16:59:40.905-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776" file="osdsetuphook.cpp:279">
    <![LOG[Loading the Task Sequencing Environment from "C:\_SMSTaskSequence\TSEnv.dat".]LOG]!><time="16:59:40.920-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776"
    file="basesetuphook.cpp:366">
    <![LOG[Environment scope successfully created: Global\{51A016B6-F0DE-4752-B97C-54E6F386A912}]LOG]!><time="16:59:40.936-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776"
    file="environmentscope.cpp:659">
    <![LOG[Environment scope successfully created: Global\{BA3A3900-CA6D-4ac1-8C28-5073AFC22B03}]LOG]!><time="16:59:40.936-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776"
    file="environmentscope.cpp:659">
    <![LOG[Debug shell is enabled]LOG]!><time="16:59:43.806-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776" file="basesetuphook.cpp:1440">
    <![LOG[Successfully enabled debug command shell support.]LOG]!><time="16:59:43.884-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776" file="debugwindow.cpp:156">
    <![LOG[Configuring local administrator account]LOG]!><time="16:59:43.884-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776" file="basesetuphook.cpp:1462">
    <![LOG[Re-assign all drive letters...]LOG]!><time="16:59:43.884-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776" file="diskutils.cpp:1941">
    <![LOG[Executing command line: "C:\WINDOWS\system32\diskpart.exe" /s "C:\WINDOWS\TEMP\DiskPartScript.txt"]LOG]!><time="16:59:43.900-120" date="05-10-2013" component="OSDSetupHook" context=""
    type="1" thread="776" file="commandline.cpp:827">
    <![LOG[Process completed with exit code 2147942487]LOG]!><time="16:59:50.249-120" date="05-10-2013" component="OSDSetupHook" context="" type="1" thread="776" file="commandline.cpp:1123">
    <![LOG[Diskpart.exe STDOUT:
    Microsoft DiskPart version 6.1.7601
    Copyright (C) 1999-2008 Microsoft Corporation.
    On computer: SRV03
    Volume 1 is the selected volume.
    DiskPart successfully removed the drive letter or mount point.
    The volume you selected is not valid or does not exist.
    There is no volume selected.
    ]LOG]!><time="16:59:50.249-120" date="05-10-2013" component="OSDSetupHook" context="" type="3" thread="776" file="diskutils.cpp:1807">
    When I take a look at the generated diskpart_script.log file the volume D gets selected twice, which fails the second time because of the first remove drive letter command.
    This is the output in the diskpart_script.log file:
    select volume D
    remove letter=D
    select volume D
    remove letter=D
    select volume E
    remove letter=E
    select volume F
    remove letter=F
    select volume H
    remove letter=H
    select disk 0
    select partition 1
    assign
    select disk 1
    select partition 1
    assign
    select disk 2
    select partition 1
    assign
    select disk 3
    select partition 1
    assign
    It seems this error is caused by the first 'Format and Partition Disk' step before the 'Use Toolkit Package' step which is part of the default Server Task sequence. When I disable this Format and Partition step and create the partition manually
    all looks ok showing no errors in the smsts.log file.
    I've solved this by replacing the first 'Format and Partition Disk' step by an Powershell command which formats and partitions the disk. 
    Anyone seen this behavior?

    I have a similar problem when I install windows on some clients. Have you found any explanation for the behavior?

  • How can i format and finaly mount??

    Hi guys,
    i'm trying to create an image bootable from scratch, but i fell in error right at the beginning .
    I've created an image filled by zero with
    dd if=/dev/zero of=deb.iso bs=1M count=2048
    after that i've partitioning this file with
    cfdisk deb.iso
    and the resultant partition table is
    Disk ../deb.iso: 2 GiB, 2147483648 bytes, 4194304 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x114cf359
    Device Boot Start End Sectors Size Id Type
    ../deb.iso1 * 2048 718847 716800 350M 83 Linux
    ../deb.iso2 718848 4194303 3475456 1,7G 83 Linux
    At this point i've create a block devices for each partition, so
    losetup -o $((2048*512)) /dev/loop0 ../deb.iso
    losetup -o $((718848*512)) /dev/loop1 ../deb.iso
    then i formatted it in ext4
    mkfs.ext4 /dev/loop0
    mkfs.ext4 /dev/loop1
    and until here everything goes right.
    Now i decided to mount my formatted loop devices, so
    mkdir root
    mount /dev/loop1 root
    cd root
    mkdir boot
    but when i give the command for mount the /dev/loop0, this give me back an error
    mount /dev/loop0 boot
    mount: wrong fs type, bad option, bad superblock on /dev/loop0,
    missing codepage or helper program, or other error
    In some cases useful info is found in syslog - try
    dmesg | tail or so.
    The permission of directory and the privilege for mount devices it's ok.
    I also tried mount the partition without use losetup, directly from
    mount -o loop,offset=$((2048*512)) -t ext4 ../deb.iso boot/
    or format directly the partition with
    mkfs.ext4 -E offset=$((2048*512)) deb.iso
    but always is the same.
    My dmesg said:
    [ 3123.395788] JBD2: no valid journal superblock found
    [ 3123.395796] EXT4-fs (loop0): error loading journal
    Can someone help me with this damn trouble?? Thanks you very much
    Last edited by Gianlucode (2014-12-01 12:17:26)

    How we are used to hear in computer science, Divide et impera!
    I divided my deb.iso in 3 pices using dd. Remebering the partitions table
    Gianlucode wrote:Disk ../deb.iso: 2 GiB, 2147483648 bytes, 4194304 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x114cf359
    Device Boot Start End Sectors Size Id Type
    ../deb.iso1 * 2048 718847 716800 350M 83 Linux
    ../deb.iso2 718848 4194303 3475456 1,7G 83 Linux
    I use dd in this way
    dd if=deb.img of=deb.img.mbr bs=512 skip=0 count=2048
    dd if=deb.img of=deb.img.0 bs=512 skip=2048 count=716800
    dd if=deb.img of=deb.img.1 bs=512 skip=718848
    To be sure that i haven't corrupted something i've calculeted the md5 hash of this file and the original
    cat deb.img.mbr deb.img.0 deb.img.1 | md5sum
    f33fed42eb63666d325e4fff796bfef9
    md5sum deb.img
    f33fed42eb63666d325e4fff796bfef9
    So i was able to format my partitions and then mount them
    mkfs.ext4 deb.iso.0
    mkfs.ext4 deb.iso.1
    mkdir root
    mount deb.iso.1 root
    cd root
    mkdir boot
    mount ../deb.iso.0 boot
    touch boot/test
    cd ..
    umount root/boot
    umount root
    I've reassembled the image
    cat deb.img.mbr deb.img.0 deb.img.1 > deb_final.img
    and obviously if i recalculate the md5 is different then the initaly deb.img because i formatted and wrote some file in these partitions.
    md5sum deb.img
    f33fed42eb63666d325e4fff796bfef9
    md5sum deb_final.img
    b1b5656781b28803759d46ee67c428d5
    To be sure, i've done the ultimately proof
    sudo mount -o loop,offset=$((2048*512)) deb_final.img root
    ls root
    test lost+found
    Et voilà there is the file test as i aspected.
    Now do not forget to umont the partition
    sudo umount root
    I hope that this post will be useful for someone in future. If you have other solution to the initial problem, write it below.
    Last edited by Gianlucode (2014-12-02 14:48:39)

  • New LUN Takes A long Time To Format and Errors Out

    Good afternoon,<o:p></o:p>
    I have a Hyper-V Cluster composed of 4 nodes and these nodes are able to access multiple CSVs (14 in total). I recently requested a new LUN (LUN 15)to be provisioned
    to my Hyper-V cluster in the size of 500GB. Here is my problem:<o:p></o:p>
    1. Formatting of a 500GB LUN (with quick format selected) should not take more than a few seconds. Instead, the quick format takes about 2hrs if not longer. I have actually
    seen it go for half the day.<o:p></o:p>
    2. Once the formatting has completed (no errors), taking the formatted LUN offline freezes the Computer Management screen and shows the status (Not Responding). This
    will take place for 30 minutes or less and show that the LUN has been taken offline.<o:p></o:p>
    3. In the Failover Cluster Manager, detecting the disks takes about 15 minutes. Once the available LUNs have been detected I can add the 500GB LUN to the Disks screen
    without any problems.<o:p></o:p>
    4. While in the Disks screen, adding the LUN to the Clustered Shared Volumes takes about 5 minutes (too long).<o:p></o:p>
    Already seeing that there is a problem, I went ahead and used the Hyper-V Manager to create a 200GB vhd on the new LUN which has been added to the CSV. The bar indicating
    the progress of the vhd creation does not display any progress (no green progress bar appears, not even a tiny bit of it) and after 3 hours (more or less) I receive an error, stating that the creation of the vhd failed.
    <o:p>NOTE: The vhd shows up in Volume 9 (LUN 15) but I can only bet that it will not work, plus I would not want to work with a vhd file which failed during the
    creation process.</o:p>
    <o:p>Long story short, I repeated the above steps to see if that was a temporary problem, but it is not. The same problem occurs no matter which Hyper-V cluster
    node the operations are performed on. I would like to add, that I tested the creation of a vhd on an already configured LUN and the creation was completed successfully, and within a n expected time frame.</o:p>
    NOTE: When LUN 15 errors out, it's status shows "Failed" in the Failover Cluster Manager. This in turn, causes the re-scanning of available disks to take forever (in Computer Management) and it keeps searching. Pretty
    much, the fail of one LUN affects the entire functionality of the entire Hyper-V Cluster. 
    Errors Listed In Event Details For LUN 15:
    1. Cluster Shared Volume 'Volume9' ('Cluster Disk 5') is no longer accessible from this cluster node because of error 'ERROR_TIMEOUT(1460)'. Please troubleshoot this node's connectivity to the storage device and
    network connectivity.
    Event ID: 5142; Source: Microsoft-Windows Failover Clustering;Task Category: Cluster Shared Volume
    2. Cluster Shared Volume 'Volume9' ('Cluster Disk 5') is no longer available on this node because of 'STATUS_IO_TIMEOUT(c00000b5)'. All I/O will temporarily be queued until a path to the volume is reestablished.
    Event ID: 5120; Source: Microsoft-Windows Failover Clustering;Task Category: Cluster Shared Volume
    3.Cluster resource 'Cluster Disk 5' of type 'Physical Disk' in clustered role '4530acc9-8552-4696-b6c3-636ff8d58c46' failed.
    Based on the failure policies for the resource and role, the cluster service may try to bring the resource online on this node or move the group to another node of the cluster and then restart it.  Check the resource and group state using Failover
    Cluster Manager or the Get-ClusterResource Windows PowerShell cmdlet. 
    Event ID: 1069; Source: Microsoft-Windows Failover Clustering;Task Category: Resource Control Manager
    4.
    Cluster resource 'Cluster Disk 5' (resource type 'Physical Disk', DLL 'clusres.dll') did not respond to a request in a timely fashion. Cluster health detection will attempt to automatically recover by terminating the Resource Hosting Subsystem (RHS)
    process running this resource. This may affect other resources hosted in the same RHS process. The resources will then be restarted. 
    The suspect resource 'Cluster Disk 5' will be marked to run in an isolated RHS process to avoid impacting multiple resources in the event that this resource failure occurs again. Please ensure services, applications, or underlying infrastructure
    (such as storage or networking) associated with the suspect resource is functioning properly.
    Event ID: 1230; Source: Microsoft-Windows FailoverClustering;Task Category: Resource Control Manager
    Any and all help will be appreciated!

    Hi AquilaXXIII,
    What server edition you are using? If you are using 2012r2 as cluster node, please install Recommended hotfixes and updates for Windows Server 2012 R2-based failover clusters
    update first,
    Recommended hotfixes and updates for Windows Server 2012 R2-based failover clusters
    http://social.technet.microsoft.com/Forums/en-US/f9c1a5f7-4fcf-409a-8d7e-388b85512bfe/new-lun-takes-a-long-time-to-format-and-errors-out?forum=winserv
    Before you install the new shared storage please first validation this storage first, you can refer the following KB to validation the new LUN.
    Understanding Cluster Validation Tests: Storage
    http://technet.microsoft.com/en-us/library/cc771259.aspx
    I’m glad to be of help to you!
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Help needed to display character vaiable in currency format

    Hi Friends
    In a SAP Script I am passing a currency field to the subroutine as an i/p parameter and since it gets converted to character format in subroutine because of 'itcsy' , ihave deleted the trailing zeroes and decimal points from the field and performed calculations on the field, now i need to pass this char field back to SAP script but i need to display that field in currency format with commas and decimal points in the script...how do i do that???
    Thanks
    Vishal.

    Hi Vishal,
    When you pass the currency amount into the perform, no need to remove the trailing zeros and the decimal point.
    Only thing you need to remove is the comma seperator as it gives a runtime error during calculation.
    To convert it back to the format with comma, write the below command:
    WRITE v_Item_total currency '2' to v_item_char.
    CONDENSE v_item_char.
    Here v_item_total is a number which is converted to comma seperated number and passed to char variable.
    This char variable is then passed to the SCRIPT.
    regards,
    Gaurav.

  • Export Datatable to Excel 2010 format and Save in SharePoint Document library ,and whn opening file getting error "WorkBook may be in unsupported file format "

    im converting stringwriter objec to Memory stream and saving this as .xlsx uploading file in library ,but when i try to open the file im getting error as below
    WorkBook may be in unsupported file format
    and when trying to open in excel getting message as
    Excel cannot open file  because file extention or file format is not valid .verify thet the file has not been corrupted and file extensions match file format

    May be you can use this approach:
    http://www.c-sharpcorner.com/UploadFile/pandeypradip/export-data-into-excel-in-a-pre-defined-template-using-strea/

  • How to use currency format set

    Hi All,
    I have to use currency format set to mask the amount values to their respective currencies ,
    i reviewed the Oracle XML Publisher Administration and Developer's Guide and followed all the steps mentioned there ,i m also quoting the same over here
    To define a Currency Format Set:
    1. Navigate to the Currencies page under the Administration tab. Select Create
    Currency Format Set.
    2. Enter a Name and a Code for the set. The Code is a unique identifier and cannot be
    changed later. Select Apply.
    3. The Currency Formats page will display for your newly created set.
    To add currency formats to the Currency Format Set:
    1. Select Add Currency Format to add a format to your set.
    2. Select a Currency Name from the list.
    Note: This list is generated from the FND currency table and
    should include all ISO currencies. Additional currencies can be
    added from the System Administrator responsibility.
    3. Enter the Format Mask you wish to use for this currency and select Apply.
    The Format Mask must be in the Oracle number format. The Oracle number format
    uses the components "9", "0", "D", and "G" to compose the format, for example:
    9G999D00 where
    9 represents a displayed number only if present in data
    G represents the group separator
    D represents the decimal separator
    0 represents an explicitly displayed number regardless of incoming data
    See Using the Oracle Format Mask, Oracle XML Publisher Report Designer's Guide for
    more information about these format mask components.
    After a currency format has been created, you can update or delete it from the Currency
    Formats page.
    i followed all the above step ,i need to use germany currency ,i have also used the format-currency command in my RTF template,but still its not working ,i used 9G999D00 for masking .
    Any hint would be very helpful ,thanks in advance .Please let me know if my question is not clear
    Thanks
    Pratap

    hi all
    Thanks ,this is resolved ,i just missed clearing cache ,after clearing the cache its working .
    thanks
    Pratap

  • Currency format combined with if else issue

    Hi all,
    Basically, I need to get the value from if else statement, then use currency format to format the currency according to their currency code.
    the following is my if else statement to show the A.PAY_PROMISE_AMT or A.PROMISE_AMT
    <?xdofx:if A.PAY_PROMISE_AMT <> 0 then
    A.PAY_PROMISE_AMT
    else
    A.PROMISE_AMT
    end if?>
    <?format-currency:value_*[this value I want to use is the value from the above if else statement];*currencycode; ‘false’?>
    could anyone help me to combine those two statement to get the result I want?
    Thanks in advance

    >
    I tried your solution, but I got some error.
    >
    some?
    try change
    <>to
    !=in my sample
    what if you try IF without xdofx?
    what will be result?
    say
    <?if:A.PAY_PROMISE_AMT!=0?> <?xdoxslt:set_variable($_XDOCTX, 'LVar', A.PAY_PROMISE_AMT)?> <?end if?>
    <?if:A.PAY_PROMISE_AMT=0?> <?xdoxslt:set_variable($_XDOCTX, 'LVar', A.PROMISE_AMT)?> <?end if?>
    <?format-currency: xdoxslt:get_variable($_XDOCTX, 'LVar');CURRENCY;'true'?>plz see
    Working with xdofx:if and xdoxslt variable error

  • Show Current Date in Year Format (and now - 1, etc.)

    Our form has some column headers that need to change each year, the headings are current year (2010) + previous 3 years.  Am trying to programatically add the titles to eliminate modifying the form just to change the year, but not finding how to accomplish, and was checking out some date samples found, but no success yet.  My question is 2 part - how/where do I put code, I don't need the user to enter anything, just want a column header.  This example below is where I copied the idea from a sample and tried to adjust, it's on the calculate event of a date/time field, and I get an error message that says 'the display pattern "date-{MM/DD]" is incompatible with the object's data format.  Define a compatible Display pattern.  This display pattern error is the 2nd part of the question.  How do I display only the 4 digit year?
    year1.rawValue
    = num2date(date(), "YYYY")
    How do I accomplish this - am newbie on this!  Thank you very much!

A: Show Current Date in Year Format (and now - 1, etc.)

1) I typically use a hidden field to capture the current date on the layout:ready event.
2) If year1 is a date object  your script is valid but you are probably missing the display pattern date{YYYY} on year1.
If year1 is a text field you could could capture current year in a hidden field as
// form1.page1.currentYear::ready:layout - (FormCalc, client)
$.rawValue = Num2Date(Date(), "YYYY")
where currentYear has the display pattern date{YYYY} and add
this.rawValue = form1.page1.currentYear.rawValue;
to the calculate event of year1.
Steve

1) I typically use a hidden field to capture the current date on the layout:ready event.
2) If year1 is a date object  your script is valid but you are probably missing the display pattern date{YYYY} on year1.
If year1 is a text field you could could capture current year in a hidden field as
// form1.page1.currentYear::ready:layout - (FormCalc, client)
$.rawValue = Num2Date(Date(), "YYYY")
where currentYear has the display pattern date{YYYY} and add
this.rawValue = form1.page1.currentYear.rawValue;
to the calculate event of year1.
Steve

Maybe you are looking for