Redarding Native SQL

Dear All,
     I am using one function module to get the details of Table Size History. In that i found select statement like this.
if schema is initial.
    concatenate 'select' tbst_columns 'from sap_tf_tabhist' into
       stmt separated by space.                             "#EC NOTEXT
  else.
    concatenate 'select' tbst_columns 'from'
         schema into stmt separated by space.               "#EC NOTEXT
    concatenate stmt '.sap_tf_tabhist' into stmt.           "#EC NOTEXT
  endif.
  concatenate stmt '(''' tabname ''',''' curr_schema ''')' into stmt.
  * Select the info
  try.
    res_ref = stmt_ref->execute_query( stmt ).
    get reference of out_data into itable_ref.
    res_ref->set_param_table( itable_ref ).
    res_ref->next_package( ).
    res_ref->close( ).
    catch_std_db_error.
  endtry.
In this select stmt  they have used " sap_tf_tabhist " table to get the details of table history ..But i didn't find any table in SE11.
I want to know what is this "sap_tf_tabhist" stands?
If it is a table in MY SQL then how to see that table?

It does not make sense to write native SQL statement for a SAP table. That's why you have that code to access the MS SQL table. You should better check with system administrator for that table.

Similar Messages

  • While running the livecache server test a native sql error occures

    We are using scm4.1 livecache 7.5.0 And every time we are running the livecache test program he is dumping
    whith the following dump
    patch level scm & scm_basis is 8
    Runtime Errors         DBIF_DSQL2_SQL_ERROR
    Except.                CX_SY_NATIVE_SQL_ERROR
    Date and Time          31.10.2005 16:50:55
    ShrtText
    An SQL error occurred when executing Native SQL.
    What happened?
    Error 600 occurred in the current database connection "LCA".
    What can you do?
    Print out the error message (using the "Print" function)
    and make a note of the actions and input that caused the
    error.
    To resolve the problem, contact your SAP system administrator.
    You can use transaction ST22 (ABAP Dump Analysis) to view and administer
    termination messages, especially those beyond their normal deletion
    date.
    is especially useful if you want to keep a particular message.
    How to correct the error
    Database error text........: "Work rolled back: DbpError -28814 in
    APS_ORDER_CH"
    Database error code .......: 600
    Triggering SQL statement...: " ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
    ? ? ? ? ? ? ? or'"
    Internal call code.........: "[DBDS/NEW DSQL]"
    Please check the entries in the system log (Transaction SM21).
    You may able to find an interim solution to the problem
    in the SAP note system. If you have access to the note system yourself,
    use the following search criteria:
    "DBIF_DSQL2_SQL_ERROR" CX_SY_NATIVE_SQL_ERRORC
    "/SAPAPO/SAPLOM_PLANNING" or "/SAPAPO/LOM_PLANNINGU08"
    "/SAPAPO/OM_ORDER_CHANGE"
    If you cannot solve the problem yourself and you wish to send
    an error message to SAP, include the following documents:
    1. A printout of the problem description (short dump)
    To obtain this, select in the current display "System->List->
    Save->Local File (unconverted)".
    2. A suitable printout of the system log
    To obtain this, call the system log through transaction SM21.
    Limit the time interval to 10 minutes before and 5 minutes
    after the short dump. In the display, then select the function
    "System->List->Save->Local File (unconverted)".
    3. If the programs are your own programs or modified SAP programs,
    supply the source code.
    To do this, select the Editor function "Further Utilities->
    Upload/Download->Download".
    4. Details regarding the conditions under which the error occurred
    or which actions and input led to the error.
    The exception must either be prevented, caught within the procedure
    "/SAPAPO/OM_ORDER_CHANGE"
    "(FUNCTION)", or declared in the procedure's RAISING clause.
    To prevent the exception, note the following:
    System environment
    SAP Release.............. "640"
    Application server....... "bebruap2"
    Network address.......... "195.213.49.227"
    Operating system......... "Windows NT"
    Release.................. "5.2"
    Hardware type............ "4x Intel 801586"
    Character length......... 16 Bits
    Pointer length........... 32 Bits
    Work process number...... 1
    Short dump setting....... "full"
    Database server.......... "BEBRUAP2"
    Database type............ "MSSQL"
    Database name............ "APD"
    Database owner........... "apd"
    Character set............ "C"
    SAP kernel............... "640"
    Created on............... "Aug 23 2005 00:00:49"
    Created in............... "NT 5.0 2195 Service Pack 4 x86 MS VC++ 13.10"
    Database version......... "SQL_Server_8.00 "
    Patch level.............. "87"
    Patch text............... " "
    Supported environment....
    Database................. "MSSQL 7.00.699 or higher, MSSQL 8.00.194"
    SAP database version..... "640"
    Operating system......... "Windows NT 5.0, Windows NT 5.1, Windows NT 5.2"
    Memory usage.............
    Roll..................... 8176
    EM....................... 24040336
    Heap..................... 0
    Page..................... 1687552
    MM Used.................. 1516920
    MM Free.................. 572032
    SAP Release.............. "640"
    User and Transaction
    Client.............. 000
    User................ "CGRAULS"
    Language key........ "E"
    Transaction......... "/SAPAPO/OM03 "
    Program............. "/SAPAPO/SAPLOM_PLANNING"
    Screen.............. "SAPMSSY0 1000"
    Screen line......... 6
    Information on where terminated
    The termination occurred in the ABAP program "/SAPAPO/SAPLOM_PLANNING" in
    "/SAPAPO/OM_ORDER_CHANGE".
    The main program was "/SAPAPO/OM_TB_FLOW_QUANTITY ".
    The termination occurred in line 91 of the source code of the (Include)
    program "/SAPAPO/LOM_PLANNINGU08"
    of the source code of program "/SAPAPO/LOM_PLANNINGU08" (when calling the
    editor 910).
    Processing was terminated because the exception "CX_SY_NATIVE_SQL_ERROR"
    occurred in the
    procedure "/SAPAPO/OM_ORDER_CHANGE" "(FUNCTION)" but was not handled locally,
    not declared in the
    RAISING clause of the procedure.
    The procedure is in the program "/SAPAPO/SAPLOM_PLANNING ". Its source code
    starts in line 5
    of the (Include) program "/SAPAPO/LOM_PLANNING$08 ".
    Source Code Extract
    Line
    SourceCde
    61
    is_gen_params-simversion
    62
    is_gen_params-dont_set_netchg_flag
    63
    space.
    64
    65
    Kontrollstruktur IS_GET_CHANGED_OPTIONS anpassen.
    66
    IF NOT et_changed_orders IS REQUESTED.
    67
    is_get_changed_options-send_chg_top_order = gc_false.
    68
    ENDIF.
    69
    IF NOT et_changed_cap_reqs IS REQUESTED.
    70
    is_get_changed_options-send_chg_cap_req = gc_false.
    71
    ENDIF.
    72
    IF NOT et_changed_io_nodes IS REQUESTED.
    73
    is_get_changed_options-send_chg_ionode = gc_false.
    74
    ENDIF.
    75
    IF NOT et_changed_io_pp_nodes IS REQUESTED.
    76
    is_get_changed_options-send_chg_io_pp = gc_false.
    77
    ENDIF.
    78
    IF NOT et_changed_pegids IS REQUESTED.
    79
    is_get_changed_options-send_chg_pegid = gc_false.
    80
    ENDIF.
    81
    IF NOT et_deleted_fix_pegging IS REQUESTED.
    82
    is_get_changed_options-send_del_fix_peg = gc_false.
    83
    ENDIF.
    84
    start_function 'OM_ORDER_CHANGE'.                         "#EC *
    85
    Verbindung zum liveCache aufbauen
    86
    check_server.
    87
    connect_to_livecache.
    88
    COM-Routine zum Anlegen bzw. Überschreiben eines Zeitstrahls
    89
    90
    EXEC sql.
    >>>>>
    execute procedure                  "APS_ORDER_CHANGE" (
    92
    in  :ls_gen_com_params,
    93
    out :lv_rc,
    94
    in  :et_rc,
    95
    in  :it_order_method,
    96
    in  :it_ordkeys,
    97
    in  :it_ordmaps,
    98
    in  :it_orders,
    99
    in  :it_activities,
    100
    in  :it_mode,
    101
    in  :it_cap_reqs,
    102
    in  :it_positions,
    103
    in  :it_inputs,
    104
    in  :it_outputs,
    105
    in  :it_prodflow,
    106
    in  :it_intern_constraints,
    107
    in  :it_extern_constraints,
    108
    in  :it_charact_val_acts,
    109
    in  :it_charact_req_inpnode,
    110
    in  :it_charact_val_outnode,
    Contents of system fields
    Name
    Val.
    SY-SUBRC
    0
    SY-INDEX
    0
    SY-TABIX
    1
    SY-DBCNT
    1
    SY-FDPOS
    0
    SY-LSIND
    0
    SY-PAGNO
    0
    SY-LINNO
    1
    SY-COLNO
    1
    SY-PFKEY
    SY-UCOMM
    SY-TITLE
    Flow Quantity Test
    SY-MSGTY
    S
    SY-MSGID
    /SAPAPO/OM_TEST
    SY-MSGNO
    001
    SY-MSGV1
    Create transSim
    SY-MSGV2
    SY-MSGV3
    SY-MSGV4
    Active Calls/Events
    No.   Ty.          Program                             Include                             Line
    Name
    3 FUNCTION     /SAPAPO/SAPLOM_PLANNING             /SAPAPO/LOM_PLANNINGU08                91
    /SAPAPO/OM_ORDER_CHANGE
    2 FORM         /SAPAPO/OM_TB_FLOW_QUANTITY         /SAPAPO/OM_TB_FLOW_QUANTITY           802
    CHANGE_DATA
    1 EVENT        /SAPAPO/OM_TB_FLOW_QUANTITY         /SAPAPO/OM_TB_FLOW_QUANTITY            11
    START-OF-SELECTION
    Chosen variables
    Name
    Val.
    No.       3 Ty.          FUNCTION
    Name  /SAPAPO/OM_ORDER_CHANGE
    IS_ATP_INFO
    01ATP0000001~CGRAULSXX##
    334553333333744545455500
    011400000001E37215C38800
    000000000000000000000000
    000000000000000000000000
    IS_CONTROLPARAMETERS
    霁က#ం̂⍱㔒鲔#####
    2222222222222222222222001007190000022
    0000000000000000000000100221240000100
    0000000000000000000000910002390000000
    0000000000000000000000700C335C000C000
    IS_GEN_PARAMS
    01PLV0000001~CGRAULS
    3354533333337445454522222
    010C60000001E37215C300000
    0000000000000000000000000
    0000000000000000000000000
    IS_GET_CHANGED_OPTIONS
    2222222
    0000000
    0000000
    0000000
    IT_ACTIVITIES
    Table IT_274[1x256]
    PROGRAM=/SAPAPO/OM_TB_FLOW_QUANTITYFORM=CHANGE_DATADATA=LT_ACTIVITIES
    Table reference: 41
    TABH+  0(20) = 5087FFDF00000000000000002900000012010000
    TABH+ 20(20) = 0100000000010000FFFFFFFF0487000000290000
    TABH+ 40( 8) = 10000000C1308000
    store        = 0x5087FFDF
    ext1         = 0x00000000
    shmId        = 0     (0x00000000)
    id           = 41    (0x29000000)
    label        = 274   (0x12010000)
    fill         = 1     (0x01000000)
    leng         = 256   (0x00010000)
    loop         = -1    (0xFFFFFFFF)
    xtyp         = TYPE#000205
    occu         = 16    (0x10000000)
    access       = 1     (ItAccessStandard)
    idxKind      = 0     (ItIndexNone)
    uniKind      = 2     (ItUniqueNon)
    keyKind      = 1     (default)
    cmpMode      = 8     (cmpManyEq)
    occu0        = 1
    collHash     = 0
    groupCntl    = 0
    rfc          = 0
    unShareable  = 0
    mightBeShared = 0
    sharedWithShmTab = 0
    isShmLockId  = 0
    gcKind       = 0
    isUsed       = 1
    >>>>> Shareable Table Header Data <<<<<
    tabi         = 0x180112E0
    pghook       = 0x00000000
    idxPtr       = 0x00000000
    refCount     = 0     (0x00000000)
    tstRefCount  = 0     (0x00000000)
    lineAdmin    = 16    (0x10000000)
    lineAlloc    = 16    (0x10000000)
    store_id     = 126   (0x7E000000)
    shmIsReadOnly = 0     (0x00000000)
    >>>>> 1st level extension part <<<<<
    regHook      = Not allocated
    hsdir        = Not allocated
    ext2         = Not allocated
    >>>>> 2nd level extension part <<<<<
    tabhBack     = Not allocated
    delta_head   = Not allocated
    pb_func      = Not allocated
    pb_handle    = Not allocated
    IT_CAP_REQS
    Table IT_276[1x112]
    PROGRAM=/SAPAPO/OM_TB_FLOW_QUANTITYFORM=CHANGE_DATADATA=LT_CAP_REQS
    Table reference: 39
    TABH+  0(20) = 48BB06E000000000000000002700000014010000
    TABH+ 20(20) = 0100000070000000FFFFFFFF04870000C0290000
    TABH+ 40( 8) = 10000000C1308000
    store        = 0x48BB06E0
    ext1         = 0x00000000
    shmId        = 0     (0x00000000)
    id           = 39    (0x27000000)
    label        = 276   (0x14010000)
    fill         = 1     (0x01000000)
    leng         = 112   (0x70000000)
    loop         = -1    (0xFFFFFFFF)
    xtyp         = TYPE#000209
    occu         = 16    (0x10000000)
    access       = 1     (ItAccessStandard)
    idxKind      = 0     (ItIndexNone)
    uniKind      = 2     (ItUniqueNon)
    keyKind      = 1     (default)
    cmpMode      = 8     (cmpManyEq)
    occu0        = 1
    collHash     = 0
    groupCntl    = 0
    rfc          = 0
    unShareable  = 0
    mightBeShared = 0
    sharedWithShmTab = 0
    isShmLockId  = 0
    gcKind       = 0
    isUsed       = 1
    >>>>> Shareable Table Header Data <<<<<
    tabi         = 0x188D04E0
    pghook       = 0x00000000
    idxPtr       = 0x00000000
    refCount     = 0     (0x00000000)
    tstRefCount  = 0     (0x00000000)
    lineAdmin    = 16    (0x10000000)
    lineAlloc    = 16    (0x10000000)
    store_id     = 124   (0x7C000000)
    shmIsReadOnly = 0     (0x00000000)
    >>>>> 1st level extension part <<<<<
    regHook      = Not allocated
    hsdir        = Not allocated
    ext2         = Not allocated
    >>>>> 2nd level extension part <<<<<
    tabhBack     = Not allocated
    delta_head   = Not allocated
    pb_func      = Not allocated
    pb_handle    = Not allocated
    IT_CHARACT_REQ_INPNODE
    Table IT_418[0x140]
    FUNCTION=/SAPAPO/OM_ORDER_CHANGEDATA=IT_CHARACT_REQ_INPNODE
    Table reference: 32
    TABH+  0(20) = 00000000000000000000000020000000A2010000
    TABH+ 20(20) = 000000008C000000FFFFFFFF04870000301D0000
    TABH+ 40( 8) = 10000000C1308000
    store        = 0x00000000
    ext1         = 0x00000000
    shmId        = 0     (0x00000000)
    id           = 32    (0x20000000)
    label        = 418   (0xA2010000)
    fill         = 0     (0x00000000)
    leng         = 140   (0x8C000000)
    loop         = -1    (0xFFFFFFFF)
    xtyp         = TYPE#000142
    occu         = 16    (0x10000000)
    access       = 1     (ItAccessStandard)
    idxKind      = 0     (ItIndexNone)
    uniKind      = 2     (ItUniqueNon)
    keyKind      = 1     (default)
    cmpMode      = 8     (cmpManyEq)
    occu0        = 1
    collHash     = 0
    groupCntl    = 0
    rfc          = 0
    unShareable  = 0
    mightBeShared = 0
    sharedWithShmTab = 0
    isShmLockId  = 0
    gcKind       = 0
    isUsed       = 1
    >>>>> Shareable Table Header Data <<<<<
    tabi         = Not allocated
    pghook       = Not allocated
    idxPtr       = Not allocated
    refCount     = Not allocated
    tstRefCount  = Not allocated
    lineAdmin    = Not allocated
    lineAlloc    = Not allocated
    store_id     = Not allocated
    shmIsReadOnly = Not allocated
    >>>>> 1st level extension part <<<<<
    regHook      = Not allocated
    hsdir        = Not allocated
    ext2         = Not allocated
    >>>>> 2nd level extension part <<<<<
    tabhBack     = Not allocated
    delta_head   = Not allocated
    pb_func      = Not allocated
    pb_handle    = Not allocated
    IT_CHARACT_VAL_ACTS
    Table IT_417[0x156]
    FUNCTION=/SAPAPO/OM_ORDER_CHANGEDATA=IT_CHARACT_VAL_ACTS
    Table reference: 50
    TABH+  0(20) = 00000000000000000000000032000000A1010000
    TABH+ 20(20) = 000000009C000000FFFFFFFF04870000901D0000
    TABH+ 40( 8) = 10000000C1308000
    store        = 0x00000000
    ext1         = 0x00000000
    shmId        = 0     (0x00000000)
    id           = 50    (0x32000000)
    label        = 417   (0xA1010000)
    fill         = 0     (0x00000000)
    leng         = 156   (0x9C000000)
    loop         = -1    (0xFFFFFFFF)
    xtyp         = TYPE#000144
    occu         = 16    (0x10000000)
    access       = 1     (ItAccessStandard)
    idxKind      = 0     (ItIndexNone)
    uniKind      = 2     (ItUniqueNon)
    keyKind      = 1     (default)
    cmpMode      = 8     (cmpManyEq)
    occu0        = 1
    collHash     = 0
    groupCntl    = 0
    rfc          = 0
    unShareable  = 0
    mightBeShared = 0
    sharedWithShmTab = 0
    isShmLockId  = 0
    gcKind       = 0
    isUsed       = 1
    >>>>> Shareable Table Header Data <<<<<
    tabi         = Not allocated
    pghook       = Not allocated
    idxPtr       = Not allocated
    refCount     = Not allocated
    tstRefCount  = Not allocated
    lineAdmin    = Not allocated
    lineAlloc    = Not allocated
    store_id     = Not allocated
    shmIsReadOnly = Not allocated
    >>>>> 1st level extension part <<<<<
    regHook      = Not allocated
    hsdir        = Not allocated
    ext2         = Not allocated
    >>>>> 2nd level extension part <<<<<
    tabhBack     = Not allocated
    delta_head   = Not allocated
    pb_func      = Not allocated
    pb_handle    = Not allocated
    IT_CHARACT_VAL_OUTNODE
    Table IT_419[0x156]
    FUNCTION=/SAPAPO/OM_ORDER_CHANGEDATA=IT_CHARACT_VAL_OUTNODE
    Table reference: 60
    TABH+  0(20) = 0000000000000000000000003C000000A3010000
    TABH+ 20(20) = 000000009C000000FFFFFFFF04870000901D0000
    TABH+ 40( 8) = 10000000C1308000
    store        = 0x00000000
    ext1         = 0x00000000
    shmId        = 0     (0x00000000)
    id           = 60    (0x3C000000)
    label        = 419   (0xA3010000)
    fill         = 0     (0x00000000)
    leng         = 156   (0x9C000000)
    loop         = -1    (0xFFFFFFFF)
    xtyp         = TYPE#000144
    occu         = 16    (0x10000000)
    access       = 1     (ItAccessStandard)
    idxKind      = 0     (ItIndexNone)
    uniKind      = 2     (ItUniqueNon)
    keyKind      = 1     (default)
    cmpMode      = 8     (cmpManyEq)
    occu0        = 1
    collHash     = 0
    groupCntl    = 0
    rfc          = 0
    unShareable  = 0
    mightBeShared = 0
    sharedWithShmTab = 0
    isShmLockId  = 0
    gcKind       = 0
    isUsed       = 1
    >>>>> Shareable Table Header Data <<<<<
    tabi         = Not allocated
    pghook       = Not allocated
    idxPtr       = Not allocated
    refCount     = Not allocated
    tstRefCount  = Not allocated
    lineAdmin    = Not allocated
    lineAlloc    = Not allocated
    store_id     = Not allocated
    shmIsReadOnly = Not allocated
    >>>>> 1st level extension part <<<<<
    regHook      = Not allocated
    hsdir        = Not allocated
    ext2         = Not allocated
    >>>>> 2nd level extension part <<<<<
    tabhBack     = Not allocated
    delta_head   = Not allocated
    pb_func      = Not allocated
    pb_handle    = Not allocated
    IT_EXTERN_CONSTRAINTS
    Table IT_416[0x124]
    FUNCTION=/SAPAPO/OM_ORDER_CHANGEDATA=IT_EXTERN_CONSTRAINTS
    Table reference: 71
    TABH+  0(20) = 00000000000000000000000047000000A0010000
    TABH+ 20(20) = 000000007C000000FFFFFFFF04870000E02A0000
    TABH+ 40( 8) = 10000000C1308000
    store        = 0x00000000
    ext1         = 0x00000000
    shmId        = 0     (0x00000000)
    id           = 71    (0x47000000)
    label        = 416   (0xA0010000)
    fill         = 0     (0x00000000)
    leng         = 124   (0x7C000000)
    loop         = -1    (0xFFFFFFFF)
    xtyp         = TYPE#000215
    occu         = 16    (0x10000000)
    access       = 1     (ItAccessStandard)
    idxKind      = 0     (ItIndexNone)
    uniKind      = 2     (ItUniqueNon)
    keyKind      = 1     (default)
    cmpMode      = 8     (cmpManyEq)
    occu0        = 1
    collHash     = 0
    groupCntl    = 0
    rfc          = 0
    unShareable  = 0
    mightBeShared = 0
    sharedWithShmTab = 0
    isShmLockId  = 0
    gcKind       = 0
    isUsed       = 1
    >>>>> Shareable Table Header Data <<<<<
    tabi         = Not allocated
    pghook       = Not allocated
    idxPtr       = Not allocated
    refCount     = Not allocated
    tstRefCount  = Not allocated
    lineAdmin    = Not allocated
    lineAlloc    = Not allocated
    store_id     = Not allocated
    shmIsReadOnly = Not allocated
    >>>>> 1st level extension part <<<<<
    regHook      = Not allocated
    hsdir        = Not allocated
    ext2         = Not allocated
    >>>>> 2nd level extension part <<<<<
    tabhBack     = Not allocated
    delta_head   = Not allocated
    pb_func      = Not allocated
    pb_handle    = Not allocated
    IT_INPUTS
    Table IT_278[1x420]
    PROGRAM=/SAPAPO/OM_TB_FLOW_QUANTITYFORM=CHANGE_DATADATA=LT_INPUTS
    Table reference: 63
    TABH+  0(20) = 087400E0C0E303E0000000003F00000016010000
    TABH+ 20(20) = 01000000A4010000FFFFFFFF04870000202A0000
    TABH+ 40( 8) = 10000000C1308000
    store        = 0x087400E0
    ext1         = 0xC0E303E0
    shmId        = 0     (0x00000000)
    id           = 63    (0x3F000000)
    label        = 278   (0x16010000)
    fill         = 1     (0x01000000)
    leng         = 420   (0xA4010000)
    loop         = -1    (0xFFFFFFFF)
    xtyp         = TYPE#000211
    occu         = 16    (0x10000000)
    access       = 1     (ItAccessStandard)
    idxKind      = 0     (ItIndexNone)
    uniKind      = 2     (ItUniqueNon)
    keyKind      = 1     (default)
    cmpMode      = 8     (cmpManyEq)
    occu0        = 1
    collHash     = 0
    groupCntl    = 0
    rfc          = 0
    unShareable  = 0
    mightBeShared = 0
    sharedWithShmTab = 0
    isShmLockId  = 0
    gcKind       = 0
    isUsed       = 1
    >>>>> Shareable Table Header Data <<<<<
    tabi         = 0x78DC11E0
    pghook       = 0x00000000
    idxPtr       = 0x00000000
    refCount     = 0     (0x00000000)
    tstRefCount  = 0     (0x00000000)
    lineAdmin    = 16    (0x10000000)
    lineAlloc    = 16    (0x10000000)
    store_id     = 123   (0x7B000000)
    shmIsReadOnly = 0     (0x00000000)
    >>>>> 1st level extension part <<<<<
    regHook      = 0x2029FFDF
    hsdir        = 0x00000000
    ext2         = 0x00000000
    >>>>> 2nd level extension part <<<<<
    tabhBack     = Not allocated
    delta_head   = Not allocated
    pb_func      = Not allocated
    pb_handle    = Not allocated
    IT_INTERN_CONSTRAINTS
    Table IT_415[0x124]
    FUNCTION=/SAPAPO/OM_ORDER_CHANGEDATA=IT_INTERN_CONSTRAINTS
    Table reference: 49
    TABH+  0(20) = 000000000000000000000000310000009F010000
    TABH+ 20(20) = 000000007C000000FFFFFFFF04870000E02A0000
    TABH+ 40( 8) = 10000000C1308000
    store        = 0x00000000
    ext1         = 0x00000000
    shmId        = 0     (0x00000000)
    id           = 49    (0x31000000)
    label        = 415   (0x9F010000)
    fill         = 0     (0x00000000)
    leng         = 124   (0x7C000000)
    loop         = -1    (0xFFFFFFFF)
    xtyp         = TYPE#000215
    occu         = 16    (0x10000000)
    access       = 1     (ItAccessStandard)
    idxKind      = 0     (ItIndexNone)
    uniKind      = 2     (ItUniqueNon)
    keyKind      = 1     (default)
    cmpMode      = 8     (cmpManyEq)
    occu0        = 1
    collHash     = 0
    groupCntl    = 0
    rfc          = 0
    unShareable  = 0
    mightBeShared = 0
    sharedWithShmTab = 0
    isShmLockId  = 0
    gcKind       = 0
    isUsed       = 1
    >>>>> Shareable Table Header Data <<<<<
    tabi         = Not allocated
    pghook       = Not allocated
    idxPtr       = Not allocated
    refCount     = Not allocated
    tstRefCount  = Not allocated
    lineAdmin    = Not allocated
    lineAlloc    = Not allocated
    store_id     = Not allocated
    shmIsReadOnly = Not allocated
    >>>>> 1st level extension part <<<<<
    regHook      = Not allocated
    hsdir        = Not allocated
    ext2         = Not allocated
    >>>>> 2nd level extension part <<<<<
    tabhBack     = Not allocated
    delta_head   = Not allocated
    pb_func      = Not allocated
    pb_handle    = Not allocated
    IT_MODE
    Table IT_275[1x164]
    PROGRAM=/SAPAPO/OM_TB_FLOW_QUANTITYFORM=CHANGE_DATADATA=LT_MODES
    Table reference: 52
    TABH+  0(20) = A03C00E000000000000000003400000013010000
    TABH+ 20(20) = 01000000A4000000FFFFFFFF0487000060290000
    TABH+ 40( 8) = 10000000C1308000
    store        = 0xA03C00E0
    ext1         = 0x00000000
    shmId        = 0     (0x00000000)
    id           = 52    (0x34000000)
    label        = 275   (0x13010000)
    fill         = 1     (0x01000000)
    leng         = 164   (0xA4000000)
    loop         = -1    (0xFFFFFFFF)
    xtyp         = TYPE#000207
    occu         = 16    (0x10000000)
    access       = 1     (ItAccessStandard)
    idxKind      = 0     (ItIndexNone)
    uniKind      = 2     (ItUniqueNon)
    keyKind      = 1     (default)
    cmpMode      = 8     (cmpManyEq)
    occu0        = 1
    collHash     = 0
    groupCntl    = 0
    rfc          = 0
    unShareable  = 0
    mightBeShared = 0
    sharedWithShmTab = 0
    isShmLockId  = 0
    gcKind       = 0
    isUsed       = 1
    >>>>> Shareable Table Header Data <<<<<
    tabi         = 0xC8F611E0
    pghook       = 0x00000000
    idxPtr       = 0x00000000
    refCount     = 0     (0x00000000)
    tstRefCount  = 0     (0x00000000)
    lineAdmin    = 16    (0x10000000)
    lineAlloc    = 16    (0x10000000)
    store_id     = 125   (0x7D000000)
    shmIsReadOnly = 0     (0x00000000)
    >>>>> 1st level extension part <<<<<
    regHook      = Not allocated
    hsdir        = Not allocated
    ext2         = Not allocated
    >>>>> 2nd level extension part <<<<<
    tabhBack     = Not allocated
    delta_head   = Not allocated
    pb_func      = Not allocated
    pb_handle    = Not allocated
    IT_ORDERS
    Table IT_293[1x320]
    PROGRAM=/SAPAPO/OM_TB_FLOW_QUANTITYFORM=CHANGE_DATADATA=LT_ORDERS1
    Table reference: 47
    TABH+  0(20) = 20B403E000000000000000002F00000025010000
    TABH+ 20(20) = 0100000040010000FFFFFFFF0400000030380000
    TABH+ 40( 8) = 01000000C1308000
    store        = 0x20B403E0
    ext1         = 0x00000000
    shmId        = 0     (0x00000000)
    id           = 47    (0x2F000000)
    label        = 293   (0x25010000)
    fill         = 1     (0x01000000)
    leng         = 320   (0x40010000)
    loop         = -1    (0xFFFFFFFF)
    xtyp         = TYPE#000286
    occu         = 1     (0x01000000)
    access       = 1     (ItAccessStandard)
    idxKind      = 0     (ItIndexNone)
    uniKind      = 2     (ItUniqueNon)
    keyKind      = 1     (default)
    cmpMode      = 8     (cmpManyEq)
    occu0        = 1
    collHash     = 0
    groupCntl    = 0
    rfc          = 0
    unShareable  = 0
    mightBeShared = 0
    sharedWithShmTab = 0
    isShmLockId  = 0
    gcKind       = 0
    isUsed       = 1
    >>>>> Shareable Table Header Data <<<<<
    tabi         = 0x9080FFDF
    pghook       = 0x00000000
    idxPtr       = 0x00000000
    refCount     = 0     (0x00000000)
    tstRefCount  = 0     (0x00000000)
    lineAdmin    = 1     (0x01000000)
    lineAlloc    = 1     (0x01000000)
    store_id     = 130   (0x82000000)
    shmIsReadOnly = 0     (0x00000000)
    >>>>> 1st level extension part <<<<<
    regHook      = Not allocated
    hsdir        = Not allocated
    ext2         = Not allocated
    >>>>> 2nd level extension part <<<<<
    tabhBack     = Not allocated
    delta_head   = Not allocated
    pb_func      = Not allocated
    pb_handle    = Not allocated
    IT_ORDER_METHOD
    Table IT_268[2x62]
    PROGRAM=/SAPAPO/OM_TB_FLOW_QUANTITYFORM=CHANGE_DATADATA=LT_ORDER_METHOD
    Table reference: 51
    TABH+  0(20) = 8882FFDF0000000000000000330000000C010000
    TABH+ 20(20) = 020000003E000000FFFFFFFF04000000B0360000
    TABH+ 40( 8) = 10000000C1248000
    store        = 0x8882FFDF
    ext1         = 0x00000000
    shmId        = 0     (0x00000000)
    id           = 51    (0x33000000)
    label        = 268   (0x0C010000)
    fill         = 2     (0x02000000)
    leng         = 62    (0x3E000000)
    loop         = -1    (0xFFFFFFFF)
    xtyp         = TYPE#000278
    occu         = 16    (0x10000000)
    access       = 1     (ItAccessStandard)
    idxKind      = 0     (ItIndexNone)
    uniKind      = 2     (ItUniqueNon)
    keyKind      = 1     (default)
    cmpMode      = 2     (cmpSingleMcmpR)
    occu0        = 1
    collHash     = 0
    groupCntl    = 0
    rfc          = 0
    unShareable  = 0
    mightBeShared = 0
    sharedWithShmTab = 0
    isShmLockId  = 0
    gcKind       = 0
    isUsed       = 1
    >>>>> Shareable Table Header Data <<<<<
    tabi         = 0x0868FFDF
    pghook       = 0x00000000
    idxPtr       = 0x00000000
    refCount     = 0     (0x00000000)
    tstRefCount  = 0     (0x00000000)
    lineAdmin    = 16    (0x10000000)
    lineAlloc    = 16    (0x10000000)
    store_id     = 122   (0x7A000000)
    shmIsReadOnly = 0     (0x00000000)
    >>>>> 1st level extension part <<<<<
    regHook      = Not allocated
    hsdir        = Not allocated
    ext2         = Not allocated
    >>>>> 2nd level extension part <<<<<
    tabhBack     = Not allocated
    delta_head   = Not allocated
    pb_func      = Not allocated
    pb_handle    = Not allocated
    IT_ORDKEYS
    Table IT_271[1x332]
    PROGRAM=/SAPAPO/OM_TB_FLOW_QUANTITYFORM=CHANGE_DATADATA=LT_ORDKEYS
    Table reference: 29
    TABH+  0(20) = 80E303E000000000000000001D0000000F010000
    TABH+ 20(20) = 010000004C010000FFFFFFFF04870000E0270000
    TABH+ 40( 8) = 10000000C1308000
    store        = 0x80E303E0
    ext1         = 0x00000000
    shmId        = 0     (0x00000000)
    id           = 29    (0x1D000000)
    label        = 271   (0x0F010000)
    fill         = 1     (0x01000000)
    leng         = 332   (0x4C010000)
    loop         = -1    (0xFFFFFFFF)
    xtyp         = TYPE#000199
    occu         = 16    (0x10000000)
    access       = 1     (ItAccessStandard)
    idxKind      = 0     (ItIndexNone)
    uniKind      = 2     (ItUniqueNon)
    keyKind      = 1     (default)
    cmpMode      = 8     (cmpManyEq)
    occu0        = 1
    collHash     = 0
    groupCntl    = 0
    rfc          = 0
    unShareable  = 0
    mightBeShared = 0
    sharedWithShmTab = 0

    Hi,
    the error DbpError -28814 denotes that an object cannot be found.
    Can you maybe tell me your exact liveCache version (incl. Build level) and LCA Build?
    Additionally, please copy the relevant error information from the file (/sapdb/data/wrk/<SID>/)knldiag.err into this thread.
    Which exact 'liveCache test program' are your referring to (which of the /SAPAPO/... transactions)?
    Kind regards,
    Roland

  • Not able to get the connection to mssql server thro native sql

    Dear Experts,
               I have created a database connection to mssql server thro DBCO t.code.Am not able to get the connection when i am executing Native SQl for geting connection of mssql server.
    DATA: CON_NAME LIKE DBCON-CON_NAME VALUE 'BIW'.
    EXEC SQL.
      CONNECT TO :con_name AS 'C1'
    ENDEXEC.
    Am always getting sy-subrc = 4. The user name and password i have given in dbcon table having full authorization to access mssql database. I am working SAP ecc 5.0. Also both servers are running in windows.
    could anyone hlep me on this issue.
    Thanks in advance.

    Hello, the submitted error must be analyzed according to the Syntaxis and characteristics of the MSSQL database. See explanation of error.
    http://doc.ddart.net/mssql/sql2000/html/trblsql/tr_reslsyserr_1_1o1i.htm
    Error 156
    Severity Level 15
    Message Text
    Incorrect syntax near the keyword '%.*ls'.
    Explanation
    This error indicates that the syntax of a Transact-SQL statement is incorrect and that the syntax error was detected near the keyword specified in the error message. The most frequent causes for syntax errors are misspellings of Transact-SQL keywords or operators, and specifying the syntax of a Transact-SQL statement in the wrong order.
    One of the more complicated causes for this error may be a compatibility level mismatch for the current database. If the current database has a compatibility level other than 70, Microsoft® SQL Serveru2122 will not recognize any of the keywords that a database with a compatibility level of 70 would recognize.
    Action
    First, check the Transact-SQL statement syntax near the keyword specified in the error message. Because Transact-SQL language syntax can be very complex, SQL Server may incorrectly report the position of the syntax error as later in the Transact-SQL statement than it actually occurred. Second, reexamine the entire Transact-SQL statement that generated the error. Verify the syntax order of the statement.
    Ensure that the database does not have a compatibility level of 65 and has a compatibility level of 70.

  • Performance for join 9 custom table with native SQL ?

    Hi Expert,
    I need your opinion regarding performance to join 9 tables with native sql. Recently i have to tunning some customize extraction cost  report. This report extract about 10 million cost of material everyday.
    The current program actually, try to populate the condition data and insert into customize table and join all the table to get data using native sql.
    SELECT /*+ ordered use_hash(mst,pg,rg,ps,rs,dpg,drg,dps,drs) */
                mst.werks, ....................................
    FROM
                sapsr3.zab_info mst,
                sapsr3.zab_pc pg,
                sapsr3.zab_rc rg,
                sapsr3.zab_pc ps,
                sapsr3.zab_rc rs,
                sapsr3.zab_g_pc dpg,
                sapsr3.zab_g_rc drg,
                sapsr3.zab_s_pc dps,
                sapsr3.zab_s_rc drs
            WHERE mst.zseq_no = :p_rep_run_id
            AND mst.werks = :p_werks
            AND mst.mandt = rg.mandt(+)
            AND mst.ekorg = rg.ekorg(+)
            AND mst.lifnr = rg.lifnr(+)
            AND mst.matnr = rg.matnr(+)
            ...............................................   unitl all table (9 tables)
            AND ps.mandt = dps.mandt(+)
            AND ps.knumh = dps.knumh(+)
            AND ps.zseq_no = dps.zseq_no(+)
            AND COALESCE (dps.kbetr, drs.kbetr, dpg.kbetr, drg.kbetr) <> 0
    It seems the query ask for database to using hashed table. would that be it will burden the database ? and impacted to others sap process ?
    Please advise
    Thank You and Best Regards

    you can only argue coming from measurements and that is not the case.
    Coming from the code, I see only that you do not understand it at all, so better leave it as it is. It is not a hash table, but a hash join on these table.

  • Performance: Open SQL vs. Native SQL (Oracle)

    Hi everybody,
    I have an interesting issue here. For a DB selection I use an Open SQL query from a table view into an internal table. It works fine, but the performance is not very well. The SELECT uses LIKE and wildcards (%) to search for customer master data (names and address fields).
    Because of the bad performance I made some tests in transaction DB02 with native SQL, but exactly the same SELECT structure. It looks like this:
      SELECT *
        FROM zzrm_cust_s_hlp
       WHERE client = 100
         AND mc_name1      LIKE '<name>%'
         AND mc_name2      LIKE '<name>%'
         AND valid_from    <= <timestamp>
         AND valid_to      >= <timestamp>
    Ok, now I tried exactly the same SELECT statement with the same data to search for (<name> and <timestamp) with Open SQL and Native SQL. The Difference is quite suprising, the Native SQL query is about 5-10 times faster (arount 1 sec) than the Open SQL query (around 5-10 sec). Even with the LIKE keywords and the wildcards.
    Any ideas what could be the problem with the Open SQL query?
    And: what can I do to achive the same performance as with the Native SQL query?
    Kind regards and thanks in advance for any help,
    Matthias

    Ok, here is the the SQL explaination from the DB02 query:
    SELECT STATEMENT ( Estimated Costs = 194 , Estimated #Rows = 1 )
           9 COUNT STOPKEY
             Filter Predicates
               8 NESTED LOOPS
                 ( Estim. Costs = 193 , Estim. #Rows = 1 )
                 Estim. CPU-Costs = 1,665,938 Estim. IO-Costs = 193
                   5 NESTED LOOPS
                     ( Estim. Costs = 144 , Estim. #Rows = 98 )
                     Estim. CPU-Costs = 1,162,148 Estim. IO-Costs = 144
                       2 TABLE ACCESS BY INDEX ROWID BUT000
                         ( Estim. Costs = 51 , Estim. #Rows = 93 )
                         Estim. CPU-Costs = 468,764 Estim. IO-Costs = 51
                         Filter Predicates
                           1 INDEX SKIP SCAN BUT000~NAM
                             ( Estim. Costs = 6 , Estim. #Rows = 93 )
                             Search Columns: 1
                             Estim. CPU-Costs = 59,542 Estim. IO-Costs = 6
                             Access Predicates Filter Predicates
                       4 TABLE ACCESS BY INDEX ROWID BUT020
                         ( Estim. Costs = 1 , Estim. #Rows = 1 )
                         Estim. CPU-Costs = 7,456 Estim. IO-Costs = 1
                         Filter Predicates
                           3 INDEX RANGE SCAN BUT020~0
                             ( Estim. Costs = 1 , Estim. #Rows = 1 )
                             Search Columns: 2
                             Estim. CPU-Costs = 3,661 Estim. IO-Costs = 1
                             Access Predicates
                   7 TABLE ACCESS BY INDEX ROWID ADRC
                     ( Estim. Costs = 1 , Estim. #Rows = 1 )
                     Estim. CPU-Costs = 5,141 Estim. IO-Costs = 1
                     Filter Predicates
                       6 INDEX UNIQUE SCAN ADRC~0
                         Search Columns: 4
                         Estim. CPU-Costs = 525 Estim. IO-Costs = 0
                         Access Predicates
    And this is the one from the Open SQL query in ABAP:
    SELECT STATEMENT ( Estimated Costs = 15,711 , Estimated #Rows = 29 )
           7 NESTED LOOPS
             ( Estim. Costs = 15,710 , Estim. #Rows = 29 )
             Estim. CPU-Costs = 3,021,708,117 Estim. IO-Costs = 15,482
               4 NESTED LOOPS
                 ( Estim. Costs = 15,411 , Estim. #Rows = 598 )
                 Estim. CPU-Costs = 3,018,711,707 Estim. IO-Costs = 15,183
                   1 TABLE ACCESS FULL BUT020
                     ( Estim. Costs = 9,431 , Estim. #Rows = 11,951 )
                     Estim. CPU-Costs = 2,959,067,612 Estim. IO-Costs = 9,207
                     Filter Predicates
                   3 TABLE ACCESS BY INDEX ROWID ADRC
                     ( Estim. Costs = 1 , Estim. #Rows = 1 )
                     Estim. CPU-Costs = 4,991 Estim. IO-Costs = 1
                     Filter Predicates
                       2 INDEX UNIQUE SCAN ADRC~0
                         Search Columns: 4
                         Estim. CPU-Costs = 525 Estim. IO-Costs = 0
                         Access Predicates
               6 TABLE ACCESS BY INDEX ROWID BUT000
                 ( Estim. Costs = 1 , Estim. #Rows = 1 )
                 Estim. CPU-Costs = 5,011 Estim. IO-Costs = 1
                 Filter Predicates
                   5 INDEX UNIQUE SCAN BUT000~0
                     Search Columns: 2
                     Estim. CPU-Costs = 525 Estim. IO-Costs = 0
                     Access Predicates
    Of course I can see the difference.
    But since the statements are identical, I don't understand why this difference exists
    Thanks for your help!
    Kind regards, Matthias

  • Native SQL "Table does not exist in database"

    Hi Developers,
    I'm doing a database connection to an Oracle db and trying to read data using native SQL - I keep getting the runtime error "table does not exist in database" on the statement Fetch Next Cursor. The following is the code snippet (I've commented out the Exec SQL and Fetch Next to make sure I have a connection and I do). HR is a schema in the database and T_Donation is a table in HR.
    Data: w1(3),
             c1 type cursor.
    start-of-selection.
      if con_name is initial.
        write: 'No connection specified'.                       "#EC NOTEXT
        return.
      endif.
    try to open the connection and catch the errors (if any)
      try.
          con_ref = cl_sql_connection=>get_connection( con_name ).
        catch cx_sql_exception into sqlerr_ref.
        error occured
          write:
            'Could not open connection', con_name, '.'.         "#EC NOTEXT
          if sqlerr_ref->unknown_connection = 'X'.
            write:
              / con_name, 'is not defined in DBCON'.            "#EC NOTEXT
          elseif sqlerr_ref->db_error = 'X'.
            write:
              / 'sql error', sqlerr_ref->sql_code, 'occured:',
              / sqlerr_ref->sql_message.                        "#EC NOTEXT
          else.
            perform get_trace_file using dev_file.
            write:
              / 'DBI error', sqlerr_ref->internal_error, 'occured.',
              / 'See trace file for further info:',
                icon_read_file as icon hotspot, dev_file.       "#EC NOTEXT
          endif.
          return.
      endtry.
    connection successfully opened
      write:
        / 'Connection', con_name, 'successfully opened.'.       "#EC NOTEXT
    *- Get the data from MS-SQL Server
      EXEC SQL.
        open C1 for
        SELECT HR.T_DONATION.DN_DONATIONYEAR
        FROM HR.T_DONATION
      ENDEXEC.
      do.
        EXEC SQL.
          FETCH NEXT C1 into :w1
        ENDEXEC.
        if sy-subrc = 0.
          perform loop_output.
        else.
          exit.
        endif.
      enddo.
      EXEC SQL.
        CLOSE C1
      ENDEXEC.
    close connection again
      con_ref->close( ).
      write:
        / 'Connection', con_name, 'closed'.                     "#EC NOTEXT
    end-of-selection.
    *& Form LOOP_OUTPUT
    Output
    form loop_output .
      write: /5 w1.
    endform. " LOOP_OUTPUT
    Thanks for your help.
    Jim
    Message was edited by:
            James Barnes

    Well my advice is to check the question in the sql tutorial, it will be quicker then getting an answere.

  • TIME_OUT in SAP when accessing external Oracle table thru native SQL

    Hi,
    I have a problem in one of my native SQL statement. It takes a long time accessing the table considering that the number of records to be retrieved is only small.
    Something happened on the Oracle system. But, stilll to be confirmed. Before, there wasn't any issue. Looking further, I found that when the value in the where clause equated is a literal (meaning the value is not declared in DATA or CONSTANTS in the ABAP Program)
    Example
    1.
    EXEC.
    WHERE FIELD = '1'
    ENDEXEC.
    instead of
    2.
    CONSTANTS: c_1 value '1'.
    EXEC.
    WHERE FIELD = c_1
    ENDEXEC.
    i found that when the way of coding is same as Example 1, a time-out error occurs. But when in Example 2, no issue.
    Can someone explain this? is their something that could affect SAP with respect to Oracle configuration?
    Thanks!

    I wonder if you could share the outline of your code to access an external oracle database.   I've just been given the assignment to do just that, but don't know where to start.
    thx,
    Mike DeGuire

  • TIME_OUT when accessing Oracle table from SAP using native SQL

    Hi,
    I have a problem in one of my native SQL statement. It takes a long time accessing the table considering that the number of records to be retrieved is only small.
    Something happened on the Oracle system. But, stilll to be confirmed. Looking further at the issue, it seems that when the value in the where clause equated is a literal (meaning the value is not declared in DATA or CONSTANTS in the ABAP Program)
    Example
    1.
    EXEC.
    WHERE FIELD = '1'
    ENDEXEC.
    instead of
    2.
    CONSTANTS: c_1 value '1'.
    EXEC.
    WHERE FIELD = c_1
    ENDEXEC.
    i found that when the way of coding is same as Example 1, a time-out error occurs. But when in Example 2, no issue.
    Can someone explain this?
    Thanks!

    Repetitively asking the same question again and again is against the forum rules.
    Please post an explain of the SQL statement on the remote machine.
    Markus

  • Possible to do "grant" sql statement in Native SQL?

    We have a need to do a grant of access from one of our systems out for various applications.  In order for this to work we need to run a grant access command on the table and are trying to put a wrapper around this so we can use an abap.  Below is the code I am unit testing.  Two questions.  First, can a grant be done via native SQL in abap?  Second, if it can be done, what is the error with the logic where I am trying to put in the table name via a parameter.
    REPORT  ZLJTEST2.
    tables dd02l.
    DATA scarr_carrid TYPE dd02l-tabname.
    SELECT-OPTIONS s_carrid for dd02l-tabname no intervals.
    DATA s_carrid_wa LIKE LINE OF s_carrid.
    DATA name TYPE c LENGTH 20.
    TRY.
        EXEC SQL.
          CREATE FUNCTION selfunc( input CHAR(20) )
            RETURNING char(20);
            DEFINE output char(20);
            set schema sapr3;
            grant select on table input to group infouser;
            RETURN output;
            END FUNCTION;
        ENDEXEC.
        LOOP AT s_carrid INTO s_carrid_wa
                         WHERE sign = 'I' AND option = 'EQ'.
          TRY.
             EXEC SQL.
                EXECUTE PROCEDURE selfunc( IN  :s_carrid_wa-low,
                                           OUT :name )
              ENDEXEC.
              WRITE: / s_carrid_wa-low, name.
            CATCH cx_sy_native_sql_error.
              MESSAGE `Error in procedure execution` TYPE 'I'.
          ENDTRY.
        ENDLOOP.
        EXEC SQL.
          DROP FUNCTION selfunc;
        ENDEXEC.
      CATCH cx_sy_native_sql_error.
        MESSAGE `Error in procedure handling` TYPE 'I'.
    ENDTRY.

    Hi,
    Yes it is posible.
    I made one program like you want. But it need very long code.
    Here I explain the idea:
    1. Create Screen with input TEXT EDIT CONTROL.
        This is for input SQL Statement.
    2. Get SQL Statement from Text Edit Control using method <b>get_text_as_r3table</b>.
    3. Now we need to separate SQL Statement into different table.
        We Separate SELECT, FROM, WHERE, GROUP, HAVING, ORDER, etc.
    4. We need dynamic internal table to store the data.
    5. Select the data according SQL statement.
          SELECT (IT_SELECT)
            into corresponding fields of table  <dyn_table>
          FROM (IT_FROM)
          WHERE (IT_WHERE)
          GROUP BY (IT_GROUP)
          HAVING (IT_HAVING)
          ORDER BY (IT_ORDER).
    6. Display our data using ALV GRID
    Hopefully it will help you.
    Regards,

  • Invalid column Index error - While consuming Calculation view via Native SQL

    Hi Experts,
    I am trying to consume a Calculation view (sql script one) , which has input parameters, via Native SQL in a ABAP program .
    Code snippet for the same would be as follows , Upon execution, it throws an error "Invalid Column Index (8) error " . Can anyone help what could be the issue here ?
    Thanks in Advance,
    Suma
    REPORT ZTEST_HANA2.
    *Report to consume Calculation view (script based) from ABAP
    PARAMETERS: ip_docnr type BELNR_D,
                ip_gjahr type GJAHR,
                ip_bukrs type BUKRS,
                ip_blgr type FAGL_RLDNR.
       DATA: LO_SQL_STMT TYPE REF TO CL_SQL_STATEMENT,
              LO_CONN     TYPE REF TO CL_SQL_CONNECTION,
              LO_RESULT   TYPE REF TO CL_SQL_RESULT_SET,
              LV_SQL      TYPE STRING,
              LR_DATA     TYPE REF TO DATA.
        DATA: LX_SQL_EXC           TYPE REF TO CX_SQL_EXCEPTION,
              LT_SEPMAPPS_CLSDINV  TYPE TABLE OF SEPMAPPS_CLSDINV,
              LV_TEXT              TYPE STRING.
        TRY.
    lv_sql = |SELECT * FROM "_SYS_BIC"."DEMO-ABAP/CA_GET_FI_DATA" | &&
                     |WITH PARAMETERS ('placeholder'= ('$$p_DOCNR$$','{ ip_docnr }'),| &&
                      |'placeholder'=('$$p_GJAHR$$','{ ip_gjahr }')| &&
                      |,'placeholder'= ('$$S_BUKRS$$','{ ip_bukrs }')| &&
                      |,'placeholder'= ('$$p_base_ledger$$','{ ip_blgr }') )| .
             LO_CONN = CL_SQL_CONNECTION=>GET_CONNECTION( ).
             "Create an SQL statement to be executed via the connection
              LO_SQL_STMT = LO_CONN->CREATE_STATEMENT( ).
             "Execute the native SQL query
             LO_RESULT = LO_SQL_STMT->EXECUTE_QUERY( LV_SQL ).
             "Read the result into the internal table lt_sepmapps_clsdinv
             GET REFERENCE OF LT_SEPMAPPS_CLSDINV INTO LR_DATA.
             LO_RESULT->SET_PARAM_TABLE( LR_DATA ).
             LO_RESULT->NEXT_PACKAGE( ).
             LO_RESULT->CLOSE( ).
             LO_CONN->CLOSE( ).
        CATCH CX_SQL_EXCEPTION INTO LX_SQL_EXC.
             LV_TEXT = LX_SQL_EXC->GET_TEXT( ).
             MESSAGE LV_TEXT TYPE 'E'.
        ENDTRY.

    Hi Suma,
    Post the SQL you success run directly on Studio together with error message (even if is the Invalid column index error).
    Check there if the parameters case is working properly... Is it really this confusing options:
    p_GJAHR
    S_BUKRS
    p_base_ledger
    Why not all lower or all upper? Anyhow you must test and find which option works according your modeling
    Regards, Fernando Da Rós

  • Executing Native SQL query for oracle

    Hi,
    I want to run following native sql query but it is giving me error ora:933,
    DATA: BEGIN OF WA,
          TSP_NAME(255) TYPE C,
          PER_USAGE(10) TYPE C,
          END OF WA.
    EXEC SQL PERFORMING loop_output.
    select t.tablespace_name,'(' || TO_CHAR(ROUND(100*(NVL(b.bytes,0)/NVL(a
    .bytes,0)))) || '%)' "TSUsed%" from dba_tablespaces t,
    ( select tablespace_name, sum(bytes)/1024/1024 bytes
    from dba_data_files group by tablespace_name) a,
    ( select e.tablespace_name, sum(e.bytes)/1024/1024 bytes
    from dba_extents e group by e.tablespace_name ) b,
    ( select f.tablespace_name, sum(f.bytes)/1024/1024 bytes
    from dba_free_space f group by f.tablespace_name ) c
    where t.tablespace_name = a.tablespace_name(+) and
    t.tablespace_name = b.tablespace_name(+) and
    t.tablespace_name = c.tablespace_name(+) into :wa.
    ENDEXEC.
    Please provide me the soln
    Regards,
    Bharat Mistry

    ORA-00933: SQL command not properly ended.
    Try:
    EXEC SQL PERFORMING loop_output.
    select
    into :wa
    ENDEXEC.
    (No "." at the end). If that doesn't work, try ending it with a ";"
    Rob

  • How to use Native SQL statement in JDBC receiver interface

    Dear All,
    Can any one please help us in using Native SQL statement in a JDBC receiver channel. The reason why I need to use Native SQL statement instead of standard XML structure is that I need to execute a dynamic SQL query in third party database system lke:-
    Select Field1 Field2 from TABLE Where Field3 like "%Name'
    I expect the the response in the form of XML file which I can pick up using synchornous interface as mentioned on help.sap.com:-
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    The value for %Name can change dynamically according to the transaction and hence cannot be inluded as a KEY element in standard XLM structure,
    Hence I need to know:-
    1. What message mapping I should use in case if I have to use Native SQL statement.
    2.What operation mapping I should use in case if I have to use Native SQL statement.
    If guess correclty I may have to use Java mapping to do the above activities. Hence I want to know
    3 .How do to go about it to do the Java mapping.
    Thanks
    Ameet

    >
    Ameet Deshpande wrote:
    > Dear All,
    >
    > Can any one please help us in using Native SQL statement in a JDBC receiver channel. The reason why I need to use Native SQL statement instead of standard XML structure is that I need to execute a dynamic SQL query in third party database system lke:-
    >
    > "
    > Select Field1 Field2 from TABLE Where Field3 like "%Name'
    > "
    > I expect the the response in the form of XML file which I can pick up using synchornous interface as mentioned on help.sap.com:-
    >
    > http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    > http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm
    >
    > The value for %Name can change dynamically according to the transaction and hence cannot be inluded as a KEY element in standard XLM structure,
    >
    > Hence I need to know:-
    >
    > 1. What message mapping I should use in case if I have to use Native SQL statement.
    > 2.What operation mapping I should use in case if I have to use Native SQL statement.
    > If guess correclty I may have to use Java mapping to do the above activities. Hence I want to know
    > 3 .How do to go about it to do the Java mapping.
    >
    > Thanks
    > Ameet
    You can use a stored procedure, and call it from jdbc receiver adapter.
    I also solve this issue, with a DBLookup in message mapping. You can refer to my blog, and this usefull 3d:
    http://simonlesflex.wordpress.com/2010/12/07/pi-oracle-dblookup/
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler

  • Using Native SQL in ABAP for DB2 database

    Dear Friends,
           I have 500K records in ITAB(Internal table) which needs to insert in 'Z' transparent table. Currently it is taking hours of time for insertion and commit. 
    Does using Native SQL helps in performance or any suggestions? If so please send the code. Our database is DB2.
    Your immediate reply is appreciated. Thanks in advance.

    Hi Rama,
    Using array inserts and commit after each Insert, set up your array size as a parameter and try  different array sizes.
    I would start with 2000 and increment by 1000 or 2000 and see what the optimal array size is.
    I would think more commits are desirable, as the array gets bigger it takes longer for the system to prepare in the event of a rollback.
    Just remember to commit after each insert. And are you enqueueing the table first?
    Hope this helps.
    Filler

  • Native sql not populating correct data in ECC6.0 unicode system

    Hi,
    I am working in an upgrade upgrade project from 4.6c to ECC6.0.
    4.6c is non-unicode system. ECC6 is Unicode system.
    I am facing Native SQL problem in custom developed programe in ECC6.That means programe reading the data from oracle datbase and stored into internal table.
    But data not stored as normal character format that means its stored as different character format.
    I am suspecting this is due to unicode system. IF that is issue then please provide
    what syntax I have to use for Native SQL statment in unicode system.
    I have provided the code which we are using in programe.
      data:
        i_locn       type table of t_locn,
        v_locn       like line  of i_locn.
      field-symbols:
        <f_005t>        type t_005t.
    Get existing EIS_VIDEO_LOCN_CONV records
      EXEC SQL.
        OPEN C FOR
          SELECT EIS_LOCN
            FROM VIDADMIN.EIS_VIDEO_LOCN_CONV
      ENDEXEC.
      do.
        EXEC SQL.
          FETCH NEXT C
            INTO :V_LOCN-EIS_LOCN
        ENDEXEC.
        if sy-subrc ne 0.
          exit.
        endif.
        append v_locn to i_locn.
      enddo.
      EXEC SQL.
        CLOSE C
      ENDEXEC.
      sort i_locn.
    I am facing the problem in i_locn internal table. Please give me your input to solve this issue.
    - Anandakumar K

    Hi,
    We have resolved this issue with BASIS team help.
    We modified the data charcater set as UTF8  in Oracle data base in unicode system ECC6.0 then the programme returns the
    exact character format
    Regards
    K.Anandakumar

  • Error handling in Native SQL for ORACLE

    Hi,
    I have the next code:
    DATA instr TYPE char4.
    EXEC SQL.
        SELECT INSTRUMENTO INTO instr FROM DATOSMAESTROS
    END EXEC.
    And I want to control if the select has no results. Is it possible with the statement EXCEPTION inside EXEC SQL? Something like that:
    DATA instr TYPE char4.
    EXEC SQL.
        SELECT INSTRUMENTO INTO instr FROM DATOSMAESTROS WHERE id_inst = '01'
        EXCEPTION
             WHEN NO_DATA_FOUND THEN
                      :err = SQLCODE
                      INSERT INTO error( field, code_err) VALUES ( 'instrumento',:err)
    END EXEC.
    Is this a correct code? If not, how can I do it?
    Thank you all,
    Cris.

    Hello,
    Take a look on this: http://help.sap.com/saphelp_nw04s/helpdata/en/fc/eb3b8b358411d1829f0000e829fbfe/frameset.htm
    Try this:
    DATA instr TYPE char4.
    EXEC SQL.
    SELECT INSTRUMENTO INTO :instr FROM DATOSMAESTROS
    ENDEXEC.
    Look that I put : inside the native SQL before the intr.
    To catch if no data was recovered try this:
    DATA instr TYPE char4.
    EXEC SQL PERFORMING no_data.
    SELECT INSTRUMENTO INTO :instr FROM DATOSMAESTROS
    ENDEXEC.
    FORM no_data.
      IF instr IS INITIAL.
        MESSAGE ...
      ENDIF.
    ENDFORM.
    Regards.

Maybe you are looking for

  • 10.4 install fails on stock PowerMac G4 450 Sawtooth running OS 9.2.2

    I did my search before posting this question so helpful answers would be appreciated. I aquired a PowerMac G4 450 AGP system which originally had OS 9.0.2, 20Gb HD, 256Mb ram, DVD-Rom and standard AGP video card. I have since pumped the ram up to 384

  • Reading a properties file in a servlet and passing its contents to a JSP pa

    Hi all, I'm totally new to Servlet pgmg n JSP. Please can ne1 tell how to read a simple properties file (in a servlet) and pass its contents to a JSP page.Actually the reason is to fill a combo box in a JSP page with the contents of a properties file

  • Socket Exception in File to Mail Scenario

    Hi All, I developed file to mail scenario, where I am getting the following error in SXMB_MONI :- <b>  <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - <!--  Call Adapter   --> - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:

  • Oracle APEX 4.0 no images

    Hello to everybody after i have run @apexins SYSAUX SYSAUX TEMP /i/ the Application will be opened but there are no images. What is wrong? Need i copy something? Where is the directory /i/ ? Regards, bladepit

  • How to map A contruction business in business one

    Friends One of my prospect has enquired whether his construction business can be mapped in B1 .the firm is involved in construction of residential properties(Apartments and flats) how can we treat flats or properties which are under consruction?your