How to write ABAP Logic in SAP Query to fetch records from many Tables

Hi Expert,
I have one requirement, want to display all BOM (Equipment BOM, Function Location BOM and Meterial BOM) from a particular plant.
List of tables as below:
EQST: Equipment to BOM Link
TPST: Link Between Functional Location and BOM
MAST: Material to BOM Link
STPO:BOM item
Requirement: When user enters Plant then SAP Query should execute and fetch all BOMs (as mentioned above) from STPO Table.
I have done so far is as follows:
I create User Group, Infoset and SAP Query.
While creating INFOSET, i used 4 tables (EQST,TPST,MAST & STPO) and link between then is as follows:
STPO-STLNR ---> EQST-STLNR : Left Outer Join
STPO-STLNR ---> TPST-STLNR : Left Outer Join
STPO-STLNR ---> MAST-STLNR : Left Outer Join
Now its showing all BOM from all plants though I enter one Plant value.
Please advise me to write SAP Query and Logic to fetch all BOM from selected Plant Value.
Thanks,
Jay.
Edited by: jaykrishna007 on Jul 29, 2011 11:41 AM

Hi FCannavo,
Thanks for your quick reply.
See, now I changed my Infoset design.
I added one Plant Table (T001W) and then
T001W-WERKS--->EQST-WERKS
T001W-WERKS--->MAST-WERKS
T001W-WERKS--->TPST-WERKS
and then
EQST-STLNR--->STPO-STLNR
MAST-STLNR--->STPO-STLNR
TPST-STLNR--->STPO-STLNR
on selection screen, user will enter Plant Value.
Now its showing some records, but i dont think so i would be correct output or not, please guide me whether it is correct or not?
Thanks,
Jay.

Similar Messages

  • How to write Additional Logic IN SAP Query

    Hi All,
    I need to Add 1 more field in Query.
    How to Write a Logic in Infoset?
    For Ex : Need to add age field in the output.
    Thanks
    Partha.

    Hi,
    Refer to this link..Additional field in SAP Query
    [Creating Additional Fields |http://help.sap.com/saphelp_nw04/helpdata/en/d9/9958e0c50a11d396f80000e82de14a/frameset.htm]
    [Code|http://help.sap.com/saphelp_nw04/helpdata/en/d9/9958e0c50a11d396f80000e82de14a/frameset.htm]

  • How can i fetch records from 3 tables in a single query  without using join

    Hi.
    Can any body please tell me <b>How can i fetch records from 3 tables with a single query  without using joins</b>
    Thanx
    prabhudutta

    Hi Prabgudutta,
    We can fetch the data by using the views concept.
    Go throuth this info we can know the how to create view and same like database table only we can fetch the data.
    Views conatin the data at runtime only.
    Four different view types are supported. These differ in the
    way in which the view is implemented and in the methods
    permitted for accessing the view data.
    Database views are implemented with an equivalent view on
    the database.
    Projection views are used to hide fields of a table (only
    projection).
    Help views can be used as selection method in search helps.
    Maintenance views permit you to maintain the data
    distributed
    on several tables for one application object at one time.
    step by step creation of Maintenance view:
    With the help of the table maintenance generator, you are able to maintain the ENTRIES of the table in SM30 transaction.
    It can be set in transaction SE11 - Tools - Table maintenance generator.
    Table maintanance Generator is used to manually input values using transaction sm30
    follow below steps
    1) go to se11 check table maintanance check box under attributes tab
    2) utilities-table maintanance Generator-> create function group and assign it under
    function group input box. Also assign authorization group default &NC& .
    3) select standard recording routine radio in table table mainitainence generator to move table
    contents to quality and production by assigning it to request.
    4) select maintaience type as single step.
    5) maintainence screen as system generated numbers this dialog box appears when you click on create button
    6) save and activate table
    One step, two step in Table Maintenance Generator
    Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.
    Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.
    SM30 is used for table maintenance(addition or deletion of records),
    For all the tables in SE11 for which Table maintenance is selected , they can be maintained in SM30
    Sm30 is used to maintain the table ,i.e to delete ,insert or modify the field values and all..
    It creates the maintenance screen for u for the aprticular table as the maintenance is not allowed for the table..
    In the SE11 delivery and maintenance tab, keep the maintenance allowed..
    Then come to the SM30 and then enter the table name and press maintain..,
    Give the authorization group if necessary and give the function group and then select maintenance type as one step and give the screen numbers as system specified..
    Then create,,,
    Then u will able to see the maintenance view for the table in which u can able to insert and delete the table values...
    We use SM30 transaction for entering values into any DB table.
    First we create a table in SE11 and create the table maintenance generator for that Table using (utilities-> table maintenance generator) and create it.
    Then it will create a View.
    After that from SM30, enter the table name and Maintain, create new entries, change the existing entries for that table.
    Hope this resolves your query.
    Reward all the helpful answers.
    Rgds,
    P.Naganjana Reddy

  • SQL query to fetch records  from  26 onwards

    Want to know SQL query to fetch records from 26 onwards.

    See the fifth entry on the FAQ page:
    Re: How to attach a java bean in forms6i

  • QUERY - No Duplicate records from 2nd table ???

    Hi Experts,
    I really need help with this. I have 2 tables A and B. See below
    <b>A -
         B</b>
    X -
         XB1
    XB2
    XB3
    Y----
    YB
    Z----
    ZB
    I select a record from A and get its record from B and give it on the output. For entry X I have 3 records in Table B. I want the output to give only 1 record from B for X. It can be any record. How can this be achieved in Query ?
    Is there a special Join ? or can this be achieved by coding in Query ? If so how ?
    I really appreciate your help.
    Thanks !!

    First get the data from table A.
    select * from table (A) into table i_a.
    loop at i_a.
    select single * from table B into table i_b.
    move b reord to final internal table
    append final internal table.
    endloop.

  • SQL Query to fetch records from tables which have 75+ million records

    Hi,
    I have the explain plan for a sql stmt.Require your suggestions to improve this.
    PLAN_TABLE_OUTPUT
    | Id  | Operation                            | Name                         | Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT                     |                              |   340 |   175K| 19075 |
    |   1 |  TEMP TABLE TRANSFORMATION           |                              |       |       |       |
    |   2 |   LOAD AS SELECT                     |                              |       |       |       |
    |   3 |    SORT GROUP BY                     |                              |    32M|  1183M|   799K|
    |   4 |     TABLE ACCESS FULL                | CLM_DETAIL_PRESTG            |   135M|  4911M|   464K|
    |   5 |   LOAD AS SELECT                     |                              |       |       |       |
    |   6 |    TABLE ACCESS FULL                 | CLM_HEADER_PRESTG            |     1 |   274 |   246K|
    PLAN_TABLE_OUTPUT
    |   7 |   LOAD AS SELECT                     |                              |       |       |       |
    |   8 |    SORT UNIQUE                       |                              |   744K|    85M|  8100 |
    |   9 |     TABLE ACCESS FULL                | DAILY_PROV_PRESTG            |   744K|    85M|  1007 |
    |  10 |   UNION-ALL                          |                              |       |       |       |
    |  11 |    SORT UNIQUE                       |                              |   177 | 97350 |  9539 |
    |  12 |     HASH JOIN                        |                              |   177 | 97350 |  9538 |
    |  13 |      HASH JOIN OUTER                 |                              |     3 |  1518 |  9533 |
    |  14 |       HASH JOIN                      |                              |     1 |   391 |  8966 |
    |  15 |        TABLE ACCESS BY INDEX ROWID   | CLM_DETAIL_PRESTG            |     1 |    27 |     3 |
    |  16 |         NESTED LOOPS                 |                              |     1 |   361 |    10 |
    |  17 |          NESTED LOOPS OUTER          |                              |     1 |   334 |     7 |
    PLAN_TABLE_OUTPUT
    |  18 |           NESTED LOOPS OUTER         |                              |     1 |   291 |     4 |
    |  19 |            VIEW                      |                              |     1 |   259 |     2 |
    |  20 |             TABLE ACCESS FULL        | SYS_TEMP_0FD9D66C9_DA2D01AD  |     1 |   269 |     2 |
    |  21 |            INDEX RANGE SCAN          | CLM_PAYMNT_CLMEXT_PRESTG_IDX |     1 |    32 |     2 |
    |  22 |           TABLE ACCESS BY INDEX ROWID| CLM_PAYMNT_CHKEXT_PRESTG     |     1 |    43 |     3 |
    |  23 |            INDEX RANGE SCAN          | CLM_PAYMNT_CHKEXT_PRESTG_IDX |     1 |       |     2 |
    |  24 |          INDEX RANGE SCAN            | CLM_DETAIL_PRESTG_IDX        |     6 |       |     2 |
    |  25 |        VIEW                          |                              |    32M|   934M|  8235 |
    |  26 |         TABLE ACCESS FULL            | SYS_TEMP_0FD9D66C8_DA2D01AD  |    32M|   934M|  8235 |
    |  27 |       VIEW                           |                              |   744K|    81M|   550 |
    |  28 |        TABLE ACCESS FULL             | SYS_TEMP_0FD9D66CA_DA2D01AD  |   744K|    81M|   550 |
    PLAN_TABLE_OUTPUT
    |  29 |      TABLE ACCESS FULL               | CCP_MBRSHP_XREF              |  5288 |   227K|     5 |
    |  30 |    SORT UNIQUE                       |                              |   163 | 82804 |  9536 |
    |  31 |     HASH JOIN                        |                              |   163 | 82804 |  9535 |
    |  32 |      HASH JOIN OUTER                 |                              |     3 |  1437 |  9530 |
    |  33 |       HASH JOIN                      |                              |     1 |   364 |  8963 |
    |  34 |        NESTED LOOPS OUTER            |                              |     1 |   334 |     7 |
    |  35 |         NESTED LOOPS OUTER           |                              |     1 |   291 |     4 |
    |  36 |          VIEW                        |                              |     1 |   259 |     2 |
    |  37 |           TABLE ACCESS FULL          | SYS_TEMP_0FD9D66C9_DA2D01AD  |     1 |   269 |     2 |
    |  38 |          INDEX RANGE SCAN            | CLM_PAYMNT_CLMEXT_PRESTG_IDX |     1 |    32 |     2 |
    |  39 |         TABLE ACCESS BY INDEX ROWID  | CLM_PAYMNT_CHKEXT_PRESTG     |     1 |    43 |     3 |
    PLAN_TABLE_OUTPUT
    |  40 |          INDEX RANGE SCAN            | CLM_PAYMNT_CHKEXT_PRESTG_IDX |     1 |       |     2 |
    |  41 |        VIEW                          |                              |    32M|   934M|  8235 |
    |  42 |         TABLE ACCESS FULL            | SYS_TEMP_0FD9D66C8_DA2D01AD  |    32M|   934M|  8235 |
    |  43 |       VIEW                           |                              |   744K|    81M|   550 |
    |  44 |        TABLE ACCESS FULL             | SYS_TEMP_0FD9D66CA_DA2D01AD  |   744K|    81M|   550 |
    |  45 |      TABLE ACCESS FULL               | CCP_MBRSHP_XREF              |  5288 |   149K|     5 |
    The CLM_DETAIL_PRESTG table has 100 million records and the CLM_HEADER_PRESTG table has 75 million records.
    Any gussestions on how to getch huge records from tables of this size will help.
    Regards,
    Narayan

    WITH CLAIM_DTL
         AS (  SELECT
                      ICN_NUM,
    MIN (FIRST_SRVC_DT) AS FIRST_SRVC_DT,
    MAX (LAST_SRVC_DT) AS LAST_SRVC_DT,
    MIN (PLC_OF_SRVC_CD) AS PLC_OF_SRVC_CD
    FROM CCP_STG.CLM_DETAIL_PRESTG  CD WHERE ACT_CD <>'D'
    GROUP BY ICN_NUM),
    CLAIM_HDR
         AS (SELECT
                    ICN_NUM,
    SBCR_ID,
    MBR_ID,
    MBR_FIRST_NAME,
    MBR_MI,
    MBR_LAST_NAME,
    MBR_BIRTH_DATE,
    GENDER_TYPE_CD,
    SBCR_RLTNSHP_TYPE_CD,
    SBCR_FIRST_NAME,
    SBCR_MI,
    SBCR_LAST_NAME,
    SBCR_ADDR_LINE_1,
    SBCR_ADDR_LINE2,
    SBCR_ADDR_CITY,
    SBCR_ADDR_STATE,
    SBCR_ZIP_CD,
    PRVDR_NUM,
    CLM_PRCSSD_DT,
    CLM_TYPE_CLASS_CD,
    AUTHO_NUM,
    TOT_BILLED_AMT,
    HCFA_DRG_TYPE_CD,
    FCLTY_ADMIT_DT,
    ADMIT_TYPE,
    DSCHRG_STATUS_CD,
    FILE_BILLING_NPI,
    CLAIM_LOCATION_CD,
    CLM_RELATED_ICN_1,
    SBCR_ID||0
    || MBR_ID
    || GENDER_TYPE_CD
    || SBCR_RLTNSHP_TYPE_CD
    || MBR_BIRTH_DATE
    AS MBR_ENROLL_ID,
    SUBSCR_INSGRP_NM ,
    CAC,
    PRVDR_PTNT_ACC_ID,
    BILL_TYPE,
      PAYEE_ASSGN_CODE,
    CREAT_RUN_CYC_EXEC_SK,
    PRESTG_INSRT_DT
    FROM CCP_STG.CLM_HEADER_PRESTG P WHERE ACT_CD <>'D' AND SUBSTR(CLM_PRCSS_TYPE_CD,4,1) NOT IN  ('1','2','3','4','5','6')  ),
    PROV AS ( SELECT DISTINCT
    PROV_ID,
    PROV_FST_NM,
    PROV_MD_NM,
    PROV_LST_NM,
    PROV_BILL_ADR1,
    PROV_BILL_CITY,
    PROV_BILL_STATE,
    PROV_BILL_ZIP,
    CASE WHEN PROV_SEC_ID_QL='E' THEN PROV_SEC_ID
    ELSE NULL
    END AS PROV_SEC_ID,
    PROV_ADR1,
    PROV_CITY,
    PROV_STATE,
    PROV_ZIP
    FROM CCP_STG.DAILY_PROV_PRESTG),
    MBR_XREF AS (SELECT SUBSTR(MBR_ENROLL_ID,1,17)||DECODE ((SUBSTR(MBR_ENROLL_ID,18,1)),'E','1','S','2','D','3')||SUBSTR(MBR_ENROLL_ID,19) AS MBR_ENROLLL_ID,
      NEW_MBR_FLG
    FROM CCP_STG.CCP_MBRSHP_XREF)
    SELECT DISTINCT CLAIM_HDR.ICN_NUM AS ICN_NUM,
    CLAIM_HDR.SBCR_ID AS SBCR_ID,
    CLAIM_HDR.MBR_ID AS MBR_ID,
    CLAIM_HDR.MBR_FIRST_NAME AS MBR_FIRST_NAME,
    CLAIM_HDR.MBR_MI AS MBR_MI,
    CLAIM_HDR.MBR_LAST_NAME AS MBR_LAST_NAME,
    CLAIM_HDR.MBR_BIRTH_DATE AS MBR_BIRTH_DATE,
    CLAIM_HDR.GENDER_TYPE_CD AS GENDER_TYPE_CD,
    CLAIM_HDR.SBCR_RLTNSHP_TYPE_CD AS SBCR_RLTNSHP_TYPE_CD,
    CLAIM_HDR.SBCR_FIRST_NAME AS SBCR_FIRST_NAME,
    CLAIM_HDR.SBCR_MI AS SBCR_MI,
    CLAIM_HDR.SBCR_LAST_NAME AS SBCR_LAST_NAME,
    CLAIM_HDR.SBCR_ADDR_LINE_1 AS SBCR_ADDR_LINE_1,
    CLAIM_HDR.SBCR_ADDR_LINE2 AS SBCR_ADDR_LINE2,
    CLAIM_HDR.SBCR_ADDR_CITY AS SBCR_ADDR_CITY,
    CLAIM_HDR.SBCR_ADDR_STATE AS SBCR_ADDR_STATE,
    CLAIM_HDR.SBCR_ZIP_CD AS SBCR_ZIP_CD,
    CLAIM_HDR.PRVDR_NUM AS PRVDR_NUM,
    CLAIM_HDR.CLM_PRCSSD_DT AS CLM_PRCSSD_DT,
    CLAIM_HDR.CLM_TYPE_CLASS_CD AS CLM_TYPE_CLASS_CD,
    CLAIM_HDR.AUTHO_NUM AS AUTHO_NUM,
    CLAIM_HDR.TOT_BILLED_AMT AS TOT_BILLED_AMT,
    CLAIM_HDR.HCFA_DRG_TYPE_CD AS HCFA_DRG_TYPE_CD,
    CLAIM_HDR.FCLTY_ADMIT_DT AS FCLTY_ADMIT_DT,
    CLAIM_HDR.ADMIT_TYPE AS ADMIT_TYPE,
    CLAIM_HDR.DSCHRG_STATUS_CD AS DSCHRG_STATUS_CD,
    CLAIM_HDR.FILE_BILLING_NPI AS FILE_BILLING_NPI,
    CLAIM_HDR.CLAIM_LOCATION_CD AS CLAIM_LOCATION_CD,
    CLAIM_HDR.CLM_RELATED_ICN_1 AS CLM_RELATED_ICN_1,
    CLAIM_HDR.SUBSCR_INSGRP_NM,
    CLAIM_HDR.CAC,
    CLAIM_HDR.PRVDR_PTNT_ACC_ID,
    CLAIM_HDR.BILL_TYPE,
    CLAIM_DTL.FIRST_SRVC_DT AS FIRST_SRVC_DT,
    CLAIM_DTL.LAST_SRVC_DT AS LAST_SRVC_DT,
    CLAIM_DTL.PLC_OF_SRVC_CD AS PLC_OF_SRVC_CD,
    PROV.PROV_LST_NM AS BILL_PROV_LST_NM,
    PROV.PROV_FST_NM AS BILL_PROV_FST_NM,
    PROV.PROV_MD_NM AS BILL_PROV_MID_NM,
    PROV.PROV_BILL_ADR1 AS BILL_PROV_ADDR1,
    PROV.PROV_BILL_CITY AS BILL_PROV_CITY,
    PROV.PROV_BILL_STATE AS BILL_PROV_STATE,
    PROV.PROV_BILL_ZIP AS BILL_PROV_ZIP,
    PROV.PROV_SEC_ID AS BILL_PROV_EIN,
    PROV.PROV_ID AS SERV_FAC_ID    ,
    PROV.PROV_ADR1 AS SERV_FAC_ADDR1          ,
    PROV.PROV_CITY AS SERV_FAC_CITY ,
    PROV.PROV_STATE AS SERV_FAC_STATE          ,
    PROV.PROV_ZIP AS     SERV_FAC_ZIP  ,
    CHK_PAYMNT.CLM_PMT_PAYEE_ADDR_LINE_1,
    CHK_PAYMNT.CLM_PMT_PAYEE_ADDR_LINE_2,
    CHK_PAYMNT.CLM_PMT_PAYEE_CITY,
    CHK_PAYMNT.CLM_PMT_PAYEE_STATE_CD,
      CHK_PAYMNT.CLM_PMT_PAYEE_POSTAL_CD,
    CLAIM_HDR.CREAT_RUN_CYC_EXEC_SK
      FROM CLAIM_DTL,(select * FROM CCP_STG.CLM_DETAIL_PRESTG WHERE ACT_CD <>'D') CLM_DETAIL_PRESTG, CLAIM_HDR,CCP_STG.MBR_XREF,PROV,CCP_STG.CLM_PAYMNT_CLMEXT_PRESTG CLM_PAYMNT,CCP_STG.CLM_PAYMNT_CHKEXT_PRESTG CHK_PAYMNT
    WHERE    
    CLAIM_HDR.ICN_NUM = CLM_DETAIL_PRESTG.ICN_NUM
    AND       CLAIM_HDR.ICN_NUM = CLAIM_DTL.ICN_NUM
    AND CLAIM_HDR.ICN_NUM=CLM_PAYMNT.ICN_NUM(+)
    AND CLM_PAYMNT.CLM_PMT_CHCK_ACCT=CHK_PAYMNT.CLM_PMT_CHCK_ACCT
    AND CLM_PAYMNT.CLM_PMT_CHCK_NUM=CHK_PAYMNT.CLM_PMT_CHCK_NUM
    AND CLAIM_HDR.MBR_ENROLL_ID = MBR_XREF.MBR_ENROLLL_ID
    AND CLM_DETAIL_PRESTG.FIRST_SRVC_DT >= 20110101
    AND MBR_XREF.NEW_MBR_FLG = 'Y'
    AND PROV.PROV_ID(+)=SUBSTR(CLAIM_HDR.PRVDR_NUM,6)
    AND MOD(SUBSTR(CLAIM_HDR.ICN_NUM,14,2),2)=0
    UNION ALL
    SELECT DISTINCT CLAIM_HDR.ICN_NUM AS ICN_NUM,
    CLAIM_HDR.SBCR_ID AS SBCR_ID,
    CLAIM_HDR.MBR_ID AS MBR_ID,
    CLAIM_HDR.MBR_FIRST_NAME AS MBR_FIRST_NAME,
    CLAIM_HDR.MBR_MI AS MBR_MI,
    CLAIM_HDR.MBR_LAST_NAME AS MBR_LAST_NAME,
    CLAIM_HDR.MBR_BIRTH_DATE AS MBR_BIRTH_DATE,
    CLAIM_HDR.GENDER_TYPE_CD AS GENDER_TYPE_CD,
    CLAIM_HDR.SBCR_RLTNSHP_TYPE_CD AS SBCR_RLTNSHP_TYPE_CD,
    CLAIM_HDR.SBCR_FIRST_NAME AS SBCR_FIRST_NAME,
    CLAIM_HDR.SBCR_MI AS SBCR_MI,
    CLAIM_HDR.SBCR_LAST_NAME AS SBCR_LAST_NAME,
    CLAIM_HDR.SBCR_ADDR_LINE_1 AS SBCR_ADDR_LINE_1,
    CLAIM_HDR.SBCR_ADDR_LINE2 AS SBCR_ADDR_LINE2,
    CLAIM_HDR.SBCR_ADDR_CITY AS SBCR_ADDR_CITY,
    CLAIM_HDR.SBCR_ADDR_STATE AS SBCR_ADDR_STATE,
    CLAIM_HDR.SBCR_ZIP_CD AS SBCR_ZIP_CD,
    CLAIM_HDR.PRVDR_NUM AS PRVDR_NUM,
    CLAIM_HDR.CLM_PRCSSD_DT AS CLM_PRCSSD_DT,
    CLAIM_HDR.CLM_TYPE_CLASS_CD AS CLM_TYPE_CLASS_CD,
    CLAIM_HDR.AUTHO_NUM AS AUTHO_NUM,
    CLAIM_HDR.TOT_BILLED_AMT AS TOT_BILLED_AMT,
    CLAIM_HDR.HCFA_DRG_TYPE_CD AS HCFA_DRG_TYPE_CD,
    CLAIM_HDR.FCLTY_ADMIT_DT AS FCLTY_ADMIT_DT,
    CLAIM_HDR.ADMIT_TYPE AS ADMIT_TYPE,
    CLAIM_HDR.DSCHRG_STATUS_CD AS DSCHRG_STATUS_CD,
    CLAIM_HDR.FILE_BILLING_NPI AS FILE_BILLING_NPI,
    CLAIM_HDR.CLAIM_LOCATION_CD AS CLAIM_LOCATION_CD,
    CLAIM_HDR.CLM_RELATED_ICN_1 AS CLM_RELATED_ICN_1,
    CLAIM_HDR.SUBSCR_INSGRP_NM,
    CLAIM_HDR.CAC,
    CLAIM_HDR.PRVDR_PTNT_ACC_ID,
    CLAIM_HDR.BILL_TYPE,
    CLAIM_DTL.FIRST_SRVC_DT AS FIRST_SRVC_DT,
    CLAIM_DTL.LAST_SRVC_DT AS LAST_SRVC_DT,
    CLAIM_DTL.PLC_OF_SRVC_CD AS PLC_OF_SRVC_CD,
    PROV.PROV_LST_NM AS BILL_PROV_LST_NM,
    PROV.PROV_FST_NM AS BILL_PROV_FST_NM,
    PROV.PROV_MD_NM AS BILL_PROV_MID_NM,
    PROV.PROV_BILL_ADR1 AS BILL_PROV_ADDR1,
    PROV.PROV_BILL_CITY AS BILL_PROV_CITY,
    PROV.PROV_BILL_STATE AS BILL_PROV_STATE,
    PROV.PROV_BILL_ZIP AS BILL_PROV_ZIP,
    PROV.PROV_SEC_ID AS BILL_PROV_EIN,
    PROV.PROV_ID AS SERV_FAC_ID    ,
    PROV.PROV_ADR1 AS SERV_FAC_ADDR1          ,
    PROV.PROV_CITY AS SERV_FAC_CITY ,
    PROV.PROV_STATE AS SERV_FAC_STATE          ,
    PROV.PROV_ZIP AS     SERV_FAC_ZIP  ,
    CHK_PAYMNT.CLM_PMT_PAYEE_ADDR_LINE_1,
    CHK_PAYMNT.CLM_PMT_PAYEE_ADDR_LINE_2,
    CHK_PAYMNT.CLM_PMT_PAYEE_CITY,
    CHK_PAYMNT.CLM_PMT_PAYEE_STATE_CD,
    CHK_PAYMNT.CLM_PMT_PAYEE_POSTAL_CD,
    CLAIM_HDR.CREAT_RUN_CYC_EXEC_SK  
      FROM CLAIM_DTL, CLAIM_HDR,MBR_XREF,PROV,CCP_STG.CLM_PAYMNT_CLMEXT_PRESTG CLM_PAYMNT,CCP_STG.CLM_PAYMNT_CHKEXT_PRESTG CHK_PAYMNT
    WHERE CLAIM_HDR.ICN_NUM = CLAIM_DTL.ICN_NUM
    AND CLAIM_HDR.ICN_NUM=CLM_PAYMNT.ICN_NUM(+)
    AND CLM_PAYMNT.CLM_PMT_CHCK_ACCT=CHK_PAYMNT.CLM_PMT_CHCK_ACCT
    AND CLM_PAYMNT.CLM_PMT_CHCK_NUM=CHK_PAYMNT.CLM_PMT_CHCK_NUM
    AND CLAIM_HDR.MBR_ENROLL_ID = MBR_XREF.MBR_ENROLLL_ID
    -- AND TRUNC(CLAIM_HDR.PRESTG_INSRT_DT) = TRUNC(SYSDATE)
    AND CLAIM_HDR.CREAT_RUN_CYC_EXEC_SK = 123638.000000000000000
    AND MBR_XREF.NEW_MBR_FLG = 'N'
    AND PROV.PROV_ID(+)=SUBSTR(CLAIM_HDR.PRVDR_NUM,6)
    AND MOD(SUBSTR(CLAIM_HDR.ICN_NUM,14,2),2)=0;

  • How to write a procedure to retrieve data in a collection from a table?

    create or replace type Subject as object(
    subject_id number,
    subject_Desc varchar2(50)
    create or replace type Subjects_All as varray(10) of Subject
    create table student(
    StudentID varchar(10),
    Subjects Subjects_all
    so how do i write a procedure to display info such as this:
    Subjects:
    101 'Maths'
    102 'Science'
    Subjects:
    I wrote a procedure like the following but it didn't quite work :(
    CREATE OR REPLACE PROCEDURE StudentLoop AS
    all_subj subjects_all;
    each_subj subject;
    CURSOR all_subjectsrow IS select * from student;
    BEGIN
    FOR all_subj IN all_subjectsrow LOOP
    FOR each_subj IN all_subj LOOP
    DBMS_OUTPUT.PUT_LINE('Last row selected has ID ' || each_subj.subject_id || each_subj.subject_desc );
    END LOOP;
    END LOOP;
    END StudentLoop ;
    Any Advice?

    Hello,
    1.) Don't store Types in Tables. It will become a nightmare when you want to query your data any other way then retrieving your object types. Just don't do it.
    2.) A more relational model is much easier. Considering students and subjects is a n:n relation (a student can have more subjects and a subject can have more students) this might look like this:
    SQL> r
      1  declare
      2    cursor cStudents is
      3      with student as (
      4        select 1 student_id, 'test1' name from dual
      5        union all
      6        select 2 student_id, 'test2' name from dual
      7      ),
      8      subjects as (
      9        select 1 subject_id, 'Maths' subject_desc from dual
    10        union all
    11        select 2 subject_id, 'Science' subject_desc from dual
    12      ),
    13      student_subjects as (
    14        select 1 student_id, 1 subject_id from dual
    15        union all
    16        select 1 student_id, 2 subject_id from dual
    17        union all
    18        select 2 student_id, 2 subject_id from dual
    19      )
    20      select a.name name, b.subject_desc subject
    21      from student a, subjects b, student_subjects c
    22      where a.student_id = c.student_id
    23      and b.subject_id = c.subject_id;
    24  begin
    25    for rS in cStudents loop
    26      dbms_output.put_line('Student '||rS.name||': '||rS.subject);
    27    end loop;
    28* end;
    Student test1: Maths
    Student test2: Science
    Student test1: Sciencecheers

  • How to check at what time the extractor has picked records from r3 tables

    Hi experts ,
    If we want to know exactly at what time the Extractor has picked up the records from r/3 tables .
    or if we want to know the time stamp of extractor picking the records from r3 tables after r3 entries
    Regards ,
    Subash Balakrishnan

    Hi,
    The following are few function modules which will give you the information you need based upon the area you are working in.
    SD Billing: LOG_CONTENT_BILLING
       Delivery: LOG_CONTENT_DELIVERY
    Purchasing: LOG_CONTENT_PURCHASING etc...
    See if the above FMs help you in any way...

  • Select query taking too much time to fetch data from pool table a005

    Dear all,
    I am using 2 pool table a005 and a006 in my program. I am using select query to fetch data from these table. i.e. example is mentioned below.
    select * from a005 into table t_a005 for all entries in it_itab
                       where vkorg in s_vkorg
                       and     matnr in  s_matnr
                       and     aplp   in  s_aplp
                       and     kmunh = it_itab-kmunh.
    here i can't create index also as tables are pool table...If there is any solutions , than please help me for same..
    Thanks ,

    it would be helpful to know what other fields are in the internal table you are using for the FOR ALL ENTRIES.
    In general, you should code the order of your fields in the select in the same order as they appear in the database.  If you do not have the top key field, then the entire database is read. If it's large then it's going to take a lot of time.  The more key fields from the beginning of the structure that you can supply at faster the retrieval.
    Regards,
    Brent

  • Query - to fetch records - before particular date

    I need to retrive last analyzed table prior to 28/Nov/2010 - to put into simple wanted to fetch records from a table which are created before the above mentioned date.
    Thanks,
    Steve

    Spade wrote:
    I need to retrive last analyzed table prior to 28/Nov/2010 - to put into simple wanted to fetch records from a table which are created before the above mentioned date.
    Thanks,
    SteveYou want to fetch the rows which were "inserted" before that date?
    Then you either:
    a) Need to have a timestamp column on the row or
    b) Use ORA_ROWSCN pseudo-column if you created your table(s) with row-level dependency tracking or
    c) Install log miner and query the necessary archive logs.
    :p

  • How to fetch corresponding records from 2 tables using ADF Toplink & EJB

    Hi,
    I am unable to fetch records from 2 tables, which has a foregin key.Used the custom query in toplink, But the output is the cartition of the first table draged and the first row of the second table.The output required should be in the form of ADF Table. I am able to find the output in JSF data table.
    Two tables:
    Table name:Solutions
    sol_id varchar2(PK)
    sol_name varchar2
    Table name:Solution_details
    sol_id varchar2(FK)
    common_asum_id varchar2(PK)
    common_detail varchar2
    Output Required:
    sol_id,sol_name,common_asum_id,common_detail
    Custom query:
    SELECT * FROM solutions a
    ,solution_details b
    WHERE a.sol_id=b.sol_id

    Hi,
    I am unable to fetch records from 2 tables, which has a foregin key.Used the custom query in toplink, But the output is the cartition of the first table draged and the first row of the second table.The output required should be in the form of ADF Table. I am able to find the output in JSF data table.
    Two tables:
    Table name:Solutions
    sol_id varchar2(PK)
    sol_name varchar2
    Table name:Solution_details
    sol_id varchar2(FK)
    common_asum_id varchar2(PK)
    common_detail varchar2
    Output Required:
    sol_id,sol_name,common_asum_id,common_detail
    Custom query:
    SELECT * FROM solutions a
    ,solution_details b
    WHERE a.sol_id=b.sol_id

  • How to write ABAP HR reports in ABAP web dynapro

    Hi All,
    How  to write ABAP HR reports in ABAP web dynapro? We can add HR REPORT CATEGORY in ABAP HR using logical database like PNP.How to add HR REPORT CATEGORY in ABAP Webdynapro ?
    Thanks.

    You can't use legacy concepts like logical databases directly in Web Dynpro ABAP.  Even if you could do so, you shouldn't.  Web Dynpro ABAP should always follow MVC - meaning that your business logic (the model) should be separated from WD as much as possible. This means calling function modules or class methods to consume the business logic and data.  So in general there should be no difference between building HR reports or any other type of report in WDA - since from the WDA side you are calling other objects to consume the data. 
    This probably does mean that you will need to create classes to expose the HR data that you want in your WDA.

  • ABAP Reports and SAP Query

    Hi Experts,
    I have question regarding ABAP Reports, SAP Query, and Transaction with variant.  How are we securing one the above reports that we assign them through pfcg.  We can secure custom program by custom transaction or define the auth group in S_PROGRAM auth object but in this case we have to assign SA38 in production. is that correct?
    Please help me understand difference between the ABAP reports and SAP query. Is the ABAP reports same as Program or they are different.
    Thanks in advance
    Faisal
    Edited by: Faisal on Jun 30, 2009 11:06 PM

    Hi,
    1) End user security (role matrix coordinate with process team)
    This role Matrix design is most important where we can put restrictions and use SoD.
    2) Secure Table (by auth group)
    Table TDDAT and use of transaction se54 for security tables to right auth Groups. Secure s_tabu_dis, s_tabu_cli.
    3) Secure program (as you said ABAP reports are referred to Program)
    Use of table TPGP and program RSCSAUTH for assignment of groups to Program. SA38 Running of SA38 requires a minimum SUBMIT in user Action. A user having SA38 is dangerous as he/she is now enabled to run any report. Hence protection in Auth Group is needed. Verify each and every program is having authority check statement and Auth Group or not before assigning sa38. As you mentioned its best to avoid SA38 and create CUSTOM TXN for each report.
    (We should also SECURE S_DEVELOP in Production properly along with ur points. Please Note).
    4) Secure some batch jobs roles for batch job
    Secure by s_btch* objects and less access to se36.
    5) Create support roles for cutover activity during Go-live
    That is always needed. Go ahead.
    6) Emergency roles & IT roles for support
    This is very much needed as a role of Mitigation and Fire Fighting for Temporary access. Ensure to enable ur audit parameters in RZ10 (rsau* sm20,RSLG* for sm21). Give emergency access but enable audit via sm19 and get audit reports from sm20 and sm21 immediately after the use of emergency access.
    There are also other auth objects we need to be care ful which is a long list and hope every body ensures that (s_cts,a_admi,s_trans, tables ssm_cust, prgn,t000) etc and a host of others. Besh wishes. Let us know if any issue.
    Regards
    Aveek.

  • Adding the ABAP code to SAP Query to support Query's ALV Double click.

    Hi, Expert.
    I need to add some ABAP Code into SAP Query (or Infoset) to support the double click event on ALV cell of result of query.
    Is it possible & How to do ?
    Thank you very much.
    Best Regard
    Nattapash C.

    Hi, Gautham.
    I've put BREAK-POINT in all code section e.g. INITIALIZATION, END-OF-SELECTION..
    I found there are some section for add code that will be executed when query is processing before output data to ALV.
    What I need to know is Where I can input the code after ALV output. For support the Double Click Event on Query's ALV cell.
    Best Regard,
    Nattapash C.

  • How to write the logic for extending Idocs...

    Hi,
          Can anybody pls explain how to write the logic for extending IDOCs with an example...
          Good suggestions can be appreciated..
    Regards,
    Ram

    Hi Ram,
    Generally the IDoc user exit is called at the following places:
      1) When the control record is read.
      2) After each and every segment in the data record
      3) At the end of the data segment processing.
    The IDoc user exit interface generally imports IDOC_DATA (data record internal table) table. Now the data records in the internal table should appear in the same order as maintained while defining IDoc structure (WE30 transaction). For SAP standard segment SAP code will take care of this. For extended segment you will have to take care of this aspect by appending the Z-segment in the IDOC_DATA table.
    You can do this by:
             looping at IDOC_DATA table:
                 - Do a case-endcase fo IDOC_DATA-SEGNAM (This stores the segment 
                   structure as per the hierarchy).
                 - Within the case for "Z-segment" you can write the logic for appending
                   the Z-segment to IDOC_DATA-SDATA.
    Hope this gives some clue.
    Regards,
    Gajendra.

Maybe you are looking for

  • Vendor as well as customer payment settlement

    Hi Guru's I have vendor and customer single party, and operating business to the same party in both module as AR and AP , i mean raising invoice and receiving invoice both, but i need to settle the payment now ( vendor or customer account should show

  • Can't choose my language - CS5 trial

    Hi... I've downloaded the Master Collection Trial, and when to choose language, I can't choose my language (Danish) or English... There are only few languages to choose: Deutsch, Espanol, Francais, Italiano, Nederlands, Portugues and Svenska... How c

  • Merge to HDR problems

    when i merge to HDR my photo will not save, in fact my file menu will not open up.  what am i doing wrong?  it used to work.I have Photoshop cs5 

  • Webservices with Flex

    Is there any way to consume webservices from flex without using LCDS or FDS. Thanks in advance

  • Adobe Acrobat Reader Plugin

    Hi, Does anyone know how to go about getting an Adobe Reader plug-in working? I've read all the 'Adobe Reader Integration Key License Agreement' stuff but I'm a little confused. My plug-in is specific to my application (it allows a button to be added