NAFTA

Hi All,
I am working on Oralce 11i, and building report for Certificate of Origin, i am facing problems in that any body have that report or SQL Query please email me or post here.
Thanks,
[email protected]

Hi user567411,
did you find an answer on this question? I am experiencing the same or similar situation, so any ideas are appreciated.
Thanks,
David.

Similar Messages

  • NAFTA related- URGENT

    Dear Gurus,
    GTS Currently lists the total cost ? material cost = NAFTA originating cost. 
    This is not correct because of the way company costs in ECC.  The total cost that is brought over to GTS includes Royalties.  This can not be listed as NAFTA originating costs.  With the logic of GTS, I think the only way to get around this is to create a ?sub-cost? that will be pulled into GTS and will calculate as follows  sub-cost-material cost= NAFTA originating cost.  This is how it needs to be shown for US Customs.  Without this, we are unable to process NAFTA within GTS. 
    Thanks

    You can configure the system to exclude Royalties.. First include H008 type (Royalties and License fees) in the 'Define Custom Duty Framework'. Assign this type in the 'Exclusion Requirements for the Calculation Profile' in the configuration step 'Configure Control Data for Customs Duty Calculation'. Based on this setting, check whether you are able to get the correct Value for NAFTA requirement.

  • NAFTA Revoke functionality

    Hi There,
    I have one doubt in NAFTA revoke functionality.
    Scenario 1:
    Material was positive in the LTVD we issued; now the status is changed to negative.
    The original LTVD has to be cancelled. It is done via revoke functionality.
    This is working fine in system.
    Scenario 2:
    Material was negative in the LTVD issued; now the status is Positive.
    We need to issue customer a new LTVD with positive status.
    My doubt is whether this will come in Revoke list, the same way as above?
    (ie original signal: RED and new status:GREEN)
    HAVE ANY ONE SEEN ?
    could any one help me out?
    Thanks in advance
    Asif Mohammed

    Hi,
    Please find the solution given by SAP for the issue:
    that the desired functionality cann't be provided in GTS standard by now.
    As you can read in note 1403914:
    "A revocation always relates to a change of the preference statement
    froma positive to a negative status."
    If you need this functionality I can only provide to create a develop-
    ment request, as explained i note 1330570.

  • Nafta Country of origin

    A requirement of the North American Free Trade Agreement (Nafta) is to only include on the Nafta Certificate of Origin products that are manufactured/assembled in the United States, Canada, and/or Mexico (the rules are actually more complicated). Does Oracle have a solution to managing Nafta and country of origin requirements?

    Hi user567411,
    did you find an answer on this question? I am experiencing the same or similar situation, so any ideas are appreciated.
    Thanks,
    David.

  • NAFTA Certificate of Origin (CBP Form 434)

    I've been looking around, and I would have thought there would be a seeded report that covered this as it seems like it would be a common report/request, but is there a NAFTA Cert report hiding somewhere within Order Management or Shipping?  I think the core could be built off a shipment report, but it would require building the template and such manually, so if there's something already in existence, it would save us a lot of time of course

    I believe, it is available. Pls check under Foreign trade --> tax reporting sections in SAP ERP.

  • Sample code for sap hr program--pls treat this as urgent

    Hi ,
    This is the program on attendence incentive program, i have written
    REPORT  zhrpa0019    LINE-SIZE 270
                         LINE-COUNT  55(3)
                         NO STANDARD PAGE HEADING
                         MESSAGE-ID zm.
         T A B L E S                                                     *
    TABLES: pernr, pa2001, pa9002.
    *Type-pools
    TYPE-POOLS slis.
         I N F O T Y P E S                                               *
    INFOTYPES: 0008, 0001, 0002,2001,9002,0041.
         T Y P E S
    DATA:BEGIN OF t_data1 OCCURS 0,
           pernr LIKE pa0001-pernr,
           ename LIKE pa0001-ename,
           bukrs LIKE pa0001-bukrs,
           werks LIKE pa0001-werks,
           btrtl LIKE pa0001-btrtl,
           persg LIKE pa0001-persg,
           persk LIKE pa0001-persk,
           begda LIKE pa0001-begda,
           endda LIKE pa0001-endda,
           amount LIKE pa0008-bet01,
           cdate  LIKE pa0041-dat01,
        END OF t_data1.
         D A T A * Internal table and working area
    DATA: i_data1 LIKE   t_data1 OCCURS 0 WITH HEADER LINE.
        wa_data1 like line of t_data1 .
    DATA : BEGIN OF i_date OCCURS 0,
             pernr    LIKE   pa0041-pernr,
             cdate    LIKE   pa0041-dat01,
         END OF i_date.
    *Data : i_pa0041  like pa0041 occurs 0 with header line,
           wa_pa0041 like pa0041.
    *Data : i_p0001  like p0001 occurs 0 with header line.
    Constants
    CONSTANTS:  c_102007(6) VALUE '102007',
                c_25 TYPE p DECIMALS 1 VALUE '25.0',
                c_x VALUE 'X',
                c_a  value 'A',
                c_mcnp(4) value 'MCNP'.
    Variables
    DATA :   v_mvc  like pa0008-bet01,
           lv_bmonth    TYPE   char2,
           lv_byear     TYPE   char4,
           lv_date      TYPE   sy-datum.
    Parameters Selection
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(31) text-001.
    *PARAMETERS:: p_bmonth LIKE pv000-pabrp OBLIGATORY,
                p_byear LIKE pv000-pabrj  OBLIGATORY.
    SELECTION-SCREEN COMMENT 45(10) text-002.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS: p_mvc(2) TYPE p DECIMALS 1 DEFAULT c_25,
                p_mctype  TYPE pa2001-awart DEFAULT c_mcnp,
                p_ditype  TYPE c  DEFAULT c_a,
                rb_test RADIOBUTTON GROUP grp1 DEFAULT 'X',
                rb_prod RADIOBUTTON GROUP grp1.
    SELECTION-SCREEN END OF BLOCK b1.
    Initialization                                     *
    INITIALIZATION.
      pnpstat2-low = '3'.
      pnpstat2-sign = 'I'.
      pnpstat2-option = 'EQ'.
      APPEND pnpstat2.
      CLEAR pnpstat2.
      pnpbukrs-low = 'SATS'.
      pnpbukrs-sign = 'I'.
      pnpbukrs-option = 'EQ'.
      APPEND pnpbukrs.
      CLEAR pnpbukrs.
      pnppersg-low = 'N'.
      pnppersg-sign = 'I'.
      pnppersg-option = 'EQ'.
      APPEND pnppersg.
      CLEAR pnppersg.
      pnpbtrtl-low = '2010'.
      pnpbtrtl-high = '2050'.
      pnpbtrtl-sign = 'I'.
      pnpbtrtl-option = 'EQ'.
      APPEND pnpbtrtl.
      CLEAR pnpbtrtl.
    **Clearing the variables
    CLEAR : lv_byear, lv_bmonth,
             lv_date.
    Get previous month from current date
    CALL FUNCTION 'CCM_GO_BACK_MONTHS'
       EXPORTING
         currdate   = sy-datum
         backmonths = 1
       IMPORTING
         newdate    = lv_date.
    lv_byear = lv_date(4).
    lv_bmonth = lv_date+4(2).
    MOVE lv_bmonth TO p_bmonth.
    MOVE lv_byear TO p_byear.
    AT Selection-screen                          *
    AT SELECTION-SCREEN.
      IF rb_prod = 'X' .
        IF sy-uname NP 'HRBTCH*'.
          MESSAGE e223(zhpa).
       else.
         UPDATE  pa0015
                  SET  begda = sy-datum
                      lgart = '216D'
                       bertg = P_MVC
                WHERE pernr = p0001-pernr.
         IF SY-SUBRC EQ 0.
           message i224(zhpa).
         endif.
         COMMIT WORK.
        ENDIF.
      ENDIF.
    T O P  O F  P A G E                                          *
    TOP-OF-PAGE.
      PERFORM f_top_of_page.
    E N D  O F   P A G E                                          *
    END-OF-PAGE.
    B E G I N   S E L E C T I O N                                *
    START-OF-SELECTION.
    GET  pernr.
      pnp-sw-ignorelockedrecords = 'N'.
      PERFORM f_get_hr_data.
    E N D   S E L E C T I O N                                    *
    END-OF-SELECTION.
    sort i_data1 by werks ascending
                      btrtl ascending
                      persg ascending
                      persk ascending
                      pernr ascending.
    check for test mode.
      if rb_test = 'X'.
        clear: i_data1.
        loop at i_data1 .
         perform f_fill_bdc.
         perform f_bdc_transaction using c_pa30.
        endloop.
      endif.
      perform f_display_report.
    *&      Form  f_top_of_page
          text
    -->  p1        text
    <--  p2        text
    FORM f_top_of_page.
      WRITE: text-t11, sy-repid ,
             65 text-t12,
             150 text-t13,
             158 sy-datum.
      IF rb_test = c_x.
        WRITE:/ text-t21, sy-mandt,
               75 text-t22,
               150 text-t23,
               158 sy-uzeit.
      ELSE.
        WRITE:/ text-t21, sy-mandt,
               117 text-t24,
               150 text-t23,
               158 sy-uzeit.
      ENDIF.
      WRITE:/ text-t31, sy-uname,
             150 text-t32,
             158 sy-pagno.
      ULINE.
    ENDFORM.                    " f_top_of_page
    *&      Form  f_get_hr_data
          text
    -->  p1        text
    <--  p2        text
    FORM f_get_hr_data.
      rp-provide-from-last p0001 space pn-begda pn-endda.
      IF pnp-sw-found = 1.
        PERFORM f_get_data_pa0008.
      ENDIF.
    ENDFORM.                    " f_get_hr_data
    *&      Form  f_get_data_pa0008
          text
    -->  p1        text
    <--  p2        text
    FORM f_get_data_pa0008.
      PERFORM f_get_confirm_date.
      rp-provide-from-last p0008 space pn-begda pn-endda..
      v_mvc = p_mvc.
      IF pnp-sw-found = 1.
       i_data1-cdate = i_date-cdate.
        MOVE p0001-pernr TO i_data1-pernr.
        MOVE p0001-ename TO i_data1-ename.
        MOVE p0001-werks TO i_data1-werks.
        MOVE p0001-btrtl TO i_data1-btrtl.
        MOVE p0001-persg TO i_data1-persg.
        MOVE p0001-bukrs TO i_data1-bukrs.
        MOVE p0001-persk TO i_data1-persk.
        MOVE i_date-cdate TO i_data1-cdate.
        MOVE v_mvc   TO i_data1-amount.
        APPEND i_data1.
        CLEAR i_data1.
      ENDIF.
    ENDFORM.                    " f_get_data_pa0008
    *&      Form  f_display_report
          text
    -->  p1        text
    <--  p2        text
    FORM f_display_report.
    perform alv_display.
    *Output to a list
    data : lv_stotal(5)  type n,
             lv_utotal(5)  type n,
             lv_format.
      constants : c_l value '|'.
      clear: i_data1.
      format color col_total intensified on.
      write: /, / 'Successfully Updated to Database:'.
      write: /.
      format reset.
      uline (200).
      format color col_heading intensified off.
      write : /1 c_l no-gap, (8) 'Pnumber' no-gap,
              c_l no-gap, (35) 'Name' no-gap,
              c_l no-gap, (5) 'PA' no-gap,
              c_l no-gap, (5) 'PSA' no-gap,
              c_l no-gap, (6) 'EE Grp' no-gap,
              c_l no-gap, (9) 'EE Subgrp' no-gap,
               c_l no-gap, (12) 'Amount' no-gap,
              200 c_l.
      uline (200).
    format reset.
      loop at i_data1 .
       perform f_format_amount.
        if lv_format = 'X'.
          clear lv_format.
          format color col_normal intensified off.
        else.
          lv_format = 'X'.
          format color col_normal intensified on.
        endif.
        write :/1 c_l no-gap, (8) i_data1-pernr no-gap,
               c_l no-gap, (35) i_data1-ename no-gap,
               c_l no-gap, (5) i_data1-werks no-gap,
               c_l no-gap, (5) i_data1-btrtl no-gap,
               c_l no-gap, (6) i_data1-persg no-gap,
               c_l no-gap, (9) i_data1-persk no-gap,
               c_l no-gap , (12) i_data1-amount no-gap.
    endloop.
    ENDFORM .                    "f_display_report
    *&      Form  get_confirm_date
          text
    -->  p1        text
    <--  p2        text
    FORM f_get_confirm_date .
      rp-provide-from-last p0041  space pn-begda pn-endda.
      IF pnp-sw-found = 1.
        CLEAR i_date.
        i_date-pernr = p0041-pernr.
        APPEND i_date.
        PERFORM f_populate_date USING : p0041-pernr
                                          p0041-dar01 p0041-dat01,
                                          p0041-pernr
                                          p0041-dar02 p0041-dat02,
                                          p0041-pernr
                                          p0041-dar03 p0041-dat03,
                                          p0041-pernr
                                          p0041-dar04 p0041-dat04,
                                          p0041-pernr
                                          p0041-dar05 p0041-dat05,
                                          p0041-pernr
                                          p0041-dar06 p0041-dat06,
                                          p0041-pernr
                                          p0041-dar07 p0041-dat07,
                                          p0041-pernr
                                          p0041-dar08 p0041-dat08,
                                          p0041-pernr
                                          p0041-dar09 p0041-dat09,
                                          p0041-pernr
                                          p0041-dar10 p0041-dat10,
                                          p0041-pernr
                                          p0041-dar11 p0041-dat11,
                                          p0041-pernr
                                          p0041-dar12 p0041-dat12.
      ENDIF.
    ENDFORM.                    " get_confirm_date
    *&      Form  f_populate_date
          text
         -->P_PERNR    text
         -->P_DAR      text
         -->P_DAT      text
    FORM f_populate_date USING   p_pernr p_dar p_dat.
      CLEAR i_date.
      READ TABLE i_date WITH KEY pernr = p_pernr.
      IF sy-subrc = 0.
        IF p_dar = 'A3'.
          i_date-cdate = p_dat.
          MODIFY i_date INDEX sy-tabix.
        ENDIF.
      ENDIF.
      endform.
    i need to add the logic , could you pls help as this is very urgent.........
    IF test run = ‘X’     
         Display the report
    IF production run = ‘X’
         1. Batch user ID ‘HRBTCH*’ performed the execution.
         Create new record based on the following parameters:               
    -     PA0015-BEGDA = System Date  (date of origin)
    -     PA0015-LGART = 216D (wage type)
    -     PA0015-BETRG = IAP amount (25)
              Display the report.
         2. Program was not executed by Batch user ID ‘HRBTCH*’
              Display information message ‘Only batch user ID can run actual mode.
              Display the report
    No update will be done.
    ENDIF.
    how to addd in the above code.....

    REPORT  ZHR_ATTENDANCE_RPT MESSAGE-ID ZHR.
                     T Y P E    P O O L S                                *
    TYPE-POOLS : SLIS.
                          T A B L E                                     *
    TABLES : TEVEN,
             PA0000,
             PA0001,
             T503K,
             T500P.
              I N T E R N A L   T A B L E   D E C L A R A T I O N        *
    DATA : BEGIN OF IT_PA0001 OCCURS 0,
           PERNR TYPE PA0001-PERNR,
           ENDDA TYPE PA0001-ENDDA,
           WERKS TYPE PA0001-WERKS,
           BTRTL TYPE PA0001-BTRTL,
           ORGEH TYPE PA0001-ORGEH,
           PERSK TYPE T503T-PERSK,
           ENAME TYPE PA0001-ENAME,
           END OF IT_PA0001.
    DATA : BEGIN OF IT_PA0000 OCCURS 0,
           PERNR TYPE PA0000-PERNR,
           END OF IT_PA0000.
    DATA : BEGIN OF IT_TEVEN OCCURS 0,
           PERNR TYPE TEVEN-PERNR,
           LDATE TYPE TEVEN-LDATE,
           LTIME TYPE TEVEN-LTIME,
           SATZA TYPE TEVEN-SATZA,
           END OF IT_TEVEN.
    DATA : IT_TEVEN1 LIKE IT_TEVEN OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF IT_T527X OCCURS 0,
           ORGEH LIKE T527X-ORGEH,
           ORGTX LIKE T527X-ORGTX,
           END OF IT_T527X.
    DATA : BEGIN OF IT_T503T OCCURS 0,
           PERSK TYPE T503T-PERSK,
           PTEXT TYPE T503T-PTEXT,
           END OF IT_T503T.
    DATA : BEGIN OF IT_FINAL OCCURS 0,
           PERNR LIKE PA0001-PERNR,
           ENAME LIKE PA0001-ENAME,
           LDATE LIKE TEVEN-LDATE,
           TPROG LIKE PTPSP-TPROG,
           LTIMEI LIKE TEVEN-LTIME,
           LTIMEO LIKE TEVEN-LTIME,
           ORGTX LIKE T527X-ORGTX,
           PTEXT TYPE T503T-PTEXT,
           ATEXT TYPE ABWTXT,
           END OF IT_FINAL.
    DATA : IT_PTPSP LIKE PTPSP OCCURS 0 WITH HEADER LINE.
    *Table to get Holiday
    DATA : IT_ISCAL_DAY LIKE ISCAL_DAY OCCURS 0 WITH HEADER LINE.
    DATA : IT_T554T TYPE T554T OCCURS 0 WITH HEADER LINE.
    *ALV data declarations
    DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV,
          X_FIELDCATALOG TYPE SLIS_FIELDCAT_ALV,
          GD_LAYOUT    TYPE SLIS_LAYOUT_ALV,
          GD_REPID     LIKE SY-REPID.
    *For ALV Events
    DATA : IT_EVENT1 TYPE SLIS_T_EVENT.
    *For ALV Events
    DATA : IT_EVENT TYPE SLIS_ALV_EVENT.
    *For ALV top of page
    DATA : IT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
    *For top of page heading
    DATA : IT_LINE TYPE SLIS_LISTHEADER.
    Variables declaration                                         *
    DATA : V_SHIFT LIKE PTPSP-TPROG,
           V_TEMP TYPE I,
           V_DATE TYPE DATUM,
           V_LDATE TYPE SY-DATUM,
           V_MODIF TYPE HIDENT,
           V_SUBTY TYPE PA2002-SUBTY,
           V_ENDDA TYPE CHAR10.
    SELECTION SCREEN                                              *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS : S_PERNR FOR TEVEN-PERNR,
                     S_DATE  FOR TEVEN-LDATE no-extension,
                     S_ORGEH FOR PA0001-ORGEH,
                     S_WERKS FOR PA0001-WERKS,
                     S_BTRTL FOR PA0001-BTRTL,
                     S_PERSK FOR PA0001-PERSK,
                     S_STAT2 FOR PA0000-STAT2.
    SELECTION-SCREEN END OF BLOCK B1.
               A T   S E L E C T I O N   S C R E E N                     *
    *validatating Selection Screen
    AT SELECTION-SCREEN ON S_PERNR.
    *Validate the User entered year
      PERFORM VALIDATE_PERNR.
    AT SELECTION-SCREEN ON S_DATE.
    *Validate the User entered date
      PERFORM VALIDATE_DATE_LOW.
    AT SELECTION-SCREEN ON S_ORGEH.
    *Validate the User entered year
      PERFORM VALIDATE_ORGEH.
    AT SELECTION-SCREEN ON S_PERSK.
    *Validate the User entered year
      PERFORM VALIDATE_PERSK.
    AT SELECTION-SCREEN ON S_WERKS.
    *Validate the User entered Personnel area
      PERFORM VALIDATE_WERKS.
    START OF SELECTION                                             *
    START-OF-SELECTION.
    *Get data
      PERFORM GET_DATA.
    *Process data
      PERFORM PROCESS_DATA.
                  E N D    O F     S E L E C T I O N                    *
    END-OF-SELECTION.
      PERFORM BUILD_FIELDCATALOG.
      PERFORM BUILD_LAYOUT.
    *For ALV Events
      PERFORM ALV_EVENTS.
      PERFORM DISPLAY_ALV_REPORT.
    *&      Form  VALIDATE_YEAR
          Validating the year
    FORM VALIDATE_PERNR .
      IF NOT S_PERNR IS INITIAL.
        SELECT SINGLE * FROM PA0001 WHERE PERNR IN S_PERNR.     "#EC *
        IF SY-SUBRC <> 0.
          MESSAGE E000 WITH 'Enter valid Employee Number'(002).
        ENDIF.
      ENDIF.
    ENDFORM.                    " VALIDATE_pernr
    *&      Form  VALIDATE_YEAR
          Validating the year
    FORM VALIDATE_ORGEH .
      DATA: V_ORGEH LIKE T527X-ORGEH.
      IF NOT S_ORGEH IS INITIAL.
        SELECT SINGLE ORGEH FROM T527X INTO V_ORGEH WHERE ORGEH IN S_ORGEH.
        IF SY-SUBRC <> 0.
          MESSAGE E000 WITH 'Enter Valid Organization Unit'(003).
        ENDIF.
      ENDIF.
    ENDFORM.                    " VALIDATE_orgeh
    *&      Form  GET_DATA
          Get data
    FORM GET_DATA.
      SELECT PERNR
             FROM PA0000
             INTO TABLE IT_PA0000
             WHERE PERNR IN S_PERNR
             AND   ENDDA GE S_DATE-LOW
             AND   BEGDA LE S_DATE-HIGH
             AND   STAT2 IN S_STAT2.
      IF SY-SUBRC = 0.
        DELETE ADJACENT DUPLICATES FROM IT_PA0000 COMPARING PERNR.
        SORT IT_PA0000.
      ENDIF.
      IF NOT IT_PA0000[] IS INITIAL.
        SELECT PERNR
               ENDDA
               WERKS
               BTRTL
               ORGEH
               PERSK
               ENAME
               FROM PA0001
               INTO TABLE IT_PA0001
               FOR ALL ENTRIES IN IT_PA0000
               WHERE PERNR = IT_PA0000-PERNR
               AND   ENDDA GE S_DATE-LOW
               AND   BEGDA LE S_DATE-HIGH
               AND   ORGEH IN S_ORGEH
               AND   WERKS IN S_WERKS
               AND   PERSK IN S_PERSK
               AND   BTRTL IN S_BTRTL.
        IF SY-SUBRC = 0.
          SORT IT_PA0001 BY PERNR ENDDA DESCENDING.
          DELETE ADJACENT DUPLICATES FROM IT_PA0001 COMPARING PERNR.
          SORT IT_PA0001 BY PERNR.
        ENDIF.
      ENDIF.
      IF NOT IT_PA0001[] IS INITIAL.
        SELECT PERNR
               LDATE
               LTIME
               SATZA
               FROM TEVEN
               INTO TABLE IT_TEVEN
               FOR ALL ENTRIES IN IT_PA0001
               WHERE PERNR = IT_PA0001-PERNR
               AND   SATZA = 'P10'
               AND   LDATE IN S_DATE
               AND   STOKZ NE 'X'.
        IF SY-SUBRC = 0.
          SORT IT_TEVEN BY PERNR LDATE.
        ENDIF.
      ENDIF.
      IF NOT IT_PA0001[] IS INITIAL.
    v_date = s_date-high + 1.
        SELECT PERNR
               LDATE
               LTIME
               SATZA
               FROM TEVEN
               INTO TABLE IT_TEVEN1
               FOR ALL ENTRIES IN IT_PA0001
               WHERE PERNR = IT_PA0001-PERNR
               AND   SATZA = 'P20'
               AND  ( LDATE IN S_DATE or ldate = v_date )
               AND   STOKZ NE 'X'.
        IF SY-SUBRC = 0.
          SORT IT_TEVEN1 BY PERNR LDATE.
        ENDIF.
      ENDIF.
      IF NOT IT_PA0001[] IS INITIAL.
        SELECT ORGEH
               ORGTX
               FROM T527X
               INTO TABLE IT_T527X
               FOR ALL ENTRIES IN IT_PA0001
               WHERE ORGEH = IT_PA0001-ORGEH.
        IF SY-SUBRC = 0.
          SORT IT_T527X BY ORGEH.
        ENDIF.
      ENDIF.
      IF NOT IT_PA0001[] IS INITIAL.
        SELECT PERSK
               PTEXT
               FROM T503T
               INTO TABLE IT_T503T
               FOR ALL ENTRIES IN IT_PA0001
               WHERE PERSK = IT_PA0001-PERSK
               AND   SPRSL = 'E'.
        IF SY-SUBRC = 0.
          SORT IT_T503T BY PERSK.
        ENDIF.
      ENDIF.
      SELECT *
             FROM T554T
             INTO TABLE IT_T554T
             WHERE SPRSL = 'EN'
             AND   MOABW = '40'.
    ENDFORM.                    " GET_DATA
    *&      Form  PROCESS_DATA
          Process data
    FORM PROCESS_DATA .
      V_TEMP = S_DATE-HIGH - S_DATE-LOW.
      V_TEMP = V_TEMP + 1.
      LOOP AT IT_PA0001.
        V_DATE = S_DATE-LOW.
        DO V_TEMP TIMES.
    *Get employee work schedule
          IF IT_PTPSP[] IS INITIAL.
            PERFORM GET_SCHEDULE.
          ENDIF.
    *Get holiday calendar
          IF IT_ISCAL_DAY[] IS INITIAL.
            PERFORM GET_HOLIDAY.
          ENDIF.
          CLEAR : V_SUBTY.
          SELECT SINGLE SUBTY
                        FROM PA2001
                        INTO V_SUBTY
                        WHERE PERNR = IT_PA0001-PERNR
                        AND   ENDDA GE V_DATE
                        AND   BEGDA LE V_DATE.
          IF SY-SUBRC = 0.
            READ TABLE IT_T554T WITH KEY AWART = V_SUBTY.
            IT_FINAL-ATEXT = IT_T554T-ATEXT.
          ENDIF.
          IF V_SUBTY IS INITIAL.
            SELECT SINGLE SUBTY
                          FROM PA2002
                          INTO V_SUBTY
                          WHERE PERNR = IT_PA0001-PERNR
                          AND   ENDDA GE V_DATE
                          AND   BEGDA LE V_DATE.
            IF SY-SUBRC = 0.
              IF V_SUBTY = '1000' OR V_SUBTY = '2000'.
                IT_FINAL-ATEXT = 'Training'.
              ELSEIF V_SUBTY = '3000'.
                IT_FINAL-ATEXT = 'Tour'.
              ENDIF.
            ENDIF.
          ENDIF.
    *Get the employee shift schedule for that date
          CLEAR : V_SHIFT.
          READ TABLE IT_PTPSP WITH KEY DATUM = V_DATE.
          IF SY-SUBRC = 0.
            V_SHIFT = IT_PTPSP-TPROG.
            IF IT_PTPSP-TAGTY = '1'.
              V_SHIFT = 'NOFF'.
            ENDIF.
          ENDIF.
          IF V_SHIFT = ''.
            CLEAR IT_FINAL.
            CONTINUE.
          ENDIF.
    *Check for holiday
          IT_FINAL-TPROG = V_SHIFT.
          READ TABLE IT_ISCAL_DAY WITH KEY DATE = V_DATE.
          IF SY-SUBRC = 0.
            IT_FINAL-TPROG = 'H'.
          ENDIF.
          IT_FINAL-PERNR = IT_PA0001-PERNR.
          IT_FINAL-ENAME = IT_PA0001-ENAME.
          IT_FINAL-LDATE = V_DATE.
    *To get the organization unit
          READ TABLE IT_T527X WITH KEY ORGEH = IT_PA0001-ORGEH
                                       BINARY SEARCH.
          IF SY-SUBRC = 0.
            IT_FINAL-ORGTX = IT_T527X-ORGTX.
          ENDIF.
          CLEAR IT_T503T.
          READ TABLE IT_T503T WITH KEY PERSK = IT_PA0001-PERSK
                                       BINARY SEARCH.
          IF SY-SUBRC = 0.
            IT_FINAL-PTEXT = IT_T503T-PTEXT.
          ENDIF.
    V_LDATE = v_DATE + 1.
    *To get Punch-in.
          READ TABLE IT_TEVEN WITH KEY PERNR = IT_PA0001-PERNR
                                       LDATE = V_DATE
                                       BINARY SEARCH.
          IF SY-SUBRC = 0.
            IT_FINAL-LTIMEI = IT_TEVEN-LTIME.endif.
    *To get Punch-out
            READ TABLE IT_TEVEN1 WITH KEY PERNR = IT_PA0001-PERNR
                                          LDATE = v_DATE
                                          BINARY SEARCH.
            IF SY-SUBRC = 0.
              IF IT_TEVEN1-LTIME > IT_FINAL-LTIMEI.
                IT_FINAL-LTIMEO = IT_TEVEN1-LTIME.
              ELSE.
                SELECT SINGLE LTIME
                              FROM TEVEN
                              INTO IT_FINAL-LTIMEO
                              WHERE PERNR = IT_PA0001-PERNR
                              AND   LDATE = v_DATE
                              AND   LTIME > IT_TEVEN1-LTIME
                              AND   SATZA = 'P20'
                              AND   STOKZ NE 'X'.
              ENDIF.
            ENDIF.
            IF IT_FINAL-LTIMEO IS INITIAL.
              IF V_SHIFT = 'NNIG' OR V_SHIFT = 'NAFT'..
                READ TABLE IT_TEVEN1 WITH KEY PERNR = IT_PA0001-PERNR
                                              LDATE =  V_LDATE
                                              BINARY SEARCH.
                IF SY-SUBRC = 0.
                  IT_FINAL-LTIMEO = IT_TEVEN1-LTIME.
                ENDIF.
              ENDIF.
            ENDIF.
            if ( V_SHIFT = 'NOFF' OR IT_FINAL-TPROG = 'H' )
            and it_final-ltimei is initial and it_final-ltimeo is not initial.
            clear: it_final-ltimeo.endif.
           APPEND IT_FINAL.
         ELSE.
    *If holiday or OFF or Tour or Absent
            IF V_SHIFT = 'NOFF' OR IT_FINAL-TPROG = 'H'
            or it_final-atext is not initial or
            ( it_final-ltimei is not initial and it_final-ltimeo is not initial ).
             APPEND IT_FINAL.
           ELSEIF IT_FINAL-ATEXT IS NOT INITIAL.
             APPEND IT_FINAL.
            ELSE.
              IT_FINAL-ATEXT = 'Absent'.
             APPEND IT_FINAL.
            ENDIF.
        ENDIF.
              APPEND IT_FINAL.
          CLEAR : IT_FINAL.
          V_DATE = V_DATE + 1.
        ENDDO.
        CLEAR : IT_PTPSP[],
                IT_ISCAL_DAY[].
      ENDLOOP.
      SORT IT_FINAL BY PERNR LDATE.
      LOOP AT IT_FINAL.
        TRANSLATE IT_FINAL-ATEXT TO UPPER CASE.
        MODIFY IT_FINAL INDEX SY-TABIX.
      ENDLOOP.
    ENDFORM.                    " PROCESS_DATA
    *&      Form  GET_SCHEDULE
          Get employee work schedule
    FORM GET_SCHEDULE.
      CALL FUNCTION 'HR_PERSONAL_WORK_SCHEDULE'
        EXPORTING
          PERNR         = IT_PA0001-PERNR
          BEGDA         = S_DATE-LOW
          ENDDA         = S_DATE-HIGH
        TABLES
          PERWS         = IT_PTPSP
        EXCEPTIONS
          ERROR_OCCURED = 1
          ABORT_OCCURED = 2
          OTHERS        = 3.
      IF SY-SUBRC <> 0.
       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " GET_SCHEDULE
    *&      Form  build_fieldcatalog
    FORM BUILD_FIELDCATALOG .
      X_FIELDCATALOG-COL_POS     = 1.
      X_FIELDCATALOG-FIELDNAME   = 'PERNR'.
      X_FIELDCATALOG-SELTEXT_L   = 'Personnel No'(006).
      X_FIELDCATALOG-DDICTXT = 'L'.
      APPEND X_FIELDCATALOG TO FIELDCATALOG.
      CLEAR  X_FIELDCATALOG.
      X_FIELDCATALOG-COL_POS     = 2.
      X_FIELDCATALOG-FIELDNAME   = 'ENAME'.
      X_FIELDCATALOG-SELTEXT_L   = 'Employee Name'(007).
      X_FIELDCATALOG-DDICTXT = 'L'.
      APPEND X_FIELDCATALOG TO FIELDCATALOG.
      CLEAR  X_FIELDCATALOG.
      X_FIELDCATALOG-COL_POS     = 5.
      X_FIELDCATALOG-FIELDNAME   = 'LDATE'.
      X_FIELDCATALOG-SELTEXT_L   = 'Date'(008).
      X_FIELDCATALOG-DDICTXT = 'L'.
      APPEND X_FIELDCATALOG TO FIELDCATALOG.
      CLEAR  X_FIELDCATALOG.
      X_FIELDCATALOG-COL_POS     = 6.
      X_FIELDCATALOG-FIELDNAME   = 'TPROG'.
      X_FIELDCATALOG-SELTEXT_L   = 'Planned Shift'(009).
      X_FIELDCATALOG-DDICTXT = 'L'.
      APPEND X_FIELDCATALOG TO FIELDCATALOG.
      CLEAR  X_FIELDCATALOG.
      X_FIELDCATALOG-COL_POS     = 7.
      X_FIELDCATALOG-FIELDNAME   = 'LTIMEI'.
      X_FIELDCATALOG-SELTEXT_L   = 'Attended Time-In'(010).
      X_FIELDCATALOG-DDICTXT = 'L'.
      APPEND X_FIELDCATALOG TO FIELDCATALOG.
      CLEAR  X_FIELDCATALOG.
      X_FIELDCATALOG-COL_POS     = 8.
      X_FIELDCATALOG-FIELDNAME   = 'LTIMEO'.
      X_FIELDCATALOG-SELTEXT_L   = 'Attended Time-Out'(011).
      X_FIELDCATALOG-DDICTXT = 'L'.
      APPEND X_FIELDCATALOG TO FIELDCATALOG.
      CLEAR  X_FIELDCATALOG.
      X_FIELDCATALOG-COL_POS     = 3.
      X_FIELDCATALOG-FIELDNAME   = 'ORGTX'.
      X_FIELDCATALOG-SELTEXT_L   = 'Organization Unit'(005).
      X_FIELDCATALOG-DDICTXT = 'L'.
      APPEND X_FIELDCATALOG TO FIELDCATALOG.
      CLEAR  X_FIELDCATALOG.
      X_FIELDCATALOG-COL_POS     = 4.
      X_FIELDCATALOG-FIELDNAME   = 'PTEXT'.
      X_FIELDCATALOG-SELTEXT_L   = 'Emp Subgroup'(016).
      X_FIELDCATALOG-DDICTXT = 'L'.
      APPEND X_FIELDCATALOG TO FIELDCATALOG.
      CLEAR  X_FIELDCATALOG.
      X_FIELDCATALOG-COL_POS     = 9.
      X_FIELDCATALOG-FIELDNAME   = 'ATEXT'.
      X_FIELDCATALOG-SELTEXT_L   = 'Leaves/Tours'(015).
      X_FIELDCATALOG-DDICTXT = 'L'.
      X_FIELDCATALOG-OUTPUTLEN = '25'.
      APPEND X_FIELDCATALOG TO FIELDCATALOG.
      CLEAR  X_FIELDCATALOG.
    ENDFORM.                    " build_fieldcatalog
    *&      Form  build_layout
    FORM BUILD_LAYOUT.
      GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
      GD_LAYOUT-ZEBRA = 'X'.
    ENDFORM.                    " build_layout
    *&      Form  ALV_EVENTS
          For ALV Events
    FORM ALV_EVENTS .
      IT_EVENT-NAME = 'TOP_OF_PAGE'.
      IT_EVENT-FORM = 'TOP_OF_PAGE'.
      APPEND IT_EVENT TO IT_EVENT1.
    ENDFORM.                    " ALV_EVENTS
    *&      Form TOP_OF_PAGE
          ALV TOP-OF-PAGE
    FORM TOP_OF_PAGE.                                           "#EC CALLED
      REFRESH : IT_LIST_TOP_OF_PAGE.
      CLEAR : IT_LINE.
      IT_LINE-TYP  = 'H'.
      IT_LINE-INFO = 'Attendance Report for the Period'(013).
      APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
      CONCATENATE S_DATE-LOW6(2) '.' S_DATE-LOW4(2) '.' S_DATE-LOW+0(4)
           INTO IT_LINE-INFO.
      CONCATENATE S_DATE-HIGH6(2) '.'  S_DATE-HIGH4(2) '.' S_DATE-HIGH+0(4) INTO V_ENDDA.
      CONCATENATE IT_LINE-INFO '-' V_ENDDA INTO IT_LINE-INFO SEPARATED BY SPACE.
      APPEND IT_LINE TO IT_LIST_TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = IT_LIST_TOP_OF_PAGE.
    ENDFORM.                               "TOP_OF_PAGE
    *&      Form  display_alv_report
    FORM DISPLAY_ALV_REPORT.
      GD_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM = GD_REPID
          IT_EVENTS          = IT_EVENT1
          IS_LAYOUT          = GD_LAYOUT
          IT_FIELDCAT        = FIELDCATALOG
        TABLES
          T_OUTTAB           = IT_FINAL
        EXCEPTIONS
          PROGRAM_ERROR      = 1
          OTHERS             = 2.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "display_alv_report
    *&      Form  VALIDATE_PERSK
          text
    -->  p1        text
    <--  p2        text
    FORM VALIDATE_PERSK .
      IF NOT S_PERSK IS INITIAL.
        SELECT SINGLE * FROM T503K WHERE PERSK IN S_PERSK.      "#EC *
        IF SY-SUBRC <> 0.
          MESSAGE E000 WITH 'Enter valid Employee subgroup'(012).
        ENDIF.
      ENDIF.
    ENDFORM.                    " VALIDATE_PERSK
    *&      Form  VALIDATE_WERKS
          Validate user Entered Personnel area
    FORM VALIDATE_WERKS .
      IF S_WERKS[] IS NOT INITIAL.
        SELECT SINGLE * FROM T500P WHERE PERSA IN S_WERKS.
        IF SY-SUBRC <> 0.
          MESSAGE E000 WITH 'Enter valid Personnel Area'(014).
        ENDIF.
      ENDIF.
    ENDFORM.                    " VALIDATE_WERKS
    *&      Form  VALIDATE_DATE_LOW
          Validate user Entered Date
    FORM VALIDATE_DATE_LOW .
      IF S_DATE-LOW IS INITIAL.
        MESSAGE E000 WITH 'Enter Date'(004).
      ENDIF.
      IF S_DATE-HIGH IS INITIAL.
        MESSAGE E000 WITH 'Enter Date'(004).
      ENDIF.
    ENDFORM.                    " VALIDATE_DATE_LOW
    *&      Form  GET_HOLIDAY
            Get Holiday
    FORM GET_HOLIDAY .
      CLEAR V_MODIF.
      SELECT SINGLE MOFID
                    FROM T001P
                    INTO V_MODIF
                    WHERE WERKS = IT_PA0001-WERKS
                    AND   BTRTL = IT_PA0001-BTRTL.
      CALL FUNCTION 'HOLIDAY_GET'
        EXPORTING
          HOLIDAY_CALENDAR           = V_MODIF
          DATE_FROM                  = S_DATE-LOW
          DATE_TO                    = S_DATE-HIGH
        TABLES
          HOLIDAYS                   = IT_ISCAL_DAY
        EXCEPTIONS
          FACTORY_CALENDAR_NOT_FOUND = 1
          HOLIDAY_CALENDAR_NOT_FOUND = 2
          DATE_HAS_INVALID_FORMAT    = 3
          DATE_INCONSISTENCY         = 4
          OTHERS                     = 5.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " GET_HOLIDAY
    <b>Reward Points if useful.</b>

  • How can I use two single-dimensional arrays-one for the titles and array

    I want to Use two single-dimensional arrays-one for the titles and one for the ID
    Could everyone help me how can i write the code for it?
    Flower
    public class Video
    public static void main(String[] args) throws Exception
    int[][] ID =
    { {145,147,148},
    {146,149, 150} };
    String[][] Titles=
    { {"Barney","True Grit","The night before Christmas"},
    {"Lalla", "Jacke Chan", "Metal"} };
    int x, y;
    int r, c;
    System.out.println("List before Sort");
    for(c =0; c< 3; ++c)
    for(r=0; r< 3; ++ r)
    System.out.println("ID:" + ID[c][r]+ "\tTitle: " + Titles[c][r]);
    System.out.println("\nAfter Sort:");
    for(c =0; c< 3; ++c)
    for(r=0; r< 3; ++ r)
    System.out.println("ID:" + ID[c][r]+ "\tTitle: " + Titles[c][r]);

    This is one of the most bizarre questions I have seen here:
    public class Video
    public static void main(String[] args) throws Exception
    int[] ID = {145,147,148, 146,149, 150};
    String[] Titles= {"Barney","True Grit","The night before Christmas", "Lalla", "Jacke Chan", "Metal"};
    System.out.println("List before Sort");
    for(int i = 0; i < Titles.length; i++)
       System.out.println("ID:" + ID[i]+ "\tTitle: " + Titles);
    System.out.println("\nAfter Sort:");
    for(int i = 0; c < Titles.length; i++)
    System.out.println("ID:" + ID[i]+ "\tTitle: " + Titles[i]);
    Generally you don't use prefix (++c) operators in you for loop. Use postfix (c++).
    Prefix means that it will increment the variable before the loop body is executed. Postfix will cause it to increment after.

  • Need help in xml

    i want to know how to parse an xml doc using javax.xml.parsers
    i have written a simple ide for java with lots of options and the software would look better if i include xml support.
    u can find the code below.
    /* Thank you for your interest in viewing the source of Jcom */
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.jar.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.undo.*;
    import javax.swing.text.*;
    // The main Class.
    public class Jcom extends JFrame
    JTextArea t=new JTextArea();
    JTextField output;
    Font f=new Font("SansSerif",Font.PLAIN,13);
    int count=0,char_count=0,class_count=0,char_changed=0,recent_compile=0,tabinsert=0;
    String curfile,Dir="./",text,file="Untitled",Key_word="",ext="java";
    String menucomm[]={"New","Open","Save","Save as","Exit","Cut","Copy","Paste","Select All","Comment","Compile","Run","About","Shortcut List","Undo","Redo","Bookmark"};
    File o_file;
    OutputStream f1;
    MessageWindow mw=new MessageWindow("Console Window.");
    protected UndoManager undo = new UndoManager();
    static Jcom jc;
    StatusBar status;
    JProgressBar progress;
    displayProgress dp=new displayProgress("Loading in Progress.");
    JComboBox jb;
    // Constructor
    public Jcom(String title) throws Exception
    super(title);
    setVisible(true);
    //setIconImage(new ImageIcon("./images/icon.gif"));
    t.setMargin(new Insets(20,30,20,20));
    setSize(700,500);
    String vers = System.getProperty("java.version");
    if(vers.compareTo("1.1.2")>0)
    t.setDragEnabled(true); // Works only in version 1.4
    t.setAutoscrolls(true);
    t.setFont(f);
    t.setLineWrap(true);
    t.setWrapStyleWord(true);
    t.setTabSize(6);
    Dimension dim=getToolkit().getScreenSize();
    setLocation(dim.width/2-getWidth()/2,dim.height/2-getHeight()/2);
    setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    addWindowListener(new Winlis());
    undo.discardAllEdits();
    //main() method
    public static void main(String arg[]) throws Exception
    jc=new Jcom("JCom - The Java IDE.");
    jc.addmenu();
    jc.addtools();
    // Ask for exit
    public void askexit()
    int ch=2;
    if(char_changed==1)
    ch=JOptionPane.showOptionDialog(null,"Save Changes you made to "+file+" ?","Confirm",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,null,null);
    if(ch==0)
    save_doc();
    System.exit(0);
    public boolean save_doc()
    try
         if(file.equals("Untitled") || file==null)
              save_doc_as();
         else
         String text=t.getText();
         byte buf[]=text.getBytes();
         o_file=new File(Dir,file);
         OutputStream f1=new FileOutputStream(o_file);
         f1.write(buf);
         f1.close();
         char_changed=0;
         setTitle(file+" - JCompile");
    //setIcon(new ImageIcon("./images/icon.gif");
         catch(Exception i)
         return false;
    output.setText(file+" Total lines : "+t.getLineCount());
    return true;
    public boolean save_doc_as()
         try
         FileDialog fd=new FileDialog(this,"Save this document as",FileDialog.SAVE);
         fd.setVisible(true);
         file=fd.getFile();
         if(file==null)
         file="Untitled";
         return false;
         Dir=fd.getDirectory();
         text=t.getText();
         byte buf[]=text.getBytes();
         o_file=new File(Dir,file);
         f1=new FileOutputStream(o_file);
         f1.write(buf);
         f1.close();
         setTitle(file+" - JCompile");
         char_changed=0;
         setTitle(file+" - JCompile");
    //setIcon(new ImageIcon("./images/icon.gif");
         catch(Exception e)
         return false;
    output.setText(file+" Total lines : "+t.getLineCount());
    return true;
    public boolean compileit()
         try
         if(file.equals("Untitled"))
         if(save_doc()==false)
         return false;
         if(file==null)
         return false;
         if(char_changed==1)
         if(save_doc()==false)
         return false;
         output.setText("Compiling "+file+" ...");
         mw.jt.setText("Compiling "+file+" ..."+"\n");
         String comm="Javac.exe "+Dir+file;
         Process ps=Runtime.getRuntime().exec(comm);
         Runtime.getRuntime().gc();     
         InputStream textfile=ps.getErrorStream();
         DataInputStream dai=new DataInputStream(textfile);
         String S=dai.readLine();
         int errorcount=0;
         while(S != null)
         errorcount++;
         mw.jt.append(S+"\n");
         S=dai.readLine();
         if(errorcount==0)
              output.setText("Compilation Successful. Alt+v to Run the code.");
         else
         output.setText("Some Errors/Warnings occured during the compilation.");
         mw.setVisible(true);
         mw.setTitle("Compilation Results.");
         return false;
         }// end of try
         catch(IOException ie)
         JOptionPane.showMessageDialog(null, "Some I/O Error has occured. Please save your file and continue.", "I/O Error.",JOptionPane. ERROR_MESSAGE);
         return false;
         catch(Exception e)
         JOptionPane.showMessageDialog(null, "Exception has occured. Please save your file and continue.", "Exception.",JOptionPane. ERROR_MESSAGE);           
         return false;
         return true;
    public void run_program()
         try
         if(file==null)
         return;
         if(!mw.isVisible())
         mw.setVisible(true);
         if(char_changed==1)
         if(save_doc()==false)
         return;
         if(compileit()==false)
         return;
         mw.jt.setText("\nExecuting "+file+" ..."+"\n");
         int pos_dot=file.indexOf('.');
         char class_name[]=file.toCharArray();
         String class_name_string=new String(class_name,0,pos_dot);
         String comm="java "+class_name_string;
         Runtime ru=Runtime.getRuntime();
         Process ps=ru.exec(comm);
         InputStream textfile=ps.getErrorStream();
         Runtime.getRuntime().gc();     
         DataInputStream dai=new DataInputStream(textfile);
         String S=dai.readLine();
         if(S!=null)
         mw.jt.append("\nFollowing Runtime Error has occured.\n");
         int errorcount=0;
         while(S != null)
         errorcount++;
         mw.jt.append(S+"\n");
         S=dai.readLine();
         DataInputStream din=new DataInputStream(ps.getInputStream());
         S=din.readLine();
         errorcount=0;
         while(S != null)
         errorcount++;
         mw.jt.append(S+"\n");
         S=din.readLine();
         mw.jt.append("Execution of "+file+" has terminated."+"\n");
         output.setText("Execution completed.");
         mw.setTitle("Execution Results.");
         catch(IOException ie)
         JOptionPane.showMessageDialog(null, "Exception has occured. Please save your work and continue. ", "I/O Error",JOptionPane. ERROR_MESSAGE);           
         return;
         catch(Exception e)
         JOptionPane.showMessageDialog(null, "Exception has occured. Please save your work and continue. ", "I/O Error",JOptionPane. ERROR_MESSAGE);           
         return;
    public void addtools()
    //Adding toolbar
    JToolBar toolbar=new JToolBar();
    String[] iconfiles={"./images/new.gif","./images/open.gif","./images/save.gif","./images/cut.gif","./images/copy.gif","./images/paste.gif","./images/compile.gif","./images/run.gif"};
    jb = new JComboBox();
    jb.addActionListener(new bookListen());
    String[] butcomm={"New","Open","Save","Cut","Copy","Paste","Compile","Run"};
    ImageIcon[] icons=new ImageIcon[iconfiles.length];
    JButton[] buttons = new JButton[iconfiles.length];
    for(int i=0;i<iconfiles.length;i++)
         icons=new ImageIcon(iconfiles[i]);
         buttons[i]=new JButton(icons[i]);
         buttons[i].addActionListener(new actListen());
         buttons[i].setActionCommand(butcomm[i]);
         buttons[i].setToolTipText(butcomm[i]);
         toolbar.add(buttons[i]);
         if(i+1%3==0)
         toolbar.addSeparator();
         getContentPane().add("North",toolbar);
    status=new StatusBar();
    getContentPane().add("South",status);
    // this adds fonts support to the toolbar
    /*JComboBox jc = new JComboBox();
         String[] fonts = getToolkit().getFontList();
         for (int i = 0; i < fonts.length; i++)
         jc.addItem(fonts[i]);
         toolbar.add(jc);*/
    output=new JTextField(30);
    output.setEditable(false);
    status.add(output);
    status.add(new JLabel("Bookmarks "));
    jb.setMaximumRowCount(8);
    status.add(jb); //Add bookmark list
    validate();
    }/* End of addtools*/
    public void addmenu()
    //Adding menu Bar
    JMenuBar mb= new JMenuBar();
    setJMenuBar(mb);
    JMenuItem new1,open,save,save_as,cut,copy,paste,sel_all,und,red,find,replace,exit,about,compile,check,runit,shortcut_list,bookmark;
    // Adding contents for menu bar
    JMenu file=new JMenu("File");
    JMenu edit=new JMenu("Edit");
    JMenu search=new JMenu("Search");
    JMenu tools=new JMenu("Tools");
    JMenu make=new JMenu("Make");
    JMenu help=new JMenu("Help");
    new1=new JMenuItem("New");
    new1.setToolTipText("Create a new file.");
    new1.setIcon(new ImageIcon("./images/new.gif"));
    new1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_MASK ));
    file.add(new1);
    new1.addActionListener(new actListen());
    open=new JMenuItem("Open");
    open.setToolTipText("Open an existing file.");
    open.setIcon(new ImageIcon("./images/open.gif"));
    open.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_MASK ));
    file.add(open);
    open.addActionListener(new actListen());
    save=new JMenuItem("Save");
    save.setToolTipText("Save changes.");
    save.setIcon(new ImageIcon("./images/save.gif"));
    save.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_MASK ));
    file.add(save);
    save.addActionListener(new actListen());
    save_as=new JMenuItem("Save as");
    save_as.setToolTipText("Save changes as.");
    file.add(save_as);
    save_as.addActionListener(new actListen());
    exit=new JMenuItem("Exit");
    exit.setToolTipText("Exit.");
    exit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.ALT_MASK ));
    file.add(exit);
    exit.addActionListener(new actListen());
    exit.setIcon(new ImageIcon("./images/exit.gif"));
    mb.add(file);
    cut=new JMenuItem("Cut");
    cut.setToolTipText("Cut selection.");
    cut.setIcon(new ImageIcon("./images/cut.gif"));
    cut.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK ));
    edit.add(cut);
    cut.addActionListener(new actListen());
    copy=new JMenuItem("Copy");
    copy.setToolTipText("Copy selection.");
    copy.setIcon(new ImageIcon("./images/copy.gif"));
    copy.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK ));
    edit.add(copy);
    copy.addActionListener(new actListen());
    paste=new JMenuItem("Paste");
    paste.setToolTipText("Paste from clipboard.");
    paste.setIcon(new ImageIcon("./images/paste.gif"));
    paste.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK ));
    edit.add(paste);
    paste.addActionListener(new actListen());
    sel_all=new JMenuItem("Select All");
    sel_all.setToolTipText("Select all.");
    sel_all.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, InputEvent.CTRL_MASK ));
    edit.add(sel_all);
    sel_all.addActionListener(new actListen());
    und=new JMenuItem("Undo");
    und.setToolTipText("Undo.");
    und.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_MASK ));
    edit.add(und);
    und.addActionListener(new actListen());
    red=new JMenuItem("Redo");
    red.setToolTipText("Redo.");
    red.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, InputEvent.CTRL_MASK ));
    edit.add(red);
    red.addActionListener(new actListen());
    mb.add(edit);
    find=new JMenuItem("Find");
    search.add(find);
    find.setIcon(new ImageIcon("./images/find.gif"));
    find.addActionListener(new actListen());
    replace=new JMenuItem("Replace");
    search.add(replace);
    replace.setIcon(new ImageIcon("./images/replace.gif"));
    replace.addActionListener(new actListen());
    mb.add(search);
    JMenuItem tar_file=new JMenuItem("Create Archive");
    tools.add(tar_file);
    tar_file.addActionListener(new actListen());
    JMenuItem docu=new JMenuItem("Create Documentation");
    tools.add(docu);
    docu.addActionListener(new actListen());
    JMenuItem comment=new JMenuItem("Comment");
    comment.setToolTipText("Comment Selection.");
    tools.add(comment);
    comment.addActionListener(new actListen());
    bookmark=new JMenuItem("Bookmark");
    tools.add(bookmark);
    bookmark.addActionListener(new actListen());
    mb.add(tools);
    compile=new JMenuItem("Compile");
    compile.setToolTipText("Compile.");
    compile.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.ALT_MASK ));
    make.add(compile);
    compile.setIcon(new ImageIcon("./images/compile.gif"));
    compile.addActionListener(new actListen());
    runit=new JMenuItem("Run");
    runit.setToolTipText("Run.");
    runit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.ALT_MASK ));
    make.add(runit);
    runit.setIcon(new ImageIcon("./images/run.gif"));
    runit.addActionListener(new actListen());
    mb.add(make);
    shortcut_list=new JMenuItem("Shortcut List");
    help.add(shortcut_list);
    shortcut_list.addActionListener(new actListen());
    about=new JMenuItem("About");
    help.add(about);
    about.addActionListener(new actListen());
    mb.add(help);
    //Register with document listener.
    t.getDocument().addDocumentListener(new docListen());
    // Register with Undo Listener
    t.getDocument().addUndoableEditListener(new UndoHandler());
    //Register with Keyboard listener
    t.addKeyListener(new keyListen());
    JScrollPane scrollpane=new JScrollPane(t);
    Container cont=getContentPane();
    cont.add(scrollpane);
    validate();
    }/* End of addmenu */
    /* Frame for displaying console outputs */
    public class MessageWindow extends JFrame
    JTextArea jt;
    public MessageWindow(String title)
    super(title);
    setSize(400,400);
    //setIcon(new ImageIcon("./images/icon.gif"));
    jt =new JTextArea();
    jt.setEditable(false);
    JScrollPane scroll=new JScrollPane(jt);
    getContentPane().add(scroll);
    jt.addKeyListener(new keyListen());
    jt.addMouseListener(new mouseListen());
    validate();
    }//End of console display class
    /* Frame for displaying progress bar during an operation */
    public class displayProgress extends JFrame
    JLabel jl;
    public displayProgress(String title)
    super(title);
    setSize(300,100);
    setResizable(false);
    removeNotify();
    Dimension dim=getToolkit().getScreenSize();
    setLocation(dim.width/2-getWidth()/2,dim.height/2-getHeight()/2);
    getContentPane().setLayout(new FlowLayout(FlowLayout.CENTER,8,30));
    jl=new JLabel("Lines Loaded : ");
    progress = new JProgressBar();
    progress.setMinimum(0);
    progress.setMaximum(45);
    getContentPane().add(jl);
    getContentPane().add(progress);
    validate();
    }//End of progress display.
    public void addNew() // To add a new Book Mark
    String selectedText=t.getSelectedText();
    if(selectedText!=null)
    jb.addItem(selectedText);
    jb.showPopup();
    output.setText("Bookmark added.");
    public void remove() // To remove a Bookmark
    jb.removeAllItems();
    /* Book Mark Handler*/
    class bookListen implements ActionListener
    public void actionPerformed(ActionEvent ae)
    String search=(String)jb.getSelectedItem();
    if(search!=null)
    findString(search);
    }//End of class
    // Undo Handler
    class UndoHandler implements UndoableEditListener
         public void undoableEditHappened(UndoableEditEvent e)
              undo.addEdit(e.getEdit());
    }// undo handler
    public class keyListen extends KeyAdapter
    KeyStroke ks;
    public void keyPressed(KeyEvent ke)
    try
    ks=KeyStroke.getKeyStrokeForEvent(ke);
    String s1=KeyEvent.getKeyModifiersText(ks.getModifiers()); //s1 has modifiers like Ctrl+Alt
    String s2=KeyEvent.getKeyText(ks.getKeyCode()); //s2 has key like 'a'
    if(s2.equals("Up") || s2.equals("Down") || s2.equals("Left") || s2.equals("Right"))
    int chcount=t.getCaretPosition();
    int linecount=t.getLineOfOffset(chcount)+1;
    output.setText("Character count : "+chcount+" Line Number : "+linecount);
    boolean flag=true;
    String search;
         if(s1.equals("Ctrl+Shift")) // Required
              output.setText("Looking for Macro ...");          
              if(s2.equals("S"))
              t.insert("\tSystem.out.println(\"\");",t.getCaretPosition());
              output.setText("Macro : Insert System.out.println() method.");          
              else if(s2.equals("C")) // Create a default constructor
              if(file.equals("Untitled"))
              flag=save_doc_as();
              if(flag)
              int pos_dot=file.indexOf('.');
              char class_name[]=file.toCharArray();
              String class_name_string=new String(class_name,0,pos_dot);
              t.insert("public "+class_name_string+"()\n\t{\n\n\t}",t.getCaretPosition());
              output.setText("Macro : Insert Default Constructor.");          
              else if(s2.equals("M"))
              t.insert("\tpublic static void main(String arg[])\n\t{\n\n\t}",t.getCaretPosition());
              output.setText("Macro : Insert Main method.");          
              else if(s2.equals("T"))
              t.insert("try\n{\n\n}\n\ncatch(Exception e)\n{\n\te.printStackTrace();\n}",t.getCaretPosition());
              output.setText("Macro : Insert try-catch block.");                              }
         }// Macro check end ctrl+alt
         // Additional check using only alt.
         else if(s1.equals("Alt"))
              if(s2.equals("F"))
              search=mw.jt.getSelectedText();
              if(search!=null)
              findString(search);
         } // Alt check
    }//try
    catch(Exception e)
         output.setText("Cannot find the Error Region.");
    }// Function end
    }/* End of Keylisten */
    public void findString(String search)
    try
    boolean found=false;
              String lineToFind=search;
              if(lineToFind==null)
              return;
              for(int i=0;i<t.getLineCount();i++)
              int offset=t.getLineStartOffset(i);
              String lineInArea=t.getText(offset,lineToFind.length());
              output.setText("Currently Looking ... "+lineInArea);
              if(lineInArea.equals(lineToFind))
              t.requestFocus();
              t.select(offset,offset+lineToFind.length());
              output.setText("Required Line Detected.");
              found=true;
              break;
              }//for loop
              if(found==false)
              output.setText("Cannot find Required Line.");
              found=false;
    catch(BadLocationException be)
         output.setText("Cannot find the Error Region.");
    }// end of find error.
    //Window Listener
    public class Winlis extends WindowAdapter
    public void windowClosing(WindowEvent we)
    askexit();
    //Document Listener
    public class docListen implements DocumentListener
    public void changedUpdate(DocumentEvent de)
    try
    char_changed=1;
    setTitle(file+" <changed> - JCompile");
    //setIcon(new ImageIcon("./images/save.gif");
    int chcount=t.getCaretPosition();
    int linecount=t.getLineOfOffset(chcount)+1;
    output.setText("Character count : "+chcount+" Line Number : "+linecount);
    catch(BadLocationException be)
    output.setText("Character count : "+t.getCaretPosition());
    public void insertUpdate(DocumentEvent de)
    try
    char_changed=1;
    setTitle(file+" <changed> - JCompile");
    //setIcon(new ImageIcon("./images/save.gif");
    int chcount=t.getCaretPosition();
    int linecount=t.getLineOfOffset(chcount)+1;
    output.setText("Character count : "+chcount+" Line Number : "+linecount);
    catch(BadLocationException be)
    output.setText("Character count : "+t.getCaretPosition());
    public void removeUpdate(DocumentEvent de)
    try
    char_changed=1;
    setTitle(file+" <changed> - JCompile");
    //setIcon(new ImageIcon("./images/save.gif");
    int chcount=t.getCaretPosition();
    int linecount=t.getLineOfOffset(chcount)+1;
    output.setText("Character count : "+chcount+" Line Number : "+linecount);
    catch(BadLocationException be)
    output.setText("Character count : "+t.getCaretPosition());
    }//Document Listener
    // Action Listener
    public class actListen implements ActionListener
    //Action listener
    public void actionPerformed(ActionEvent ae)
    String str=(String)ae.getActionCommand();
    int command_number=0;
    for(int i=0;i<20;i++)
    if(str.equals(menucomm[i]))
    command_number=i;
    break;
    switch(command_number)
         case 0:
         if(char_changed==1)
         int ch=JOptionPane.showOptionDialog(null,"Save Changes you made to "+file+" ?","Confirm",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,null,null);
         if(ch==0)
         save_doc();     
         t.setText("");
         char_changed=0;
         setTitle("Untitled");
         file="Untitled";
         remove();
         undo.discardAllEdits();
         break;
         case 1:
         //open_doc();
         int ch=2;
         if(char_changed==1)
         ch=JOptionPane.showOptionDialog(null,"Save Changes you made to "+file+" ?","Confirm",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,null,null);
              if(ch==0)
              save_doc_as();
         t.setText("");
         FileDialog fd=new FileDialog(jc,"Open a file",FileDialog.LOAD);
         fd.setVisible(true);
         file=fd.getFile();
         // Support for class files also
         int pos_dot=file.indexOf('.');
         ext=file.substring(pos_dot+1,file.length());
         if(ext.equalsIgnoreCase("class")) // it is a class file
         try
         Runtime r=Runtime.getRuntime();
         String comm="jad.exe -s .java "+file;
         r.exec(comm);
         file=file.substring(0,pos_dot)+".java";
         catch(Exception e)
         output.setText("Some error has occured in Decompiling the class file.");
         Dir=fd.getDirectory();
         if(file!=null)
         Thread ofile=new openFile();
         ofile.start();
         dp.setVisible(false);
         remove();
         break;
         case 2:
         // Save
         save_doc();
         break;
         case 3:
         save_doc_as();
         break;     
         case 4:
         // Exit
         askexit();
         break;
         case 5:
         t.cut();
         break;
         case 6:
         t.copy();
         break;
         case 7:
         t.paste();
         break;
         case 8:
         t.selectAll();
         break;
         case 9: //comment
         String otext=t.getSelectedText();
         if(otext!=null)
         String ntext="/*\n"+otext+"\n*/";
         t.replaceSelection(ntext);
         break;
         case 10:
         if(char_changed==1)
         save_doc();
         output.setText("Compiling "+file+" ...");
         compileit();
         break;
         case 11:
         if(char_changed==1)
         compileit();
         if(file.equals("Untitled"))
         save_doc_as();
         compileit();
         else
         output.setText("Executing "+file+" ...");
         run_program();
         break;
         case 12: //about
         JOptionPane.showMessageDialog(null, "Jcom - IDE for Java beta 1.0.\nVisit www.geocities.com/prabhus14 for updates.", "About",JOptionPane. INFORMATION_MESSAGE);           
         break;
         case 13: //Short Cut List
         mw.setVisible(true);
    mw.setTitle("Shortcut keys List.");
         mw.jt.setText("Shortcut Keys for Jcom.\nRight now only some of them are implemented.\nIn later versions users can customise these keys(called \"macros\" in Jcom) and can also add new ones!");
         mw.jt.append("\nMacros begin with Ctrl+Shift or Alt alone.\n\n");
         mw.jt.append("Ctrl+Shift+S\tTo insert System.out.println() method.\n");
         mw.jt.append("Ctrl+Shift+C\tTo create the default constructor for your class.\n");
         mw.jt.append("Ctrl+Shift+M\tTo insert main() method.\n");
         mw.jt.append("Ctrl+Shift+T\tTo insert try-catch block.\n");
         mw.jt.append("\nThe following macro is quite different and will differentiate Jcom from any other IDE.\n");
         mw.jt.append("\nAfter compiling if you get any errors then the console window will automatically appear with the messages.\n");     
         mw.jt.append("1. Select the line in the Error Message.(using mouse of course)\n");
         mw.jt.append("2. Press Alt+F or Right Click.\n");
         mw.jt.append("3. You will see the Error Region selected in your code.\n");
         mw.jt.append("Remember you must select right from the beginning of the line.\nRead Readme.html for more guidance.\n");     
         break;
         case 14:
         if(undo.canUndo())
              undo.undo();
              output.setText(undo.getUndoPresentationName());
         break;
         case 15:
         if(undo.canRedo())
              undo.redo();
              output.setText(undo.getRedoPresentationName());
         break;
         case 16: //Bookmark
         addNew();
         break;
    }/*End of action listener*/
    }//Action Listener
    // Mouse Listener
    class mouseListen extends MouseAdapter
    String search;
    public void mouseClicked(MouseEvent me)
    String vers = System.getProperty("java.version");
    if(vers.compareTo("1.1.2")>0)
    if(me.getButton()==3)
         search=mw.jt.getSelectedText();
         if(search!=null)
         findString(search);
    }//mouse listener
    // A thread for opening file.
    protected class openFile extends Thread
    openFile()
    setPriority(7);
    public void run()
    try
         int count=0;
         File fil1=new File(Dir,file);
         dp.setVisible(true);
         int factor=(int)fil1.length()/45;
         int i=1;
         FileInputStream textfile=new FileInputStream(fil1);
         DataInputStream dai=new DataInputStream(textfile);
         String S=dai.readLine();
         count+=S.length();
         dp.jl.setText("Lines Loaded : "+i++);
         if(ext.equals("class"))
         t.setText("/* Jcom - IDE for Java.\nVisit www.geocities.com/prabhus14 for updates.\n*/\n");
         while(S != null)
         if(ext.equals("class"))
         if(i>5)
         t.append(S+"\n");
         else
         t.append(S+"\n");
         S=dai.readLine();
         count+=S.length();
         progress.setValue((int)count/factor);
         dp.jl.setText("Lines Loaded : "+i++);
         }//while
         progress.setValue(45);
         dp.setVisible(false);
         setTitle(file+" - JCompile");
         catch(Exception ie)
         dp.setVisible(false);
    output.setText(file+" Total lines : "+t.getLineCount());
    return;
    }//End of run
    }//End of thread     
    // A class simulating Status Bar
    class StatusBar extends JComponent
    public StatusBar()
         super();
         setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
    public void paint(Graphics g)
    super.paint(g);
    }//End of class StatusBar
    }/*End of class Jcom*/

    Hmm well my first reply didn't seem to make it.
    I would recommend Castor if you are talking about supporting XML to save your Java Objects. Castor is a great XML-Java data binding tool that I personally love. You can just write a map between the XML and java elements and it can marshal and unmarshal for you. JAXB (Java API fo XML Binding) can do the same thing but you have to build the classes from a schema you can't just supply a map for it (so you might have to rework your classes). If you mean that you want to edit XML directly in the IDE then you might want to look at the DOM (Document Object Model), its memory intensive though.

  • How can I query data from XML file stored as a CLOB ?

    Hi folks,
    please see below sample of XML file, which is stored in "os_import_docs", column "document" as CLOB.
    I would like to query this XML file using some SQL select.
    How can I query data form below XML?
    <?xml version="1.0" encoding="UTF-8"?>
    <etd>
      <header>
        <AR>000000000</AR>
        <AW>0</AW>
        <CT>S</CT>
        <CU>H</CU>
        <CZ>SS48</CZ>
        <BU>4</BU>
        <CH>0032</CH>
        <CK>2012-11-01</CK>
        <CL>21:18</CL>
        <CW>225</CW>
        <CX>0</CX>
        <CF>SS-CZL18</CF>
        <DV>2</DV>
      </header>
      <account_group id="234">
        <account id="234">
          <invoice id="000742024">
            <da>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>A</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>88754515</BS>
              <AD>Mike Tyson</AD>
              <AC>Mike Tyson</AC>
              <AZ>CZ6521232465</AZ>
              <AE/>
              <CG>A</CG>
              <AL>A</AL>
              <BZ>.</BZ>
              <AH>Some street</AH>
              <AI/>
              <AF>Some city</AF>
              <AK>Kraj</AK>
              <AG>CZ</AG>
              <AJ>885 21</AJ>
              <CR>21-11-2012</CR>
              <AY>602718709</AY>
              <AV>800184965</AV>
              <AP/>
              <AO/>
              <AQ/>
              <AN/>
            </da>
            <da>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>A</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>88754515</BS>
              <AD>Mike Tyson</AD>
              <AC>Mike Tyson</AC>
              <AZ>CZ6521232465</AZ>
              <AE/>
              <CG>A</CG>
              <AL>L</AL>
              <BZ>Mike Tyson</BZ>
              <AH>Some street</AH>
              <AI/>
              <AF>Some city</AF>
              <AK>Kraj</AK>
              <AG>CZ</AG>
              <AJ>885 21</AJ>
              <CR>21-11-2012</CR>
              <AY/>
              <AV>800184965</AV>
              <AP/>
              <AO/>
              <AQ/>
              <AN/>
            </da>
            <detaildc CH="0032" AB="234" BS="11888954" BB="32" BA="CZ" AT="" CI="7077329000002340342" AU="" DU="1Z48395" CB="CZK">
              <dc>
                <AW>0</AW>
                <CT>D</CT>
                <CU>C</CU>
                <BY>31-10-2012</BY>
                <CA>25-10-2012</CA>
                <CV>8151</CV>
                <BT>12111</BT>
                <CJ>1</CJ>
                <AM>0</AM>
                <DR>PC</DR>
                <DS/>
                <DO>25-10-2012</DO>
                <DQ>18:42</DQ>
                <CE>1</CE>
                <BH>8151</BH>
                <CY>8151 SHELL MALKOVICE P</CY>
                <DP>049336</DP>
                <DT/>
                <BQ/>
                <BR>500000</BR>
                <CN>30</CN>
                <CM>030</CM>
                <BO>160,00</BO>
                <BF>38,900</BF>
                <BC>6224,00</BC>
                <BI>32,417</BI>
                <CD>B</CD>
                <BG>0,600</BG>
                <BK>31,817</BK>
                <BJ>0,000</BJ>
                <DI>8</DI>
                <BP>20,00%</BP>
                <CC>CZK</CC>
                <BM>5090,67</BM>
                <BN>1018,13</BN>
                <BL>6108,80</BL>
                <BD>5090,67</BD>
                <BE>1018,13</BE>
                <DW>6108,80</DW>
                <CO>Nafta</CO>
              </dc>
            </detaildc>
            <dt>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>T</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>11888954</BS>
              <BB/>
              <BA>CZ</BA>
              <DG>1</DG>
              <CN>30</CN>
              <CM>030</CM>
              <DF>160,00</DF>
              <DH>litr</DH>
              <DJ>20,00%</DJ>
              <DD>5090,67</DD>
              <DE>1018,13</DE>
              <DC>6108,80</DC>
              <DB>CZK</DB>
              <DA>P</DA>
              <AX/>
              <CQ/>
              <CP/>
            </dt>
            <dt>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>T</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>11888954</BS>
              <BB/>
              <BA>CZ</BA>
              <DG>2</DG>
              <CN/>
              <CM/>
              <DF>160,00</DF>
              <DH>litr</DH>
              <DJ/>
              <DD>5090,67</DD>
              <DE>1018,13</DE>
              <DC>6108,80</DC>
              <DB>CZK</DB>
              <DA/>
              <AX/>
              <CQ/>
              <CP/>
            </dt>
            <dt>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>T</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>11888954</BS>
              <BB/>
              <BA>CZ</BA>
              <DG>19</DG>
              <CN/>
              <CM/>
              <DF/>
              <DH/>
              <DJ/>
              <DD>5090,67</DD>
              <DE>1018,13</DE>
              <DC>6108,80</DC>
              <DB>CZK</DB>
              <DA/>
              <AX/>
              <CQ/>
              <CP/>
            </dt>
            <dt>
              <AR>000742024</AR>
              <AW>0</AW>
              <CT>D</CT>
              <CU>T</CU>
              <CH>0032</CH>
              <BY>31-10-2012</BY>
              <CA>25-10-2012</CA>
              <AB>234</AB>
              <AA>234</AA>
              <BS>11888954</BS>
              <BB/>
              <BA>CZ</BA>
              <DG>8</DG>
              <CN/>
              <CM/>
              <DF/>
              <DH/>
              <DJ/>
              <DD>5090,67</DD>
              <DE>1018,13</DE>
              <DC>6108,80</DC>
              <DB>CZK</DB>
              <DA/>
              <AX/>
              <CQ/>
              <CP/>
            </dt>
          </invoice>
        </account>
      </account_group>
      <footer>
        <AR>999999999</AR>
        <AW>0</AW>
        <CT>S</CT>
        <CU>T</CU>
        <CZ>SS48</CZ>
        <BU>4</BU>
        <CH>0032</CH>
        <CK>2012-11-01</CK>
        <CL>23:04</CL>
        <CW>225</CW>
        <BX>1</BX>
        <CS>7</CS>
        <BW>0000000000000610880</BW>
      </footer>
    </etd>sample - not working:
        select  x.*
        from os_import_docs d
             ,XMLTABLE('/etd/header'
                        PASSING httpuritype(d.document).getXML()
                        COLUMNS
                           response_status varchar2(50) PATH 'AR'
                        )  x
       where d.object_id = 2587058
         and rownum = 1; 
    ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 6196, maximum: 4000)Many thanks,
    Tomas

    Hello,
    many thanks for the reply. Your examples are very usefull for me.
    To answer your questions.
    An XML structure:
    /etd
        /header - repeat in each row in output
        /account_group/account
            /invoice
                /da - repeat for each details under "selected "invoice
                /detaildc/dc - the lowest level 
                /detaildn/dn - the lowest level 
                /dt - repeat for each details under "selected "invoice
        /footer - repeat in each row in outputI would like to to have a 1 row for each "record" in /detaildc section and include related nodes at higher levels.
    Please see below XML file, which is simplified file of example in first post, but includes a complete xml structure which needs to be queried in db.
    <?xml version="1.0" encoding="UTF-8"?>
    <etd>
      <header>
        <AR>000000000</AR>
        <CK>2012-10-31</CK>
        <CF>SS-CZL19</CF>
      </header>
      <account_group id="234">
        <account id="234">
          <invoice id="EI08P4000">
            <da>
              <AR>EI08P4000</AR>
              <AD>Mickey Mouse</AD>
            </da>
            <detaildc DU="1Z56655" CB="EUR">
              <dc>
                <DO>16-10-2012</DO>
                <CY>ASFINAG POST_MAUT</CY>
                <BM>1940,60</BM>
                <CO>Dalnicni znamka</CO>
              </dc>
            </detaildc>
            <detaildc DU="2Z55050" CB="EUR">
              <dc>
                <DO>17-10-2012</DO>
                <CY>ASFINAG POST_MAUT</CY>
                <BM>1328,10</BM>
                <CO>Dalnicni znamka</CO>
              </dc>
            </detaildc>
            <detaildc DU="2Z90001" CB="EUR">
              <dc>
                <DO>27-10-2012</DO>
                <CY>ASFINAG POST_MAUT</CY>
                <BM>185,10</BM>
                <CO>Poplatek</CO>
              </dc>
            </detaildc>
            <dt>
              <AR>EI08P4000</AR>
              <DG>8</DG>
            </dt>
          </invoice>
        </account>
        <account id="234">
          <invoice id="EI13T7777">
            <da>
              <AR>EI13T7777</AR>
              <AD>Mickey Mouse</AD>
            </da>
            <detaildc DU="1Z48302" CB="EUR">
              <dc>
                <DO>26-10-2012</DO>
                <CY>SANEF 07706 A 07704</CY>
                <BM>232,10</BM>
                <CO>Dalnicni poplatek</CO>
              </dc>
            </detaildc> 
            <detaildc DU="1Z48302" CB="EUR">
              <dc>
                <DO>20-10-2012</DO>
                <CY>TEST A 07704</CY>
                <BM>30,10</BM>
                <CO>Poplatek</CO>
              </dc>
            </detaildc>       
            <dt>
              <AR>EI13T7777</AR>
              <DG>8</DG>         
            </dt>
          </invoice>
        </account>
        <account id="234">
          <invoice id="EI327744">
            <da>
              <AR>EI327744</AR>
              <AD>Mickey Mouse</AD>
            </da>
            <detaildn  CI="707732 00000234" >
              <dn>
                <BY>30-10-2012</BY>
                <BM>8,10</BM>
              </dn>
            </detaildn>
            <detaildn CI="707732 00000234" >
              <dn>
                <BY>30-10-2012</BY>
                <BM>399,50</BM>
              </dn>
            </detaildn>
            <dt>
              <AR>EI327744</AR>
            </dt>
          </invoice>
        </account>
        <account id="234">
          <invoice id="EI349515">
            <da>
              <AR>EI349515</AR>
              <AD>Mickey Mouse</AD>
            </da>
            <detaildc DU="1Z56514" CB="EUR">
              <dc>
                <DO>29-10-2012</DO>
                <CY>ALLAMI AUTOPALYAKEZE</CY>
                <BM>1240,60</BM>
                <CO>Dalnicni znamka</CO>
              </dc>
            </detaildc>
            <detaildc DU="1Z56515" CB="EUR">
              <dc>
                <DO>19-10-2012</DO>
                <CY>ASFINAG POST_MAUT</CY>
                <BM>7428,10</BM>
                <CO>Dalnicni znamka</CO>
              </dc>
            </detaildc>
            <detaildc DU="1Z56515" CB="EUR">
              <dc>
                <DO>12-10-2012</DO>
                <CY>UK</CY>
                <BM>954,10</BM>
                <CO>Poplatek</CO>
              </dc>
            </detaildc>
            <dt>
              <AR>EI349515</AR>
              <DG>8</DG>
            </dt>
          </invoice>
        </account>
      </account_group>
      <footer>
        <CZ>SS47</CZ>
        <BU>4</BU>
        <CH>0032</CH>
        <CK>2012-10-31</CK>
        <CL>01:25</CL>
      </footer>
    </etd>Expected output
    AR     CK     CF             AR4             AD             DU     CB     DO             CY                     BM      CO                AR5             DG     CI             BY               BM6     CZ     BU       CH       CK7    CL
    0     41213     SS-CZL19     EI08P4000     Mickey Mouse     1Z56655     EUR     16-10-2012     ASFINAG POST_MAUT     1940,60     Dalnicni znamka        EI08P4000     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI08P4000     Mickey Mouse     2Z55050     EUR     17-10-2012     ASFINAG POST_MAUT     1328,10     Dalnicni znamka        EI08P4000     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI08P4000     Mickey Mouse     2Z90001     EUR     27-10-2012     ASFINAG POST_MAUT      185,10     Poplatek        EI08P4000     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI13T7777     Mickey Mouse     1Z48302     EUR     26-10-2012     SANEF 07706 A 07704      232,10     Dalnicni poplatek  EI13T7777     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI13T7777     Mickey Mouse     1Z48302     EUR     20-10-2012     TEST A 07704               30,10     Poplatek        EI13T7777     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI327744     Mickey Mouse                                                                      EI327744          707732 00000234     30-10-2012     8,10     SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI327744     Mickey Mouse                                                                      EI327744          707732 00000234     30-10-2012     399,50     SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI349515     Mickey Mouse     1Z56514     EUR     29-10-2012     ALLAMI AUTOPALYAKEZE     1240,60     Dalnicni znamka        EI349515     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI349515     Mickey Mouse     1Z56515     EUR     19-10-2012     ASFINAG POST_MAUT     7428,10     Dalnicni znamka        EI349515     8                                    SS47     4     32     41213     01:25
    0     41213     SS-CZL19     EI349515     Mickey Mouse     1Z56515     EUR     12-10-2012     UK                      954,10     Poplatek        EI349515     8                                    SS47     4     32     41213     01:25

  • Mapping problem in message response  RFC -- xi -- JDBC

    Hi all,
    I'm using the follow scenario:
    RFC <-> xi <-> JDBC
    It's a synchronous interface.
    In JDBC the message do a SELECT in database and returns selected rows in message response.
    The message response transfers selected rows to RFC.response in the mapping.
    It seems working right but no data are transfered to RFC.
    In SXMB_MONI I can see the selected rows from database.
    There is no error in JDBC and RFC adapter. Bellow is the message response in the SXMB_MONI:
      <ns1:MT_jbdc_select_response xmlns:ns1="http://braskem.com.br/xi/sapxi03">
      <t7_productionorder_response>
      <row>
      <PRODUCT>Nafta Media</PRODUCT>
      </row>
      <row>
      <PRODUCT>Nafta Media</PRODUCT>
      </row>
      </t7_productionorder_response>
      </ns1:MT_jbdc_select_response>
    I think that there is an error in message mapping between RFC.response <-- message_response, because I'm just mapping the fields <row> and <product>, because if I make a link beteween <t7_productionorder_response> and return table of RFC, a Short DUMP happens.
    Bellow the structure of MESSAGE RESPONSE:
       <t7_productionorder_response>
          <row>
             <PRODUCT/>
          </row>
       </t7_productionorder_response>
    Bellow the structure of RFC RESPONSE:
    <RFC.response>
      <t_return>
         <item>
             <product/>
         </item>
      </return>
    </RFC.response>
    When I make a link in the mapping between
    <t7_productionorder_response> -> <t_return>
    a short DUMP happens in RFC call in R/3.
    Anyone could help me about this problem ?
    Thanks in advance
    Regis Ferrato

    Hi,
      <i>because if I make a link beteween <t7_productionorder_response> and return table of RFC, a Short DUMP happens.</i>
    After doing this mapping, did you test it in the IR mapping editor? was it successful?
    Do specify the occurence of all the headers so we can help you better.
    Regards,
    Smitha.

  • Alv grand total

    hi gurus pls help me on this issue....... i want grand total on each column of this report.
    for example field 'metric-safety'. if possbile try to edit this and send me.
    TYPE-POOLS : slis.
    Tables : Marc, " Plant Data for Material
    Mbew, " Material Valuation
    Ekpo, " Purchasing Document Item
    Eord, " Purchasing Source List
    Zpmt. " Purchasing Metric Table
    Internal Tables Declaration----
    Data : Begin of metric occurs 0,
    matnr like marc-matnr, " Material number
    werks like marc-werks, " Plant
    minbe like marc-minbe, " Recoder Point
    eisbe like marc-eisbe, " Safety Stock
    stprs like mbew-stprs, " Standard Price
    lifnr like eord-lifnr, " Vendor
    menge like ekpo-menge, " PO Quantity
    scalc type p decimals 2,
    safety(20) type c,
    tcalc type p decimals 2,
    Target(20) type c,
    acalc type p decimals 2,
    actual(20) type c,
    ecalc type p decimals 2,
    excess(20) type c,
    ucalc type p decimals 2,
    usafety(20) type c,
    *******Custom table
    inscr like zpmt-inscr, " Inventory Score
    stkot like zpmt-stkot, " Stock Out
    impct like zpmt-impct, " Impact
    nafta like zpmt-nafta, " %nafta
    stscr like zpmt-stscr, " Stock Out Score
    end of metric.
    Data : final like metric occurs 0 with header line.
    DATA: fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    **Data : Begin of output occurs 0,
    lifnr like eord-lifnr, " Vendor
    eisbe like marc-eisbe, " Safety Stock
    minbe like marc-minbe, " Re-order Point
    stprs like mbew-stprs, " Standard Price
    sstock(13) type c, " Value of Safety Stock
    Actual(13) type c, " Actual
    Excess(13) type c, " Excess Inv
    underSs(13) type c, " Under Safety Stock
    end of output.
    Data type Declaration----
    Data : a type c value '$'.
    Data : safety(20) type c,
    target(20) type c,
    actual(20) type c,
    excess(20) type c,
    usafety(20) type c,
    repid like sy-repid.
    data : i_pos type i.
    Selection Screen----
    selection-screen : begin of block b1 with frame Title tname.
    Select-options: Mat for marc-matnr, " Material Number Selection
    Plt for marc-werks, " Plant Selection
    Vdr for eord-lifnr. " Vendor Selection
    selection-screen : end of block b1.
    Initialization----
    initialization.
    tname = 'Purchasing Metric Report'.
    At Selection-Screen----
    At selection-screen.
    IF mat = ' ' and Plt = ' ' and Vdr = ' '.
    message e000.
    *elseif mat metric-matnr.
    *message e001.
    *elseif plt metric-werks.
    *message e002.
    *elseif vdr metric-lifnr.
    *message e003.
    endif.
    Start-of-Selection----
    Start-of-selection.
    *******For Data Retrival
    Perform Data_retrival.
    *******For Calculation
    Perform Calculation.
    *******For Building Fieldcatalog
    Perform Build_fieldcatalog.
    *******Alv Display
    Perform Alv_display.
    *& Form Get_Data
    text
    FORM Data_retrival .
    SELECT a~matnr
    a~werks
    a~eisbe
    a~minbe
    b~matnr
    b~stprs
    c~matnr
    c~lifnr
    d~matnr
    d~menge
    into corresponding fields of table metric from
    ( ( ( marc as a inner join mbew as b on bmatnr = amatnr )
    inner join eord as c on cmatnr = amatnr )
    inner join ekpo as d on dmatnr = amatnr )
    where amatnr in mat and awerks in plt and c~lifnr in vdr.
    if sy-subrc = 0.
    sort metric by matnr.
    endif.
    ENDFORM. " Get_Data
    *& Form Calculation
    text
    FORM Calculation .
    loop at metric.
    ******calculation for safety stock ( safety stock * standard price )
    metric-scalc = metric-eisbe * metric-stprs.
    move metric-scalc to safety.
    condense safety.
    concatenate a safety into metric-safety.
    ******calculation for target ( safety stock + standard price )
    metric-tcalc = ( metric-eisbe * metric-stprs ) + metric-stprs.
    move metric-tcalc to target.
    condense target.
    concatenate a target into metric-target.
    ******calculation for Actual ( Po quantity * standard price )
    metric-acalc = metric-menge * metric-stprs.
    move metric-acalc to actual.
    condense actual.
    concatenate a actual into metric-actual.
    ******calculation for Excess Inv ( Actual - Target )
    metric-ecalc = ( metric-menge * metric-stprs ) - ( ( metric-eisbe * metric-stprs ) + metric-stprs ).
    move metric-ecalc to excess.
    condense excess.
    concatenate a excess into metric-excess.
    ******calculation for Under Safety Stock ( actual < safety stock. then actual + safety stock (Else) zero )
    if actual < safety.
    metric-menge * metric-stprs < metric-eisbe * metric-stprs.
    metric-ucalc = ( metric-menge * metric-stprs ) + ( metric-eisbe * metric-stprs ).
    else.
    metric-ucalc = 0.
    endif.
    move metric-ucalc to usafety.
    condense usafety.
    concatenate a usafety into metric-usafety.
    collect metric into final.
    endloop.
    ENDFORM. " Calculation
    *--End-for-Selection--
    *end-of-selection.
    *loop at final.
    *write : / final-lifnr, final-safety, final-target, final-actual, final-excess, final-usafety.
    *endloop.
    *& Form Build_fieldcatalog
    text
    --> p1 text
    <-- p2 text
    FORM Build_fieldcatalog .
    fcat-fieldname = 'LIFNR'.
    fcat-seltext_m = 'Vendor'.
    fcat-col_pos = i_pos.
    fcat-outputlen = 10.
    fcat-emphasize = 'X'.
    fcat-key = 'X'.
    fcat-do_sum = 'X'.
    fcat-edit = 'X'.
    append fcat to fcat.
    clear fcat.
    i_pos = i_pos + 1.
    fcat-fieldname = 'SAFETY'.
    fcat-seltext_m = 'Safety Stock'.
    fcat-col_pos = 2.
    fcat-outputlen = 10.
    fcat-emphasize = 'X'.
    fcat-do_sum = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'ACTUAL'.
    fcat-seltext_m = 'Actual'.
    fcat-col_pos = 3.
    fcat-outputlen = 10.
    fcat-emphasize = 'X'.
    fcat-do_sum = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'TARGET'.
    fcat-seltext_m = 'Target'.
    fcat-col_pos = 4.
    fcat-outputlen = 10.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'EXCESS'.
    fcat-seltext_m = 'Excess Inv'.
    fcat-col_pos = 5.
    fcat-outputlen = 10.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'USAFETY'.
    fcat-seltext_m = 'Under Safety Stock'.
    fcat-col_pos = 6.
    fcat-outputlen = 20.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'INSCR'.
    fcat-seltext_m = 'Iventory Score'.
    fcat-col_pos = 7.
    fcat-outputlen = 20.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'STKOT'.
    fcat-seltext_m = 'Stock Out'.
    fcat-col_pos = 6.
    fcat-outputlen = 20.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'IMPCT'.
    fcat-seltext_m = 'Impact'.
    fcat-col_pos = 6.
    fcat-outputlen = 20.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'NAFTA'.
    fcat-seltext_m = '%Nafta'.
    fcat-col_pos = 6.
    fcat-outputlen = 20.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    fcat-fieldname = 'STSCR'.
    fcat-seltext_m = 'Safety Out Score'.
    fcat-col_pos = 6.
    fcat-outputlen = 20.
    fcat-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    append fcat to fcat.
    clear fcat.
    ENDFORM. " Build_fieldcatalog
    *& Form Alv_display
    text
    --> p1 text
    <-- p2 text
    FORM Alv_display .
    repid = sy-repid.
    *CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = repid
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    I_STRUCTURE_NAME =
    IS_LAYOUT =
    IT_FIELDCAT = fcat[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT =
    IS_PRINT =
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    T_OUTTAB = final
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2
    *IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    repid = sy-repid.
    call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
    i_callback_program = repid
    i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
    i_callback_user_command = 'USER_COMMAND'
    i_grid_title = outtext
    is_layout = gd_layout
    it_fieldcat = fcat[]
    it_special_groups = gd_tabgroup
    it_events = gt_events
    is_print = gd_prntparams
    i_save = 'X'
    is_variant = z_template
    tables
    t_outtab = final
    exceptions
    program_error = 1
    others = 2.
    if sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    thx in advance

    hi,
    for subtotal and grand total do the same thing like following,
    DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD1'.
    GS_SORT-SPOS      = 1.
    GS_SORT-UP        = 'X'.
    GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'FIELD2'.
    GS_SORT-SPOS      = 2.
    GS_SORT-UP        = 'X'.
    *GS_SORT-SUBTOT    = 'X'.
    APPEND GS_SORT TO GT_SORT.
    if uesful rewars points

  • Problems printing lines Acrobat 9 pro

    I am trying to print some government forms that are generated by an Access 97 program ( I know old and I should get user off) But when we generated the forms in Acrobat 8 std all worked well.  Moved to Acrobat 9 pro and now lines are being dropped.  Form is NAFTA Certidicate of Origin and complex.

    How are you creating the pdfs? If you are indeed printing to pdf, what joboptions file are you using now? What were you using before?

  • Output error help

    How do i correct the error in my code below. Also, i want to add 1 things to my output, before it preforms the insertion sort, so i can show the person who is seeing the output that these r the numbers before the sort, & these r after:
    1) Original Values = (the values stored in int[] no)
    thanks.
    public class Sort
         public static void insSort (int[] num)
              for (int index = 1; index < num.length; index++)
                   int key = num[index];
                   int pos = index;
                   while (pos > 0 && num[pos-1] > key)
                        num[pos] = num[pos-1];
                        pos--;
                   num[pos] = key;
         public static void insSort (Comparable[] obj)
              for (int index = 1; index < obj.length; index++)
                   Comparable key = obj[index];
                   int pos = index;
                   while (pos > 0 && obj[pos-1].compareTo(key) > 0)
                        obj[pos] = obj[pos-1];
                        pos--;
                   obj[pos] = key;
         public static void main(String[] args)
                   int[] no = {12, 22, 99, 34, 5, 16, 44, 65, 11};
                   insSort(no);
                   for (int index = 0; index < no.length; index++);
                   System.out.println ("Insertion Sort = " + "\n");
                   System.out.println (no[index] + " ");

    try this
    public class Sort{
       public static void insSort (int[] num){
          for (int index = 1; index < num.length; index++){
             int key = num[index];
             int pos = index;
             while (pos > 0 && num[pos-1] > key){
                num[pos] = num[pos-1];
                pos--;
             }// while.
                num[pos] = key;
             }// for.
          }// insSort.
    //======================================================================
       public static void insSort (Comparable[] obj){
          for (int index = 1; index < obj.length; index++){
             Comparable key = obj[index];
             int pos = index;
             while (pos > 0 && obj[pos-1].compareTo(key) > 0){
                obj[pos] = obj[pos-1];
                pos--;
             }// while.
             obj[pos] = key;
          }// for.
       }// insSort.
    //======================================================================
       public static void main(String[] args){
          int[] no = {12, 22, 99, 34, 5, 16, 44, 65, 11};
          System.out.print ("Before Sort = {");
          for (int index = 0; index < no.length; index++){
             System.out.print (no[index] + ", ");
          }// for.
          System.out.print ("}");
          insSort(no);
          System.out.print ("\n\nAfter Sort = {");
          for (int index = 0; index < no.length; index++){
             System.out.print (no[index] + ", ");
          }// for.
          System.out.print ("}");
       }// main.
    //======================================================================
    }// Sort.original compile error was the last System.out.print statement was out side the for loop.
    cheers
    jamie

  • Need  help....question about transit procedure  ..

    Hello gurus
    Can somebody help me understand the transit procedure ?
    my question is
    if we are implementing GTS for a company in US and its not a global implementation . and the company does
    only exports to the EU customers for example to France
    Is it necessary for us to file a transit declaration ?
    If yes to which customs offices we have to send the EDI for declaration ?
    Does the american company have to follow NCTS?
    and if we are like importing goods from EU to USA what is the process?
    Is NCTS strictly for the companies which operates in EU and EFTA?
    thanks alot for the help

    hi,
    transit declarations are only for processes within a customs union (NAFTA or EU).
    However if you export to or import from the EU you have to file customs declarations. With GTS you can do this all electronically in the US (with AES and ABI) and in many european countries. (Germany, NL, CH, FR etc.).
    Balazs

  • Forms not active in Communication tab in Customs Declaration

    Hi,
    The forms (Shippers Letter of Instructions, SED, COO etc) are not active and not showing up in "Communication" tab of Customs Declaration while creating a customs declaration manually from transaction /SAPSLL/CL_CUS_01.
    Appreciate any help in pointing to missing configuration or activation of BAdI etc. 
    Followed the steps in "Communication Processes" in Customs Management in IMG
    1. Action Profile:          US_CU_EX      (US: Customs Processing (Export)
    No changes made
    2. Action Definition:
    Action Definition     Description     Sort Order
    US_CU_EX_CUSEX_M_UAES2     Export Declaration Option 2 (US)     0
    US_CU_EX_CUSEX_P_COO     Certificate of Origin (US)     
    US_CU_EX_CUSEX_P_SED     Shipper's Export Declaration (US)     0
    US_CU_EX_CUSEX_P_SLI     Shipper's Letter of Instructions (US)     
    No changes made
    3. Messages for Communication Process:
    Message     Description     Message Type     Scheme
    P0350     Certificate of Origin (US)     /SAPSLL/CUS_EXP     CUS_US
    P0360     Shipper's Export Declaration (US)     /SAPSLL/CUS_EXP     CUS_US
    P0370     Shipper's Letter of Instructions (US)     /SAPSLL/CUS_EXP     CUS_US
    Assigned Scheme
    4. Control Settings for Communication Process:
    Process – CUSEX     
    CUSEX     Export     Export/Dispatch     Export / Reexport
    Activities:
    CUSEX     Export Declaration          SED
    Messages:
    M0410     Export Declaration Option 2 (US)
    P0130     NAFTA Certificate of Origin (NAFTA)
    P0140     Export Packing List NAFTA (NAFTA)
    P0350     Certificate of Origin (US)
    P0360     Shipper's Export Declaration (US)
    P0370     Shipper's Letter of Instructions (US)
    5.Print Control for Foreign Trade Documents:
    Assigned Message to Legal Unit
    6. Print Profile:
    Defined Print Profile (where to assign this?)
    Thanks
    Sreekar

    Hi Venkat,
    Sorry for delay in reply and thanks for helping me out on this issue. We have worked out the ADS configuration issues, set up master data for printer, set up .xdc files for printer etc. and are now able to display the forms and able to 'print preview' the forms.
    However, when I print preview the form, the print icon is grayed out. I am not able to print the form. Can you please advise what am I missing?
    Thanks
    Sreekar

Maybe you are looking for

  • Akonadi database error code: 1062 Duplicate entry for key

    Since my email provider migrated their webmail platform, I keep getting an error each time kmail attempts to get emails from their imap server: could not create collection INBOX resourceid: 17 I double checked the provided imap settings have not chan

  • Loading applet for a jar within an ear

    Hi, Apologies if my question sounds ignorant, this is the first time i'm playing with applets. I'm trying to load an applet from a JAR (applet.jar) which contains all the files specific to the applet. The applet.jar resides within an ear (application

  • Database with ms access

    hello, I am newbie here! I'm creating a program that the barcode number store in excel will find and show the data which store in MS access.   How can i connect excel and access in Labview. please help! Thanks!

  • MBA no longer detects home wifi

    Hi! I've had my MBA for a few months and always used it at home with no issue. Recently my housemate forgot to pay our internet bill and our connection was cut. Now my MBA won't pick up my wifi, but my housemates pc can use it. Iv reset the router an

  • Doubt in submit

    Hi Experts i am doing a report where i have been asked to use SUBMIT for tcode (FBL3N) my inputs are company code(Bukrs) Posting date(Budat) station username vendor no (Lifnr) Now what i want to know is..... i can take company code posting date  but