Regd Join

Hi all,
       The below statement is taking a very long time, can any one please suggest what can be done to reduce the time.
*read PO history from EKBE join EKKO
SELECT ekbeebeln ekbeebelp ekbe~vgabe
  ekbegjahr ekbebelnr ekbebuzei ekbebewtp
  ekbebwart ekbebudat ekbemenge ekbedmbtr
  ekbewrbtr ekbewaers ekbearewr ekbeshkzg
  ekbecpudt ekbexblnr ekbematnr ekkolifnr ekpo~meins
INTO TABLE l_tbl_ekbe
FROM ekbe JOIN ekko
   ON ekbeebeln = ekkoebeln
JOIN ekpo
    ON ekbeebeln = ekpoebeln
   AND ekbeebelp = ekpoebelp
WHERE ekbe~ebeln IN s_ebeln
   AND ekbe~ebelp IN s_ebelp
   AND ekbe~vgabe IN r_vgabe
   AND ekbe~gjahr IN r_gjahr
   AND ekbe~budat IN s_budat
   AND ekbe~matnr IN s_matnr
   AND ekbe~werks IN r_werks
   AND ekko~bukrs = p_bukrs
   AND ekko~lifnr IN s_lifnr
   AND ekko~bsart IN r_bsart.
*Select History per Purchasing Document: Delivery Costs (EKBZ)
  REFRESH l_tbl_ekbz.
  SELECT aebeln aebelp a~vgabe
  agjahr abelnr abuzei abewtp
  abudat amenge a~dmbtr
  awrbtr awaers aarewr ashkzg
  acpudt axblnr c~matnr
  blifnr cmeins
  a~belnr AS awkey
  FROM ekbz AS a JOIN ekko AS b
      ON aebeln = bebeln
      JOIN ekpo AS c
      ON aebeln = cebeln
      AND aebelp = cebelp
  INTO CORRESPONDING FIELDS OF TABLE l_tbl_ekbz 
  FOR ALL ENTRIES IN l_tbl_ebeln
  WHERE a~ebeln = l_tbl_ebeln-ebeln
      AND a~ebelp = l_tbl_ebeln-ebelp
      AND a~budat IN s_budat.
  APPEND LINES OF l_tbl_ekbz TO l_tbl_ekbe.

Hi,
Use INNER JOIN rather than JOIN.
And change the join structure, first take on left EKKO, EKPO then EKBE.
Same way for second query EKKO, EKPO then EKBZ.
Hope this will increase performance.
Regards,
Ravi K

Similar Messages

  • Regd: Sale Order U.O.M

    Hi All,
    While downloadng the data from VBAP DB Table fro a particular S.O.document the Unit of measurement correct value is not geting stored in the internal table but at the time of displaying as a report i get the correct value.
    Like when i set a break point in the program at the internal table level and view the data's the field value of VBAP-VRKME or VBAP-MEINS should be "PC" but i am getting a value as "ST" but at the time of displaying in the report it is displaying as "PC" only.
    Because i hav to generate a XML based on the values of the Internal Table.
    Is there any possibility to eliminate this problem or any other corressponding table from which i can get the exact value.
    Help and Suggestions will be much appreciated.
    Thanks & Regds.
    Ramesh.

    Hi Tanveer Shaikh,
    Here is my sample code below.
    REPORT  ZSO_STATUS_XML NO STANDARD PAGE HEADING.
       TBALES DECLARATION
    TABLES:  VBAK, "Sale Order Header
             VBAP, "Sale Order Item Data
             VBEP, "Schedule Line Data
             KNA1, "General Data in Customer Master
             VBRP. "Billing Document Item Data
       TYPES DECLARATION
    TYPES : BEGIN OF TY_SOSTATUS,
              KUNNR    LIKE VBAK-KUNNR,  "Customer Number
              NAME1    LIKE KNA1-NAME1,  "Customer Name
              BSTNK    LIKE VBAK-BSTNK,  "Customer P.O.
              BSTDK    LIKE VBAK-BSTDK,  "Customer P.O. Date
              VBELN    LIKE VBAK-VBELN,  "Sale Order Number
              ERDAT    LIKE VBAK-ERDAT,  "Sale Order Date
              POSNR    LIKE VBAP-POSNR,  "Sale Order Line Item
              MATNR    LIKE VBAP-MATNR,  "Material Number
              ARKTX    LIKE VBAP-ARKTX,  "Material Description
              KWMENG   LIKE VBAP-KWMENG, "Sale Order Quantity
              MEINS    LIKE VBAP-MEINS,  "Unit of Measurement
              EDATU    LIKE VBEP-EDATU,  "Sale Order Schedule Date
              FKIMG    LIKE VBRP-FKIMG,  "Despatch Quantity
              GBSTA    LIKE VBUP-GBSTA,  "Overall Sale Order Status
              PNDQTY TYPE I,
    END OF TY_SOSTATUS.
    DATA: XML_OUT TYPE STRING.
       INTERNAL TABLE DECLARATION
    DATA : IT_SOSTATUS TYPE STANDARD TABLE OF TY_SOSTATUS
                WITH HEADER LINE INITIAL SIZE 100 WITH DEFAULT KEY.
    DATA : BEGIN OF IT_XML_OUT  OCCURS 0,
           A(1500) TYPE C,
           END OF IT_XML_OUT.
       SELECTION SCREEN DECLARATION
    SELECTION-SCREEN  BEGIN OF BLOCK SOBLOCK WITH FRAME.
    SELECT-OPTIONS:   S_VBELN FOR VBAK-VBELN,
                      S_ERDAT FOR VBAK-ERDAT,
                      S_AUART  FOR VBAK-AUART,
                      S_WERKS FOR VBAP-WERKS.
    SELECTION-SCREEN  END OF BLOCK SOBLOCK.
       START OF SELECTION
    SELECT SVBELN SAUART SERDAT SKUNNR SBSTNK SBSTDK
                   LPOSNR LMATNR LARKTX LKWMENG L~MEINS
                   EEDATU FFKIMG GGBSTA NNAME1 FROM VBAK AS S INNER JOIN VBAP AS L ON SVBELN = LVBELN
                                                          INNER JOIN VBEP AS E ON SVBELN = EVBELN
                                                          INNER JOIN VBRP AS F ON SVBELN = FAUBEL
                                                          INNER JOIN VBUP AS G ON SVBELN = GVBELN
                                                          INNER JOIN KNA1 AS N ON SKUNNR = NKUNNR
                                                          INTO CORRESPONDING FIELDS OF TABLE IT_SOSTATUS
                                                          WHERE S~AUART IN S_AUART AND
                                                          S~ERDAT IN S_ERDAT AND
                                                          L~WERKS IN S_WERKS .
    CALL TRANSFORMATION (`ID`) SOURCE IT_XML_OUT = IT_SOSTATUS[] RESULT XML XML_OUT.
    CALL FUNCTION 'HR_EFI_CONVERT_STRING_TO_TABLE'
      EXPORTING
        I_STRING               = XML_OUT
        I_TABLINE_LENGTH       = 1500
      TABLES
        ET_TABLE               = IT_XML_OUT
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filetype = 'BIN'
    filename = 'C:\TEST1.xml'
    TABLES
    data_tab = IT_XML_OUT.
    submit Z_INO1_SO_STATUS_FTP USING SELECTION-SET 'Z_SO_FTP' and
    return .

  • Regd: Converting Data in XML file

    Hi All,
    We hav a requirement to convert the data from Internal table into a XML file.
    The scenario is we hav developed a program to download the data in XML format,the problem is when the file is converted inot XML format its giving erreor that
    <b>The XML page cannot be displayed
    End tag 'KUN' does not match the start tag 'KUNNR'. Error processing resource 'file:///C:/TEST.xml'. Line 2, Position 1712
    <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0"><asx:values><IT_XML_OUT><item><VBE...</b>
    The code is specified below for understanding.
       TBALES DECLARATION
    TABLES:  VBAK, "Sale Order Header
             VBAP, "Sale Order Item Data
             VBEP, "Schedule Line Data
             KNA1, "General Data in Customer Master
             VBRP. "Billing Document Item Data
       TYPES DECLARATION
    TYPES : BEGIN OF TY_SOSTATUS,
              KUNNR    LIKE VBAK-KUNNR,  "Customer Number
              NAME1    LIKE KNA1-NAME1,  "Customer Name
              BSTNK    LIKE VBAK-BSTNK,  "Customer P.O.
              BSTDK    LIKE VBAK-BSTDK,  "Customer P.O. Date
              VBELN    LIKE VBAK-VBELN,  "Sale Order Number
              ERDAT    LIKE VBAK-ERDAT,  "Sale Order Date
              POSNR    LIKE VBAP-POSNR,  "Sale Order Line Item
              MATNR    LIKE VBAP-MATNR,  "Material Number
              ARKTX    LIKE VBAP-ARKTX,  "Material Description
              KWMENG   LIKE VBAP-KWMENG, "Sale Order Quantity
              VRKME    LIKE VBAP-VRKME,  "Unit of Measurement
              EDATU    LIKE VBEP-EDATU,  "Sale Order Schedule Date
              FKIMG    LIKE VBRP-FKIMG,  "Despatch Quantity
              GBSTA    LIKE VBUP-GBSTA,  "Overall Sale Order Status
              PNDQTY TYPE I,
    END OF TY_SOSTATUS.
    TYPES : BEGIN OF TEMP_DISP,
              VBELN    LIKE VBAK-VBELN,
              AUART    LIKE VBAK-AUART,
              ERDAT    LIKE VBAK-ERDAT,
              KUNNR    LIKE VBAK-KUNNR,
              BSTNK    LIKE VBAK-BSTNK,
              BSTDK    LIKE VBAK-BSTDK,
              POSNR    LIKE VBAP-POSNR,
              MATNR    LIKE VBAP-MATNR,
              ARKTX    LIKE VBAP-ARKTX,
              KWMENG   LIKE VBAP-KWMENG,
              VRKME    LIKE VBAP-VRKME,
    END OF TEMP_DISP.
    DATA: XML_OUT TYPE STRING.
       INTERNAL TABLE DECLARATION
    DATA : IT_SOSTATUS TYPE STANDARD TABLE OF TY_SOSTATUS
                WITH HEADER LINE INITIAL SIZE 100 WITH DEFAULT KEY.
    DATA : IT_TEMP TYPE STANDARD TABLE OF TEMP_DISP
                WITH HEADER LINE INITIAL SIZE 100 WITH DEFAULT KEY.
    DATA : BEGIN OF IT_XML_OUT  OCCURS 0,
           A(1500) TYPE C,
           END OF IT_XML_OUT.
       SELECTION SCREEN DECLARATION
    SELECTION-SCREEN  BEGIN OF BLOCK SOBLOCK WITH FRAME.
    SELECT-OPTIONS:   S_VBELN FOR VBAK-VBELN,
                      S_ERDAT FOR VBAK-ERDAT,
                      S_AUART  FOR VBAK-AUART,
                      S_WERKS FOR VBAP-WERKS.
    SELECTION-SCREEN  END OF BLOCK SOBLOCK.
       START OF SELECTION
    SELECT SVBELN SAUART SERDAT SKUNNR SBSTNK SBSTDK
           LPOSNR LMATNR LARKTX LKWMENG L~VRKME FROM VBAK AS S
                                                        INNER JOIN VBAP AS L
                                                        ON SVBELN = LVBELN
                                                        INTO CORRESPONDING FIELDS OF TABLE IT_TEMP
                                                        WHERE S~AUART IN S_AUART AND
                                                              S~ERDAT IN S_ERDAT AND
                                                              L~WERKS IN S_WERKS .
    CALL TRANSFORMATION (`ID`) SOURCE IT_XML_OUT = IT_TEMP[] RESULT XML XML_OUT.
    CALL FUNCTION 'SOTR_SERV_STRING_TO_TABLE'
      EXPORTING
        TEXT                      = XML_OUT
      FLAG_NO_LINE_BREAKS       = 'X'
       LINE_LENGTH               = 65000
      LANGU                     = SY-LANGU
      TABLES
        TEXT_TAB                  = IT_XML_OUT[].
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filetype = 'BIN'
    filename = 'C:\TEST.xml'
    TABLES
    data_tab = IT_XML_OUT[].
    Is there any other way to process this and download in XML format.
    Help and Suggestions will be much Appreciated.
    Thanks & Regds.
    Ramesh.

    Hi ramesh,
    1. itab --- > xml
    xml ---> itab.
    2. This program will do both.
    (just copy paste in new program)
    3.
    REPORT abc.
    DATA
    DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
    DATA : BEGIN OF itab OCCURS 0,
    a(100) TYPE c,
    END OF itab.
    DATA: xml_out TYPE string .
    DATA : BEGIN OF upl OCCURS 0,
    f(255) TYPE c,
    END OF upl.
    DATA: xmlupl TYPE string .
    FIRST PHASE
    FIRST PHASE
    FIRST PHASE
    Fetch Data
    SELECT * FROM t001 INTO TABLE t001.
    XML
    CALL TRANSFORMATION ('ID')
    SOURCE tab = t001[]
    RESULT XML xml_out.
    Convert to TABLE
    CALL FUNCTION 'HR_EFI_CONVERT_STRING_TO_TABLE'
    EXPORTING
    i_string = xml_out
    i_tabline_length = 100
    TABLES
    et_table = itab.
    Download
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filetype = 'BIN'
    filename = 'd:\xx.xml'
    TABLES
    data_tab = itab.
    SECOND PHASE
    SECOND PHASE
    SECOND PHASE
    BREAK-POINT.
    REFRESH t001.
    CLEAR t001.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = 'D:\XX.XML'
    filetype = 'BIN'
    TABLES
    data_tab = upl.
    LOOP AT upl.
    CONCATENATE xmlupl upl-f INTO xmlupl.
    ENDLOOP.
    XML
    CALL TRANSFORMATION ('ID')
    SOURCE XML xmlupl
    RESULT tab = t001[]
    BREAK-POINT.
    regards,
    amit m.

  • Problem in joining tables

    Hi All,
    Here I am facing the problem in Joining table I have S031,s032,makt,marc,I need a field ATWRT field from CAWN table,I did't find any link for this above from tables, any one please help me how to find out.
    REPORT  ZMMTEST.
    tables:s031,s032,makt,marc.
    DATA : BEGIN OF itab1 OCCURS 0,
           matnr TYPE s031-matnr,
           lgort      TYPE s031-lgort,
           werks      TYPE s031-werks,
           spmon      TYPE s031-spmon,
           magbb      type S031-magbb,
           wagbb      type S031-wagbb,
           azubb      type S031-azubb,
           aagbb      type S031-aagbb,
           END OF itab1.
    DATA : BEGIN OF itab2 OCCURS 0,
           matnr like makt-matnr,
           maktx like makt-maktx,
           END OF itab2.
    DATA : BEGIN OF itab3 OCCURS 0,
           matnr TYPE marc-matnr,
           werks type marc-werks,
           ekgrp type marc-ekgrp,
           END OF itab3.
    DATA : BEGIN OF itab4 OCCURS 0 ,
           matnr   TYPE s032-matnr,
           lgort   TYPE s032-lgort,
           werks   TYPE s032-werks,
           mbwbest type s032-mbwbest,
           wbwbest type s032-wbwbest,
           END OF itab4.
    data : begin of itab5 occurs 0,
          objek   type ausp-objek,
           atwrt   type cawn-atwrt,
           end of itab5.
    DATA : BEGIN OF itab_final1 OCCURS 0,
           matnr      TYPE s031-matnr,
           lgort      TYPE s031-lgort,
           werks      TYPE s031-werks,
           spmon      TYPE s031-spmon,
           magbb      type S031-magbb,
           wagbb      type S031-wagbb,
           azubb      type S031-azubb,
           aagbb      type S031-aagbb,
           maktx      TYPE makt-maktx,
           ekgrp      type marc-ekgrp,
           mbwbest    type s032-mbwbest,
           wbwbest    type s032-wbwbest,
           END OF itab_final1.
    DATA : BEGIN OF itab_final OCCURS 0,
           matnr      TYPE s031-matnr,
           lgort      TYPE s031-lgort,
           werks      TYPE s031-werks,
           spmon      TYPE s031-spmon,
           magbb      type S031-magbb,
           wagbb      type S031-wagbb,
           azubb      type S031-azubb,
           aagbb      type S031-aagbb,
           maktx      TYPE makt-maktx,
           ekgrp      type marc-ekgrp,
           mbwbest    type s032-mbwbest,
           wbwbest    type s032-wbwbest,
           atwrt      type cawn-atwrt,
           END OF itab_final.
    select-options:s_matnr for s031-matnr.
    start-of-selection.
    select matnr lgort werks spmon magbb wagbb azubb aagbb
            from s031 into  table itab1
            where matnr in s_matnr.
    if not itab1[] is initial.
        select matnr maktx from makt into table itab2 for all entries in itab1 where matnr = itab1-matnr.
    if not itab2[] is initial.
       select matnr werks ekgrp from marc into table itab3 for all entries in itab2 where matnr = itab2-matnr.
    if not itab3[] is initial.
       select matnr werks mbwbest wbwbest from s032 into corresponding fields of table itab4 for all entries in itab3 where matnr = itab3-matnr.
    *if not itab4[] is initial.
       select atwrt from cawn into corresponding fields of table itab5.*
         endif.
       endif.
    endif.
    endif.
    end-of-selection.
      loop at itab3.
       itab_final-matnr = itab3-matnr.
       read table itab2 with key matnr = itab3-matnr.
       if sy-subrc = 0.
        itab_final-maktx = itab2-maktx.
       read table itab1 with key matnr = itab2-matnr.
       if sy-subrc = 0.
        itab_final-lgort = itab1-lgort.
        itab_final-werks = itab1-werks.
        itab_final-spmon = itab1-spmon.
        itab_final-magbb = itab1-magbb.
        itab_final-wagbb = itab1-wagbb.
        itab_final-azubb = itab1-azubb.
        itab_final-aagbb = itab1-aagbb.
      endif.
       endif.
       itab_final-ekgrp = itab3-ekgrp.
      read table itab4 with key matnr  = itab3-matnr.
      if sy-subrc = 0.
      itab_final-mbwbest = itab4-mbwbest.
      endif.
    itab_final-wbwbest = itab4-wbwbest.
      append itab_final.
      clear itab_final.
      endloop.
    WRITE: /2 'material', 23 'storagelocation',29  'plant',35 'date',44 'val.stock.issue',66 'val.stock.issue.value',86 'no.of.stock.receipts',97 'no.of.stock.issues',150 'material.des', 160 'pur.group',190 'stock.val',210 'stock.quan'.
      ULINE.
      loop at itab_final.
      WRITE: /2 itab_final-matnr, 23 itab_final-lgort,29  itab_final-werks,35 itab_final-spmon,44 itab_final-magbb,66 itab_final-wagbb,86 itab_final-azubb,97 itab_final-aagbb,
               150 itab_final-maktx, 160 itab_final-ekgrp,190 itab_final-wbwbest,210 itab_final-mbwbest,itab_final-atwrt.
    ENDLOOP.
    Thanks&regds,
    Sree.

    Hi sree,
    take join between s031-sptag ,ausp-datuvthen fetch records based on this condition.(itab1)
    After retrieve records based on join condition between
    ausp-atinn,ausp-adzhl and cawn-atinn,cawn-adzhl.(itab2)
    Retrieve records using for all entries bet first join condition and second join condition.
    use for all entries between itab1 and itab2.
    it will work surely.
    reaward points

  • Join 3 tables using FOR ALL ENTRIES

    Hi,
    I want to join 3 tables and show their result in a text file delimited by comma.
    ITs a download program.Can someone tell me how to how to join the three table using for all entires instead of inner join.please give step  by step illustration

    Hi,
    Please check below code which downloads records from 3 tables into excel file.
    if you want other file means you can specify other file type in the fm parameter
    REPORT zstemp_qty2_  LINE-SIZE 255 .
    DATA:it_vbak LIKE vbak OCCURS 0 WITH HEADER LINE.
    DATA:v_file1 LIKE rlgrap-filename.
    DATA:v_file2(80) TYPE c.
    DATA:it_vbap LIKE vbap OCCURS 0 WITH HEADER LINE.
    DATA:it_mara LIKE mara OCCURS 0 WITH HEADER LINE.
    START-OF-SELECTION.
      SELECT * FROM vbak INTO TABLE it_vbak UP TO 100 ROWS.
      IF NOT it_vbak[] IS INITIAL.
        SELECT * FROM vbap INTO TABLE it_vbap
        FOR ALL ENTRIES IN it_vbak
        WHERE vbeln = it_vbak-vbeln.
      ENDIF.
      LOOP AT it_vbap.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
             EXPORTING
                  input  = it_vbap-matnr
             IMPORTING
                  output = it_vbap-matnr.
        MODIFY it_vbap TRANSPORTING matnr.CLEAR it_vbap.
      ENDLOOP.
      IF NOT it_vbap[] IS INITIAL.
        SELECT * FROM mara INTO TABLE it_mara
        FOR ALL ENTRIES IN it_vbap
        WHERE matnr = it_vbap-matnr.
      ENDIF.
      CALL FUNCTION 'F4_FILENAME'
       EXPORTING
         program_name        = sy-cprog
         dynpro_number       = sy-dynnr
      FIELD_NAME          = ' '
       IMPORTING
         file_name           = v_file1          .
      v_file2 = v_file1.
      CALL FUNCTION 'WS_DOWNLOAD'
       EXPORTING
      BIN_FILESIZE                  = ' '
      CODEPAGE                      = ' '
         filename                      = v_file2
         filetype                      = 'WK1'
      MODE                          = ' '
      WK1_N_FORMAT                  = ' '
      WK1_N_SIZE                    = ' '
      WK1_T_FORMAT                  = ' '
      WK1_T_SIZE                    = ' '
         col_select                    = '1'
      COL_SELECTMASK                = ' '
      NO_AUTH_CHECK                 = ' '
    IMPORTING
      FILELENGTH                    =
        TABLES
          data_tab                      = it_mara
      FIELDNAMES                    =
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_WRITE_ERROR              = 2
      INVALID_FILESIZE              = 3
      INVALID_TYPE                  = 4
      NO_BATCH                      = 5
      UNKNOWN_ERROR                 = 6
      INVALID_TABLE_WIDTH           = 7
      GUI_REFUSE_FILETRANSFER       = 8
      CUSTOMER_ERROR                = 9
      OTHERS                        = 10
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT it_mara.
        WRITE:/ it_mara-matnr.
      ENDLOOP.
    Regds
    Sivaparvathi
    Please reward points if helpful.....

  • Xml issues - cartesian join

    HI, I have an XMLType column that has the following XML structure:
    <Client>
    <Report id = "01">
    <Item id = "01" Description = ",a.mdfbnelt;yuk" </Item>
    <Item id = "02" Description = "AAAAA;yuk" </Item>
    <Item id = "03" Description = "XXXXX" </Item>
    </Report>
    <Report id = "02">
    <Item id = "01" Description = ",ABCDEF" </Item>
    <Item id = "02" Description = "JHIKLM" </Item>
    <Item id = "03" Description = "OPQRST" </Item>
    </Report>
    </Client>
    I would like to extract and insert data into the following file
    Table MyTable(Client, Report_id, Item_id, Description)
    So I created the following query
    SELECT
    extractValue(VALUE(x), '/Client/@id')) Client,
    extractValue(VALUE(d), '/Report/@id') Report,
    extractValue(VALUE(e), '/Item/@id') Description,
    extractValue(VALUE(e), '/Item/@Description) Description
    FROM XMLDOC2 x,
    TABLE(xmlsequence(extract(VALU*E(x), '/Client/Report'))) d,
    TABLE(xmlsequence(extract(VALU*E(x), '/Client/Report/Item'))) e
    But I get the cartesian product of the reports and the items. I would
    like to get the items related to a reports AND the report id on the
    same line. If it is not possible, I would like to filter out the items
    belonging to report; some kind of where clause.
    Anybody has an idea?
    regds,
    Santhoshkumar.G.

    -- Xml format
    <ITEMLIST>
    <ITEM>
    <EXTERNALID>ARSH0001</EXTERNALID>
    <DESCRIPTION>WHITE DIAGEO SHIRT</DESCRIPTION>
    <MATYPE>ZFGM</MATYPE>
    <TAXCD>1</TAXCD>
    <BRANDID>AR</BRANDID>
    <UOMID>PC</UOMID>
    <PRODUCTHIERARCHY>METOPSSHFASHN00895</PRODUCTHIERARCHY>
    <MANUFACTURER1>FASHION</MANUFACTURER1>
    <COLOR>WHITE</COLOR>
    <THEME></THEME>
    <COLLECTION>empty</COLLECTION>
    <FIT></FIT>
    <SEASON>S06</SEASON>
    <PRDGRP>SH</PRDGRP>
    <PRDCOLL>TOPS</PRDCOLL>
    <TARGET>ME</TARGET>
    <GRID>GRID01</GRID>
    <SUBITEM size="38FS" quality="Q2" barcode="100051050" price=" 895.00"></SUBITEM>
    <SUBITEM size="38FS" quality="Q3" barcode="100051051" price=" 895.00"></SUBITEM>
    <SUBITEM size="39FS" quality="Q2" barcode="100051052" price=" 895.00"></SUBITEM>
    <SUBITEM size="39FS" quality="Q3" barcode="100051053" price=" 895.00"></SUBITEM>
    <SUBITEM size="40FS" quality="Q2" barcode="100051054" price=" 895.00"></SUBITEM>
    <SUBITEM size="40FS" quality="Q3" barcode="100051055" price=" 895.00"></SUBITEM>
    <SUBITEM size="42FS" quality="Q2" barcode="100051056" price=" 895.00"></SUBITEM>
    <SUBITEM size="42FS" quality="Q3" barcode="100051057" price=" 895.00"></SUBITEM>
    <SUBITEM size="44FS" quality="Q2" barcode="100051058" price=" 895.00"></SUBITEM>
    <SUBITEM size="44FS" quality="Q3" barcode="100051059" price=" 895.00"></SUBITEM>
    <SUBITEM size="46FS" quality="Q2" barcode="100051060" price=" 895.00"></SUBITEM>
    <SUBITEM size="46FS" quality="Q3" barcode="100051061" price=" 895.00"></SUBITEM>
    <SUBITEM size="48FS" quality="Q2" barcode="100051062" price=" 895.00"></SUBITEM>
    <SUBITEM size="48FS" quality="Q3" barcode="100051063" price=" 895.00"></SUBITEM>
    <SUBITEM size="39FS" quality="Q1" barcode="8901208428516" price=" 895.00"></SUBITEM><SUBITEM size="40FS" quality="Q1" barcode="8901208428523" price=" 895.00"></SUBITEM><SUBITEM size="42FS" quality="Q1" barcode="8901208428530" price=" 895.00"></SUBITEM><SUBITEM size="44FS" quality="Q1" barcode="8901208428547" price=" 895.00"></SUBITEM><SUBITEM size="46FS" quality="Q1" barcode="8901208428554" price=" 895.00"></SUBITEM><SUBITEM size="48FS" quality="Q1" barcode="8901208428561" price=" 895.00"></SUBITEM><SUBITEM size="38FS" quality="Q1" barcode="8901208428578" price=" 895.00"></SUBITEM></ITEM>
    <ITEM>
    <EXTERNALID>ARSH0002</EXTERNALID>
    <DESCRIPTION>BLACK DIAGEO SHIRT</DESCRIPTION>
    <MATYPE>ZFGM</MATYPE>
    <TAXCD>1</TAXCD>
    <BRANDID>AR</BRANDID>
    <UOMID>PC</UOMID>
    <PRODUCTHIERARCHY>METOPSSHFASHN00895</PRODUCTHIERARCHY>
    <MANUFACTURER1>FASHION</MANUFACTURER1>
    <COLOR>BLACK</COLOR>
    <THEME></THEME>
    <COLLECTION>empty</COLLECTION>
    <FIT></FIT>
    <SEASON>S06</SEASON>
    <PRDGRP>SH</PRDGRP>
    <PRDCOLL>TOPS</PRDCOLL>
    <TARGET>ME</TARGET>
    <GRID>GRID01</GRID>
    <SUBITEM size="38FS" quality="Q2" barcode="100051078" price=" 895.00"></SUBITEM>
    <SUBITEM size="38FS" quality="Q3" barcode="100051079" price=" 895.00"></SUBITEM>
    <SUBITEM size="39FS" quality="Q2" barcode="100051080" price=" 895.00"></SUBITEM>
    <SUBITEM size="39FS" quality="Q3" barcode="100051081" price=" 895.00"></SUBITEM>
    <SUBITEM size="40FS" quality="Q2" barcode="100051082" price=" 895.00"></SUBITEM>
    <SUBITEM size="40FS" quality="Q3" barcode="100051083" price=" 895.00"></SUBITEM>
    <SUBITEM size="42FS" quality="Q2" barcode="100051084" price=" 895.00"></SUBITEM>
    <SUBITEM size="42FS" quality="Q3" barcode="100051085" price=" 895.00"></SUBITEM>
    <SUBITEM size="44FS" quality="Q2" barcode="100051086" price=" 895.00"></SUBITEM>
    <SUBITEM size="44FS" quality="Q3" barcode="100051087" price=" 895.00"></SUBITEM>
    <SUBITEM size="46FS" quality="Q2" barcode="100051088" price=" 895.00"></SUBITEM>
    <SUBITEM size="46FS" quality="Q3" barcode="100051089" price=" 895.00"></SUBITEM>
    <SUBITEM size="48FS" quality="Q2" barcode="100051090" price=" 895.00"></SUBITEM>
    <SUBITEM size="48FS" quality="Q3" barcode="100051091" price=" 895.00"></SUBITEM>
    <SUBITEM size="39FS" quality="Q1" barcode="8901208428653" price=" 895.00"></SUBITEM><SUBITEM size="40FS" quality="Q1" barcode="8901208428660" price=" 895.00"></SUBITEM><SUBITEM size="42FS" quality="Q1" barcode="8901208428677" price=" 895.00"></SUBITEM><SUBITEM size="44FS" quality="Q1" barcode="8901208428684" price=" 895.00"></SUBITEM><SUBITEM size="46FS" quality="Q1" barcode="8901208428691" price=" 895.00"></SUBITEM><SUBITEM size="48FS" quality="Q1" barcode="8901208428707" price=" 895.00"></SUBITEM><SUBITEM size="38FS" quality="Q1" barcode="8901208428714" price=" 895.00"></SUBITEM></ITEM>
    </ITEMLIST>
    -- Sql
    SELECT extract(value(d), '//EXTERNALID/text()').getStringVal() AS EXTERNALID,
         extract(value(d), '//DESCRIPTION/text()').getStringVal() AS DESCRIPTION,
              extract(value(d), '//MATYPE/text()').getStringVal() AS MATYPE,
              extract(value(d), '//TAXCD/text()').getStringVal() AS TAXCD,
              extract(value(d), '//BRANDID/text()').getStringVal() AS BRANDID,
              extract(value(d), '//UOMID/text()').getStringVal() AS UOMID,
              extract(value(d), '//PRODUCTHIERARCHY/text()').getStringVal() AS PRODUCTHIERARCHY,
              extract(value(d), '//MANUFACTURER1/text()').getStringVal() AS MANUFACTURER1,
              extract(value(d), '//COLOR/text()').getStringVal() AS COLOR,
              extract(value(d), '//THEME /text()').getStringVal() AS THEME ,
              extract(value(d), '//COLLECTION/text()').getStringVal() AS COLLECTION,
              extract(value(d), '//FIT/text()').getStringVal() AS FIT,
              extract(value(d), '//SEASON/text()').getStringVal() AS SEASON,
              extract(value(d), '//PRDGRP/text()').getStringVal() AS PRDGRP,
              extract(value(d), '//PRDCOLL/text()').getStringVal() AS PRDCOLL,
              extract(value(d), '//TARGET/text()').getStringVal() AS TARGET,
              extract(value(d), '//GRID/text()').getStringVal() AS GRID,
              extract(value(z), '//@size').getStringVal() AS size_cd,
              extract(value(z), '//@quality').getStringVal() AS quality,
              extract(value(z), '//@barcode').getStringVal() AS barcode,
              extract(value(z), '//@price').getStringVal() AS price                         
         FROM xml_tab x,
    table(xmlsequence(extract(value(x), '//ITEMLIST/ITEM'))) d,
              table(xmlsequence(extract(value(x), '//ITEM/SUBITEM')))z
    The above sql gives me a cartesian join for all the subitems to the items tag.
    i.e.,
    externalid
    ARSH0001 -- 2 * 12 times for one record.
    Pls give me a solution. I am struggling on this.
    Please.
    Regds,
    Santhoshkumar.G.

  • Join Internal Table for all entries

    Hi,
       I have put the LIKP data in the internal table and then use the for all entries statement to join the table with LIPS.  Besides, i specifiy an additional condition to filter empty batch.
    But, i found that the empty batch record still exist in the result.  Any idea??
        SELECT *
        FROM LIPS INTO  TABLE I_DELIVERY_INFO
        FOR ALL ENTRIES IN I_DELIVERY
        WHERE
        VBELN = I_DELIVERY-VBELN.
        AND
        CHARG IS NOT NULL.
    Regards,
    Kit

    Hi Kit,
    If you are using LIKP and LIPS then you can directly join them since these tables are HEADER & ITEM table.
    regd ur query you can use CHARG NE ' '.
    Regards
    Gopi

  • Wrap a store procedure which include "Left Join"

    In 9i, i write a store procedure :
    CREATE OR REPLACE PROCEDURE
    get_code(STATION_NUM IN VARCHAR2,COMMAND1 OUT VARCHAR2) AS
    BEGIN
    SELECT A.*, B.XX
    FROM A LEFT JOIN B ON A.ID = B.ID
    WHERE A.STATION_NUM = STATION_NUM
    END;
    AND, I wrap this store procedure, it show error message:
    PSU(103,1,50,41):Encountered the symbol "LEFT" when expecting one of the following:
    , ; for group having intersect minus order start union where
    connect
    Why i can run this store procedure, but can't wrap it?
    my oracle is 9.2.0.1.0

    Replace Left Join with "," and put "(+)" symbol after A.ID
    Regds,
    Balaji

  • Join of 2 tables.

    Hello Friends,
                        I'm unable to do a simple join thing .. I'm joining AUSP ,KLAH tables . i'm taking OBJEK,ATINN,KLART,ATWRT from AUSP table and KLART ,CLASS from KLAH ..
                                finally i need OBJEK ,ATINN,KLART,CLASS, ATWRT. ok .
    the thing is while i'm joining the two tables ..suppose i have 5 classes for a single class type .and one material will contain only one class.
    in result its giving for one material one class type , 5 classes , and one characteristic five times.
    how can i find that for that particular material ,that which class we used .. .. so please friends anyone one knows solutions... please let me know..
    i don't want to hot code it anywhere.....so ... please give me a solution .
    thanks& regards
    lavanya.a

    Hi,
    Try the below code.
    data: begin of it_ausp occurs 0 ,
                OBJEK  like ausp-OBJEK
                ATINN like ausp-ATINN,
               klart like ausp-klart,
              atwrt like ausp-atwrt,
    end of it_ausp.
    data: begin of it_klah occurs 0 ,
               klart like ausp-klart,
              class like ausp-class,
    end of it_klah.
    start-of-selection.
    select * from klah into corresponing fields of table it_klah.
    if not it_klah[] is initial.
    select * from ausp into corresponing fields of  table it_ausp
    for all entries in it_klah
    where klart = it_klah-klart.
    endif.
    loop at it_ausp.
    read table it_klah with key klart = it_ausp-klart.
    if sy-subrc = 0.
    write: / it_klah-klart,it_klah-OBJEK,
               it_klah-atinn,it_ausp-class.
    endif.
    endloop.
    Regds
    Sivaparvathi
    Please reward points if helpful..

  • SAP Query - Need to join 3 Tables via outer join

    Hi,
    I need to join 3 Tables using SAP Query. I wish an OUTER JOIN to be performed for the table join.
    For Example:
    Table 1 has 1000 Entries           Field A             Field B          
    Table 2 has 300 Entries             Field A            Field C
    Table 3 has 100 Entries             Field A           Field D
    The normal Join (INNER JOIN) gives me only the records that exists in all the 3 Tables.
    But what i need is:
    In the above example, If one entry in Table 1 has no matching records in Table 2 / Table 3, there should be an output entry in the SAP Query like
    Field A            Field B              Field C            Field  D
    xxxx              yyyy                  Blank             Blank
    If there is a common record that exists in the tables, that record should appear in the same entry in the Query output.
    Field A            Field B              Field C            Field  D
    xxxx              yyyy                  zzzz              aaaa
    In this way, there should be a minimum of 1000 entries (Largest no of records in the Tables joined). More than 1000 records in the Query output depends on the number of common records.
    Kindly help if you have come across such a scenario.
    thanks & regds
    sriram

    Hi
    Please join the outer join as below
    Table1 with Field A  to Table 2 Field A-----outer join
    Table1 with Field A  to Table 3 Field A------outer join
    then you get the out put as per your requirement
    Regards
    Damu

  • Re:JOINS

    Hi
    What is meant by inner join and outer join ?
    I want complete description of JOINS
    Regards,
    SRIKANTH

    Hi
    Syntax
    ... [(] {dbtab_left [AS tabalias_left]} | join
              {[INNER] JOIN}|{LEFT [OUTER] JOIN}
                {dbtab_right [AS tabalias_right] ON join_cond} [)] ...  .
    Effect
    The join syntax represents a recursively nestable join expression. A join expression consists of a left-hand and a right- hand side, which are joined either by means of [INNER] JOIN or LEFT [OUTER] JOIN . Depending on the type of join, a join expression can be either an inner ( INNER) or an outer (LEFT OUTER) join. Every join expression can be enclosed in round brackets. If a join expression is used, the SELECT command circumvents SAP buffering.
    On the left-hand side, either a single database table, a view dbtab_left, or a join expression join can be specified. On the right-hand side, a single database table or a view dbtab_right as well as join conditions join_cond can be specified after ON. In this way, a maximum of 24 join expressions that join 25 database tables or views with each other can be specified after FROM.
    AS can be used to specify an alternative table name tabalias for each of the specified database table names or for every view. A database table or a view can occur multiple times within a join expression and, in this case, have various alternative names.
    The syntax of the join conditions join_cond is the same as that of the sql_cond conditions after the addition WHERE, with the following differences:
    At least one comparison must be specified after ON.
    Individual comparisons may be joined using AND only.
    All comparisons must contain a column in the database table or the view dbtab_right on the right-hand side as an operand.
    The following language elements may not be used: BETWEEN, LIKE, IN.
    No sub-queries may be used.
    For outer joins, only equality comparisons (=, EQ) are possible.
    If an outer join occurs after FROM, the join condition of every join expression must contain at least one comparison between columns on the left-hand and the right-hand side.
    In outer joins, all comparisons that contain columns as operands in the database table or the view dbtab_right on the right-hand side must be specified in the corresponding join condition. In the WHERE condition of the same SELECT command, these columns are not allowed as operands.
    Resulting set for inner join
    The inner join joins the columns of every selected line on the left- hand side with the columns of all lines on the right-hand side that jointly fulfil the join_cond condition. A line in the resulting set is created for every such line on the right-hand side. The content of the column on the left-hand side may be duplicated in this case. If none of the lines on the right-hand side fulfils the join_cond condition, no line is created in the resulting set.
    Resulting set for outer join
    The outer join basically creates the same resulting set as the inner join, with the difference that at least one line is created in the resulting set for every selected line on the left-hand side, even if no line on the right-hand side fulfils the join_cond condition. The columns on the right-hand side that do not fulfil the join_cond condition are filled with null values.
    Example
    Join the columns carrname, connid, fldate of the database tables scarr, spfli and sflight by means of two inner joins. A list is created of the flights from p_cityfr to p_cityto. Alternative names are used for every table.
    PARAMETERS: p_cityfr TYPE spfli-cityfrom,
                p_cityto TYPE spfli-cityto.
    DATA: BEGIN OF wa,
             fldate TYPE sflight-fldate,
             carrname TYPE scarr-carrname,
             connid   TYPE spfli-connid,
           END OF wa.
    DATA itab LIKE SORTED TABLE OF wa
                   WITH UNIQUE KEY fldate carrname connid.
    SELECT ccarrname pconnid f~fldate
           INTO CORRESPONDING FIELDS OF TABLE itab
           FROM ( ( scarr AS c
             INNER JOIN spfli AS p ON pcarrid   = ccarrid
                                  AND p~cityfrom = p_cityfr
                                  AND p~cityto   = p_cityto )
             INNER JOIN sflight AS f ON fcarrid = pcarrid
                                    AND fconnid = pconnid ).
    LOOP AT itab INTO wa.
      WRITE: / wa-fldate, wa-carrname, wa-connid.
    ENDLOOP.
    Example
    Join the columns carrid, carrname and connid of the database tables scarr and spfli using an outer join. The column connid is set to the null value for all flights that do not fly from p_cityfr. This null value is then converted to the appropriate initial value when it is transferred to the assigned data object. The LOOP returns all airlines that do not fly from p_cityfr.
    PARAMETERS p_cityfr TYPE spfli-cityfrom.
    DATA: BEGIN OF wa,
            carrid   TYPE scarr-carrid,
            carrname TYPE scarr-carrname,
            connid   TYPE spfli-connid,
          END OF wa,
          itab LIKE SORTED TABLE OF wa
                    WITH NON-UNIQUE KEY carrid.
    SELECT scarrid scarrname p~connid
           INTO CORRESPONDING FIELDS OF TABLE itab
           FROM scarr AS s
           LEFT OUTER JOIN spfli AS p ON scarrid   =  pcarrid
                                      AND p~cityfrom = p_cityfr.
    LOOP AT itab INTO wa.
      IF wa-connid = '0000'.
        WRITE: / wa-carrid, wa-carrname.
      ENDIF.
    ENDLOOP.
    Hope this helps.
    Regds,
    Seema.

  • IF Statement in Join Line

    Is it possible to use a IF statement (i.e. CASE, DECODE) in the Join Line?
    I need create a query that depending on the value of a column it will determine if I use a column A or column B in my join statement. I was thinking something like the following:
    Select a.Value1, a.Value2, b.ColumnA, b.ColumnB
    FROM Table1 a
    INNER JOIN Table2 b ON a.Value2 = (if b.ColumnZ='Dept' then b.ColumnA else b.ColumnB END)
    Oracle Version 10g
    OS Windows XP
    Thanks in advance!

    Hi,
    Remember what a CASE expression does: it returns a single value in one of the SQL data types (such as VARCHAR2, NUMBER or DATE).
    Each THEN (or ELSE) clause of a CASE expression references something that the CASE expression might return, so after each THEN (or ELSE) keyword there must be a single value in one of the SQL data types.
    So you can't say:
    case tdsi.level_code
         when  'L'  then  tdsid.privilege_code = tdlm.location_code
         when  'R'  then  tdsid.privilege_code = tdlm.region_code
         when  'C'  then  tdsid.privilege_code = tdlm.country_code
    endWhat is the data type being returned? "tdsid.privilege_code = tdlm.location_code" is not a single value in any of the SQL data types.
    If location_code, region_code, country_code and privilege_code all have the same data type, then you can do something like this:
    join      dirpipe.dirpipe_location_map      tdlm      on      case tdsi.level_code
                                            when 'L' then tdlm.location_code
                                            when 'R' then tdlm.region_code
                                            when 'C' then tdlm.country_code
                                       end     = tdsid.privilege_code

  • Is not null and null join

    Hi, I am trying to properly display a list of tasks for a project however without a join to the project number (which I was aware of) and the employee table, I get over 500 results.
    The task can be created without a employee assigned to it so therefore the page does not require the field to be filled in.
    Here is the SQL code, any does anyone have any ideas?
    select
        pd.pk_proj_detail_id    "Task Number",
        pd.task_title           "Task Title",
        pd.DETAIL_STATUS        "Task Status",
        pm.name                 "Associated Project",
        pps.last_name||', '||pps.first_name||', '||pps.middle_initial||'.' "Assigned Employee",
        pd.TRACKIT_NUMBER       "TrackIt! Number",
        pd.CREATEBY_DATE        "Date Entered",
        pd.DATE_BEGIN           "Date Began",
        pd.ESTIMATED_DATE       "Estimated Completion Date",
        pd.DATE_END             "Date Completed"
    from
        PROTRAC_DETAIL pd,
        protrac_master pm,
        cobr.vw_pps_payroll pps,
        resources r
    where
        pd.fk_proj_master_id = pm.PK_PROJ_MASTER_ID
        and r.fk_master_id = pm.PK_PROJ_MASTER_ID
        and (r.emp_id = pps.emple_no
            or r.emp_id is null)

    It's 10g r2 with Application Express 3.1.0.00.32
    This is the tasks (detail) table
    ALTER TABLE PROTRAC_DETAIL
    DROP PRIMARY KEY CASCADE;
    DROP TABLE PROTRAC_DETAIL CASCADE CONSTRAINTS;
    CREATE TABLE PROTRAC_DETAIL
      PK_PROJ_DETAIL_ID      NUMBER                 NOT NULL,
      FK_PROJ_MASTER_ID      NUMBER,
      TRACKIT_NUMBER         NUMBER,
      DETAIL_DESCRIPTION     VARCHAR2(4000 CHAR),
      DETAIL_STATUS          VARCHAR2(19 CHAR),
      DETAIL_STATUS_COMMENT  VARCHAR2(4000 CHAR),
      DATE_BEGIN             DATE,
      DATE_END               DATE,
      ESTIMATED_DATE         DATE,
      CREATEBY_DATE          DATE,
      CREATEBY_USER          VARCHAR2(50 CHAR),
      LASTMOD_DATE           DATE,
      LASTMOD_USER           VARCHAR2(50 CHAR),
      TASK_TITLE             VARCHAR2(100 CHAR)
    TABLESPACE DEVPROTRAC_DATA
    PCTUSED    0
    PCTFREE    10
    INITRANS   1
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       2147483645
                PCTINCREASE      0
                BUFFER_POOL      DEFAULT
    CREATE UNIQUE INDEX PROTRAC_DETAIL_PK ON PROTRAC_DETAIL
    (PK_PROJ_DETAIL_ID)
    TABLESPACE DEVPROTRAC_DATA
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       2147483645
                PCTINCREASE      0
                BUFFER_POOL      DEFAULT
    CREATE OR REPLACE TRIGGER BUI_PROTRAC_DETAIL
    before insert or update
    on PROTRAC_DETAIL
    referencing new as New old as Old
    for each row
    begin
        if inserting then
            select users_seq.nextval, sysdate, apex_application.g_user
                into :new.pk_proj_detail_id, :new.createby_date, :new.createby_user
                from dual;
        elsif updating then
            select sysdate, apex_application.g_user
                into :new.lastmod_date, :new.lastmod_user
                from dual;
        end if;
    end;
    SHOW ERRORS;
    ALTER TABLE PROTRAC_DETAIL ADD (
      CONSTRAINT PROTRAC_DETAIL_PK
    PRIMARY KEY
    (PK_PROJ_DETAIL_ID)
        USING INDEX
        TABLESPACE DEVPROTRAC_DATA
        PCTFREE    10
        INITRANS   2
        MAXTRANS   255
        STORAGE    (
                    INITIAL          64K
                    MINEXTENTS       1
                    MAXEXTENTS       2147483645
                    PCTINCREASE      0
    ALTER TABLE PROTRAC_DETAIL ADD (
      CONSTRAINT PROTRAC_DETAIL_NUM
    FOREIGN KEY (FK_PROJ_MASTER_ID)
    REFERENCES PROTRAC_MASTER (PK_PROJ_MASTER_ID));
    ALTER TABLE DEVPROTRAC.RESOURCES ADD (
      FOREIGN KEY (FK_DETAIL_ID)
    REFERENCES DEVPROTRAC.PROTRAC_DETAIL (PK_PROJ_DETAIL_ID));
    SET DEFINE OFF;
    Insert into PROTRAC_DETAIL
       (PK_PROJ_DETAIL_ID, FK_PROJ_MASTER_ID, TRACKIT_NUMBER, DETAIL_DESCRIPTION, DETAIL_STATUS,
        DETAIL_STATUS_COMMENT, DATE_BEGIN, DATE_END, ESTIMATED_DATE, CREATEBY_DATE,
        CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, TASK_TITLE)
    Values
       (34, 24, NULL, 'test', 'Queued',
        NULL, NULL, NULL, NULL, TO_DATE('10/30/2008 13:37:01', 'MM/DD/YYYY HH24:MI:SS'),
        'LREDMOND', TO_DATE('11/03/2008 15:19:35', 'MM/DD/YYYY HH24:MI:SS'), NULL, 'bananana');
    Insert into PROTRAC_DETAIL
       (PK_PROJ_DETAIL_ID, FK_PROJ_MASTER_ID, TRACKIT_NUMBER, DETAIL_DESCRIPTION, DETAIL_STATUS,
        DETAIL_STATUS_COMMENT, DATE_BEGIN, DATE_END, ESTIMATED_DATE, CREATEBY_DATE,
        CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, TASK_TITLE)
    Values
       (41, 40, NULL, '2354234', 'Queued',
        NULL, NULL, NULL, NULL, TO_DATE('10/31/2008 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        'LREDMOND', TO_DATE('11/03/2008 13:52:02', 'MM/DD/YYYY HH24:MI:SS'), 'LREDMOND', 'I can type on the keyboarddf');
    Insert into PROTRAC_DETAIL
       (PK_PROJ_DETAIL_ID, FK_PROJ_MASTER_ID, TRACKIT_NUMBER, DETAIL_DESCRIPTION, DETAIL_STATUS,
        DETAIL_STATUS_COMMENT, DATE_BEGIN, DATE_END, ESTIMATED_DATE, CREATEBY_DATE,
        CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, TASK_TITLE)
    Values
       (49, 32, 78888, 'one day fishsticks will walk on the moon.', 'Queued',
        'waiting for fishsticks.', NULL, NULL, NULL, TO_DATE('11/03/2008 11:28:11', 'MM/DD/YYYY HH24:MI:SS'),
        'LREDMOND', NULL, NULL, 'Fix the keyboard');
    Insert into PROTRAC_DETAIL
       (PK_PROJ_DETAIL_ID, FK_PROJ_MASTER_ID, TRACKIT_NUMBER, DETAIL_DESCRIPTION, DETAIL_STATUS,
        DETAIL_STATUS_COMMENT, DATE_BEGIN, DATE_END, ESTIMATED_DATE, CREATEBY_DATE,
        CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, TASK_TITLE)
    Values
       (50, 38, NULL, 'dfdfdfdfdfdfdfdfdf', 'Queued',
        NULL, NULL, NULL, NULL, TO_DATE('11/03/2008 12:03:06', 'MM/DD/YYYY HH24:MI:SS'),
        'LREDMOND', TO_DATE('11/03/2008 15:19:44', 'MM/DD/YYYY HH24:MI:SS'), NULL, 'resreeeeeeeeee');
    Insert into PROTRAC_DETAIL
       (PK_PROJ_DETAIL_ID, FK_PROJ_MASTER_ID, TRACKIT_NUMBER, DETAIL_DESCRIPTION, DETAIL_STATUS,
        DETAIL_STATUS_COMMENT, DATE_BEGIN, DATE_END, ESTIMATED_DATE, CREATEBY_DATE,
        CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, TASK_TITLE)
    Values
       (33, 31, NULL, 'Make sure the bananas are fresh', 'Queued',
        NULL, NULL, NULL, NULL, TO_DATE('10/29/2008 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        'LREDMOND', TO_DATE('11/03/2008 15:19:52', 'MM/DD/YYYY HH24:MI:SS'), NULL, 'e543563465');
    Insert into PROTRAC_DETAIL
       (PK_PROJ_DETAIL_ID, FK_PROJ_MASTER_ID, TRACKIT_NUMBER, DETAIL_DESCRIPTION, DETAIL_STATUS,
        DETAIL_STATUS_COMMENT, DATE_BEGIN, DATE_END, ESTIMATED_DATE, CREATEBY_DATE,
        CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, TASK_TITLE)
    Values
       (48, 37, NULL, 'guitar heros! yay', 'Queued',
        NULL, NULL, NULL, NULL, TO_DATE('11/03/2008 11:26:06', 'MM/DD/YYYY HH24:MI:SS'),
        'LREDMOND', TO_DATE('11/03/2008 15:19:57', 'MM/DD/YYYY HH24:MI:SS'), NULL, '34444444444444543etfg');
    COMMIT;This is for the resources table:
    ALTER TABLE RESOURCES
    DROP PRIMARY KEY CASCADE;
    DROP TABLE RESOURCES CASCADE CONSTRAINTS;
    CREATE TABLE RESOURCES
      PK_RESOURCES_ID   NUMBER,
      FK_DETAIL_ID      NUMBER,
      EMP_ID            NUMBER,
      RESOURCE_STATUS   VARCHAR2(8 CHAR),
      RESOURCE_COMMENT  VARCHAR2(4000 CHAR),
      CREATEBY_DATE     DATE,
      CREATEBY_USER     VARCHAR2(50 CHAR),
      LASTMOD_DATE      DATE,
      LASTMOD_USER      VARCHAR2(50 CHAR),
      FK_MASTER_ID      NUMBER
    TABLESPACE DEVPROTRAC_DATA
    PCTUSED    0
    PCTFREE    10
    INITRANS   1
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       2147483645
                PCTINCREASE      0
                BUFFER_POOL      DEFAULT
    CREATE UNIQUE INDEX RESOURCES_PK ON RESOURCES
    (PK_RESOURCES_ID)
    TABLESPACE DEVPROTRAC_DATA
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       2147483645
                PCTINCREASE      0
                BUFFER_POOL      DEFAULT
    CREATE OR REPLACE TRIGGER BUI_RESOURCES
    before insert or update
    on RESOURCES
    referencing new as New old as Old
    for each row
    begin
        if inserting then
            select users_seq.nextval, sysdate, apex_application.g_user
                into :new.pk_resources_id, :new.createby_date, :new.createby_user
                from dual;
        elsif updating then
            select sysdate, apex_application.g_user
                into :new.lastmod_date, :new.lastmod_user
                from dual;
        end if;
    end;
    SHOW ERRORS;
    ALTER TABLE RESOURCES ADD (
      CONSTRAINT RESOURCES_PK
    PRIMARY KEY
    (PK_RESOURCES_ID)
        USING INDEX
        TABLESPACE DEVPROTRAC_DATA
        PCTFREE    10
        INITRANS   2
        MAXTRANS   255
        STORAGE    (
                    INITIAL          64K
                    MINEXTENTS       1
                    MAXEXTENTS       2147483645
                    PCTINCREASE      0
    ALTER TABLE RESOURCES ADD (
      FOREIGN KEY (FK_DETAIL_ID)
    REFERENCES PROTRAC_DETAIL (PK_PROJ_DETAIL_ID),
      FOREIGN KEY (FK_MASTER_ID)
    REFERENCES PROTRAC_MASTER (PK_PROJ_MASTER_ID));
    SET DEFINE OFF;
    Insert into RESOURCES
       (PK_RESOURCES_ID, FK_DETAIL_ID, EMP_ID, RESOURCE_STATUS, RESOURCE_COMMENT,
        CREATEBY_DATE, CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, FK_MASTER_ID)
    Values
       (53, 50, 356654, 'Active', NULL,
        TO_DATE('11/04/2008 09:32:06', 'MM/DD/YYYY HH24:MI:SS'), 'LREDMOND', NULL, NULL, NULL);
    Insert into RESOURCES
       (PK_RESOURCES_ID, FK_DETAIL_ID, EMP_ID, RESOURCE_STATUS, RESOURCE_COMMENT,
        CREATEBY_DATE, CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, FK_MASTER_ID)
    Values
       (51, 41, 447250, 'Active', 'No Sure.',
        TO_DATE('11/03/2008 14:23:11', 'MM/DD/YYYY HH24:MI:SS'), NULL, TO_DATE('11/04/2008 09:00:04', 'MM/DD/YYYY HH24:MI:SS'), NULL, 40);
    Insert into RESOURCES
       (PK_RESOURCES_ID, FK_DETAIL_ID, EMP_ID, RESOURCE_STATUS, RESOURCE_COMMENT,
        CREATEBY_DATE, CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, FK_MASTER_ID)
    Values
       (54, 50, 323829, 'Active', NULL,
        TO_DATE('11/04/2008 10:26:08', 'MM/DD/YYYY HH24:MI:SS'), 'LREDMOND', NULL, NULL, 38);
    Insert into RESOURCES
       (PK_RESOURCES_ID, FK_DETAIL_ID, EMP_ID, RESOURCE_STATUS, RESOURCE_COMMENT,
        CREATEBY_DATE, CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, FK_MASTER_ID)
    Values
       (52, 33, 8915, 'Active', 'get to work',
        TO_DATE('11/03/2008 15:20:18', 'MM/DD/YYYY HH24:MI:SS'), 'LREDMOND', TO_DATE('11/03/2008 15:35:10', 'MM/DD/YYYY HH24:MI:SS'), NULL, NULL);
    COMMIT;The results I want is everything above regardless of emp_id assigned (if any). Without the r.emp_id = pps.emple_no join, the query will generate 234234239482304234 results.
    Hope this helps.
    Edited by: leland on Nov 4, 2008 12:56 PM

  • Wrong display of No. of days worked in Payslip for mid-month joining

    Dear Experts,
    We use PE51, form editor for payslip for indian payrol. Our issue is when an employee joins mid of the month or say 4th of any month, still in payslip it shows no. of working days as 30/31 days instead of actual days worked. But pay results are correctly being calculated on factoring basis.
    Please let me know how to resolve it, we use PCR ZNP1 for factoring which is written as follows
    ZNP1 Partial factors for India - /801(CD), /802(WD), /803(WH),/804(Nom)
          /801 Partial period factor 1
            RTE=TKSOLL Set
            RTE-TKAU** Subtraction
            RTE*KGENAU Multiplication
            RTE/TKDIVI Division
            ADDWT *    OT   Output table
          /802 Partial period factor 2
            RTE=TASOLL Set
            RTE-TAAU** Subtraction
            RTE*KGENAU Multiplication
            RTE/TADIVI Division
            ADDWT *    OT   Output table
          /803 Partial period factor 3
            RTE=TSSOLL Set
            RTE-TSAU** Subtraction
            RTE*KGENAU Multiplication
            RTE/TSDIVI Division
            ADDWT *    OT   Output table
          /804 Partial period factor 4
          /805 Partial period factor 5
          /806 Partial period factor 6
          /807 Partial period factor 7
    Please guide, if i need to modify it for getting correct working days display in payslip
    Regards
    Tan

    in that case the Requirement is to display no of working days of employee in a month
    Here working days means
    Total Calendar Days - Unpaid days - Paid days =  working days ( please check the said one again since i have inculded the paid days and unpaid days if u want u can remove paid days)
    so in order to fetch this
    we need Calendar days that is TKSOLL
    Unpaid days   check the technical wage types /845  Paid days /846  ( you can have custom wage types too)
    Copy a wage type from standrad overtime wage type  that will be  1555
    The PCR is as follows
    NUM=TKSOLL  (calendar Days)
    NUM-E  /846      Paid days
    NUM-E /845
    ADDWT 15555
    Use ACTIO function and insert it any where in Sub Schema XT00

  • For the mid month new joiner the annual Conveyance exemption is coming incorrectly

    Dear All,
    For one of our client, we have have faced a uniqe issue.
    If any employee join in the mid of the month, his prorated conveyance amount ( wage type 2020) is coming correctly. Suppose an employee joined at 16th of the month, system is calculating his conveyance for that month as INR 400 and which is correct.
    However in his tax calculation for that particular month, system is taking INR 400*(rest of the month of the FY) in the wage type /4E3. which is incorrect. Suppose he joined in 16th April , system is calculating tax exemption 400*12=4800
    Now if we run next month payroll ,  system is caculating the exemption properly. i.e. INR 400 + 800* rest of the month of the FY,
    Please help
    Regards
    Tirtha

    Hi Tirtha,
    system is calculating perfectly.
    first of all system check the no. of present days and accordingly it give the amount in the wage type /3C3 conveyance amount monthly and /3C4 will give Conveyance monthly exemption and it will multiply with no. of months to the fiscal year end and store in the wage type /4E3.
    for example check for PF:
    Every month PF amount store in WT /3F1 and send to /3F5 and this WT multiplied with No. of months and store the Annual amount in wt /3F6.
    Regards,
    Praneeth kumar

Maybe you are looking for

  • How to uninstall apple mobile device support & upgrade to newer version?

    For my ipod touch, every time i plug it into my laptop itunes says "itunes requires a newer version of apple mobile device support. please uninstall both apple mobile device supprt & itunes then install itunes again" ive uninstalled itunes & all of i

  • What does {tag_image_value} from webapps return when field is empty? How to use javascript to remove div when condition is met.

    Dear all, As stated in the question, what does {tag_image_value} from webapps return when no image has been uploaded by users. I understand that there is an OnError function that can be called if there isn't any image. However it does not do so. I am

  • Bridge doesn't recognize Quad Processor

    When I bring up adobe bridge I get a warning: "This application requires a Pentium 4, Celeron, Core Duo or Core 2 compatible processor. 0/6/5898." I have a brand new Dell 32-bit Vista with Intel Core 2 Quad CPU Q9400 @ 2.66 GHz with 8 GB Memory RAM.

  • K8NGM-V, Onboard-LAN problems

    Hi, I'm having some serious problems with the onboard LAN card on my K8NGM-V board. I've been trying alot and I cant get it to work properly. I installed the latest drivers from nvidia (nForce 8.26) and the card is detected and installed as "nvidia n

  • [Keyboard Shortcuts] Editing the indk.-file

    Hi. I'm working in a newspaper and we have upgraded our advertisement software. With this software a plugin is installed to InDesign to save and export. On the last version you had the possibility to assign a keyboard shortcut in Edit > Keyboard Shor