How to fetch data based on this selection screen

Hi Friends:
   I've a selection screen which contains these 3 fields:
company code (t001-bukrs)
material division (mara-spart)
posting date  (bkpf-budat)
based on the above fields, I've to fetch the following:
ekpo-bukrs
mara-spart
mseg-werks
mseg-lgort
bseg-hkont
bseg-kostl
bseg-hkont
skat-txt50
mseg-mblnr
mseg-zeile
bseg-belnr
bkpf-bktxt
mseg-insmk
bkpf-monat
bkpf-budat
mseg-bwart
mbew-matnr
makt-maktx
mseg-menge
mseg-meins
mbew-stprs
mseg-dmbtr
bseg-pswsl
ausp-atwrt
mara-matkl
mara-mtart
mbew-bklas
mbew-bwtar
mkpf-vgart
mcha-charg
mseg-ebeln
aufk-aufnr
mseg-ummat
vbak-vbeln
likp-vbeln
bkpf-usnam
Please help me with the logic . I want to ask that in which order I should start fetching data.How to relate it from selection screen. Which table I should fetch first based on the selection screen.how to relate mseg/bseg/mara/mbew/vbak/bkpf  etc.
Please help.
Thanks for your time.

Hi,
I dont think you need EKPO to fetch your bukrs. It is available in BKPF too.
Use inner join to join MKPF, BKPF, MAKT, fetch all the related entreis.
Use Inner join on MBEW, MCHA for all entries from above query.
use inner join on AUSP for all entries from above query.
Use may use separate queries or inner joins for LIKP and VBAK with for all entries.
Use separate for all entries for BSEG and MSEG. Do not use any JOIN on BSEG as it is a pooled table.
As per the need you may change the queries..
Regards,
Subramanian

Similar Messages

  • Splitting the date based on the selection screen input

    Hi all,
    In the Selection screen of my report i had maintained two fields
    SELECT-OPTIONS  : S_DATE    FOR TPCDATE-FROM_DATE.
    PARAMETERS      : P_NUMBER  TYPE ZMMAREA-NUMBER.
    I need to code such that
    S_DATE should be splitted into P_NUMBER times
    for example if P_NUMBER is 4 i need  S_DATE should be splitted into 4 equal parts or near by equal parts
                        IF  P_NUMBER is 2 i need  S_DATE should be splitted into 2 equal parts or  near by equal parts
    Please suggest me the code of if any Function module exists fot this date splitting
    Thanks in advance
    Ajay.D

    though date question are not allowed, this requirement sounds little different.
    you can take a difference between those days by: S_date-high - S_date-low.
    then divide the difference by p_number. now you get the split positions.
    now in a do enddo you can negate the dates by the split amount you got from the divisions.
    like...
    PARAMETERS: num type i.
    select-OPTIONS: s_date for sy-datum.
    data : gv_split type i, gv_temp type sy-datum.
    gv_split = s_date-high - s_date-low.
    gv_split = gv_split / num.
    gv_temp = s_date-high.
    do num times.
      gv_temp = gv_temp - gv_split.
      WRITE / gv_temp.
    enddo.

  • Filtering of the data based upon the selection screen data using ldb

    Hi Experts ,
    I am using ldb pnpce, for my report ,and i created my own report category with selection paramaters
    action type and payroll area
    now the problem is when i am giving the action type as Z0 ,the data to be extracted is not getting filtered
    based upon the action type ,the data consists the records having different action types other than Z0
    Please give me some solution for this

    Thanks Durga ,but the link wat ever u was for hiding the selection screen fields
    but my question is when am using get pernr event my data is not getting filtered with the selection screen paramater value
    i,e m giving action type as only hiring ,but m getting the data for all the action types ,its not filtering based upon my selection

  • How to fetch data based on dates ?

    How do i write the query for the below statements ?
    1) net_bank_cr from rm_memorandum for the previous year end 31st March
    2) net_bank_cr from rm_memorandum for the as on date
    3) net_bank_cr from rm_memorandum as one year prior to current reporting date
    The table structure of rm_memorandum is as given below:
    create table RM_MEMO
    AS_ON_DT DATE,
    PAID_CAPITAL NUMBER(20,2),
    TOTAL_OBE NUMBER(20,2),
    CR_EQI_OBE NUMBER(20,2),
    NET_BANK_CR NUMBER(20,2),
    ADJ_NET_BANK_CR NUMBER(20,2),
    DEP_CURREMT_CRR NUMBER(20,2),
    LIAB_OTH_CRR NUMBER(20,2),
    TOTAL_CRR NUMBER(20,2)
    )

    The following result includes all rows for the previous financial year relative to the current date.
    SQL> with t as
      2  (
      3    select to_date('31/12/2010', 'dd/mm/yyyy') As_On_Dt, 205 Net_bank_CR from dual union all
      4    select to_date('15/03/2011', 'dd/mm/yyyy'), 205  from dual union all
      5    select to_date('15/03/2011', 'dd/mm/yyyy'), 666  from dual union all
      6    select to_date('31/03/2011', 'dd/mm/yyyy'), 9856 from dual union all
      7    select to_date('31/03/2011', 'dd/mm/yyyy'), 521  from dual union all
      8    select to_date('05/04/2011', 'dd/mm/yyyy'), 20   from dual union all
      9    select to_date('07/05/2011', 'dd/mm/yyyy'), 965  from dual
    10  )
    11  --
    12  select *
    13  from t
    14  where  t.As_On_Dt between (case
    15                              when ( sysdate >  add_months(trunc(t.As_On_Dt, 'YYYY'), 3) - 1 ) then
    16                                add_months(trunc(add_months(sysdate, -12), 'YYYY'), 3) - 1
    17                              when ( sysdate <= add_months(trunc(t.As_On_Dt, 'YYYY'), 3) - 1 ) then
    18                                add_months(trunc(add_months(sysdate, -24), 'YYYY'), 3) - 1
    19                            end) + 1 -- plus 1 to ensure it is the 1st Apr
    20                     and
    21                            case
    22                             when ( sysdate >  add_months(trunc(t.As_On_Dt, 'YYYY'), 3) - 1 ) then
    23                               add_months(trunc(sysdate, 'YYYY'), 3) - 1
    24                             when ( sysdate <= add_months(trunc(t.As_On_Dt, 'YYYY'), 3) - 1 ) then
    25                               add_months(trunc(add_months(sysdate, -12), 'YYYY'), 3) - 1
    26                            end
    27  /
    AS_ON_DT  NET_BANK_CR
    31-DEC-10         205
    15-MAR-11         205
    15-MAR-11         666
    31-MAR-11        9856
    31-MAR-11         521Edited by: bluefrog on Sep 7, 2011 1:35 PM Ensure it is the 1st of Apr as the first date, hence add 1

  • How to insert values using pushputtons in text item & fetch data based on

    Dear friends,
    I want to insert values in the Text item using pushbutton e.g to insert 05CST884 into text item using pushbuttons '0' '5' 'C' 'S' 'T' '8' '8' '4' (alpha numeric buttons) in the layout editor and then fetch data based on the number entered with that of one in the table in the another text item2 in the layout editor.
    Suggestions regarding how to develop and use effective triggers are welcome.

    At the block level (for the control block where all your push buttons are, let's call it block1) create a WHEN-BUTTON-PRESSED trigger. Your [A-Z] and [0-9] buttons should be on a dedicated non-database datablock to reduce problems. As stated previously, this trigger should just contain the code:
    :block2.text_item := :block2.text_item||get_item_property(:system.trigger_item, label);
    Also on the pushbutton block, create a backspacve button with its own dedicated WHEN-BUTTON-PRESSED trigger containing:
    if length(:block2.text_item) > 0 then :block2.text_item := substr(:block2.text_item, 1, length(:block2.text_item)); end if;
    This will hopefully erase the last character entered.
    block2 should be based on the database table (see Property Palette --> Database) you wish to query and text_item should be based on the database item which contains the code you entered. All the other database items you wish to displayshould also be added to block2.
    Add another FIND push button to block1 with the code:
    go_block('block2');
    execute_query;
    Without writing the whole thing for you, I'd suggest you get a decent Forms tutorial book to guide you through the basics (Oracle Forms Developers Handbook).

  • How to fetch data where reference with two values

    Hello Gurus,
    How to fetch data from database table with two values for reference. like
             SELECT  < FIELDS>
                              FROM <DB>
                              INTO TABLE TAB2
                              FOR ALL ENTRIES IN
                              TAB1
                              WHERE
                               FIELD1 = TAB1-FIELD1 AND
                               FIELD1 =  TAB1-FIELD2.

    Hi,
    If you want to get data for both fields then Instead of AND use OR
            SELECT  < FIELDS> 
                              FROM <DB>
                              INTO TABLE TAB2
                              FOR ALL ENTRIES IN
                              TAB1
                              WHERE
                               FIELD1 = TAB1-FIELD1 OR
                               FIELD1 =  TAB1-FIELD2.
    Or if you want that only common data for both fields should be fetched then create new internal table. Append data of both fields into that table. Sort new table and do delete adjust duplicate. Now use new internal table in your select query.
    Let me know if this helps.
    Regards,
    Jigar Thakkar.

  • No data Exists for this selection in PSA.

    Hi Guys,
    I received an Error message with loading of 2lis_03_bf datasource..
    Error message when processing in the Business Warehouse
    Diagnosis
    An error occurred in the SAP BW when processing the data. The error is documented in an error message.
    System response
    A caller 01, 02 or equal to or greater than 20 contains an error meesage.
    Further analysis:
    The error message(s) was (were) sent by:
    PSA Table
    DETAILS Tab: Processing (data packet): Errors occurred
                       : Data Package 6 ( ? Records ) : Errors occurred
                       : Update PSA ( 0 Records posted ) : Errors occurred
                       : No data exists for this selection in PSA
    For DataPacket 6 (Records sent :21572 - Records Received : 0) 
    All other datapackets are updated fine with almost 10,00,000 records..Any help on this ,guys..
    Manythanks
    Arun

    Hi,
    While the load was in progress some one might have deleted the data in PSA or there might be a PSA deletion job running or there might be a PSA deletion chiain which includes this table. Check all these to find out how it got deleted.
    In order to load the data again you can do a reload and probably it works fine this time.
    Anup.

  • How to view data in tables by selecting the synonym from the database objec

    I could not figure out how to view data in tables by selecting the synonym from the database objects navigation tree. I had to first choose the synonym, view the details of the synonym to determine the table name, and then select the table from the database objects tree. Is this the only way available?

    This functionality currently does not exist. I don't see it on the 1.1 statement of direction either, so perhaps someone from Oracle can give some insight as to when this could be expected.
    Eric

  • How to avoid data repetation when using select statements with innerjoin

    how to avoid data repetation when using select statements with innerjoin.
    thanks in advance,
    satheesh

    you can use a query like this...
      SELECT DISTINCT
             frg~prc_group1                  "Product Group 1
             frg~prc_group2                  "Product Group 2
             frg~prc_group3                  "Product Group 3
             frg~prc_group4                  "Product Group 4
             frg~prc_group5                  "Product Group 5
             prc~product_id                  "Product ID
             txt~short_text                  "Product Description
    UP TO 10 ROWS
    INTO TABLE l_i_data
    FROM
    Joining CRMM_PR_SALESG and
    COMM_PR_FRG_ROD
    crmm_pr_salesg AS frg
    INNER JOIN comm_pr_frg_rod AS prd
    ON frgfrg_guid = prdfragment_guid
    Joining COMM_PRODUCT and
    COMM_PR_FRG_ROD
    INNER JOIN comm_product AS prc
    ON prdproduct_guid = prcproduct_guid
    Joining COMM_PRSHTEXT and
    COMM_PR_FRG_ROD
    INNER JOIN comm_prshtext AS txt
    ON prdproduct_guid = txtproduct_guid
    WHERE frg~prc_group1 IN r_zprc_group1
       AND frg~prc_group2 IN r_zprc_group2
       AND frg~prc_group3 IN r_zprc_group3
       AND frg~prc_group4 IN r_zprc_group4
       AND frg~prc_group5 IN r_zprc_group5.
    reward it it helps
    Edited by: Apan Kumar Motilal on Jun 24, 2008 1:57 PM

  • How to fetch data from Mysql with SSL.

    I am using jdk1.5 and mysql 5.0.
    How to fetch data from Mysql with SSL
    I am using url = jdbc:mysql://localhost/database?useSSL=true&requireSSL=true.
    It shows error. how to fetch

    I have created certificate in mysql and checked in mysql.
    mysql>\s
    SSL: Cipher in use is DHE-RSA-AES256-SHA
    but through ssl how to fetch data in java.

  • How to fetch data in report related to fb03 , bkpf, bset table ?

    how to fetch data in report related to  fbo3, table bkpf, bset etc.
    if any body is having any report related to these tables then please share.

    Moderator message - Welcome to SCN.
    But please ask a specific questio - thread locked.
    Also, Please read Please read "The Forum Rules of Engagement" before posting!  HOT NEWS!! and How to post code in SCN, and some things NOT to do... and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again.
    Rob

  • What is a cube? how we store data in that? how we fetch data from cube?

    Hi,
    What is a cube? how we store data in that? how we fetch data from cube?
    Regards.
    venkat

    >
    venkey B wrote:
    > Hi,
    >
    >
    > What is a cube? how we store data in that? how we fetch data from cube?
    >
    >
    > Regards.
    >
    > venkat
    Hi Venkat,
    I guess you mean an infocube from the SAP BI product. I propose to look at the forum for Business Intelligence to find your answers.
    E.g. SAP POS DM writes the sales data in infocubes.....

  • How to fetch data from PTREQ tables

    I need to display  data in the customised webdynpro application from PTREQ tables.
    Can anyone help me out how to fetch data from these tables.

    use the standard modules like
    PT_ARQ_REQUEST_CHECK
    PT_ARQ_REQUEST_EXECUTE
    PT_ARQ_REQUEST_PREPARE

  • How to fetch data from cluster tables

    hi
    i need to know  how to fetch data from cluster tables please update me if any
    i know that we cannot use joins in cluster table we use view etc
    but i need detailed inforation on methods for fetching data from cluster tables
    regards
    Nishant

    Hi,
        Check the following links
    http://fuller.mit.edu/hr/cluster_tables.html
    The specified item was not found.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33

  • How to fetch data for sales order costing

    Hi All,
    How to fetch data for VA03 --> Extras --> Costing having cost element details.
    Thanks
    Gaurav

    Hi Gaurao ,
    There is no such function module  to extract data  in one column   , you have to  Convert all the columns data    in one column
    for period   .
    regards
    Deepak.

Maybe you are looking for

  • Change of G/L Account Number when document is parked

    Hello, I have parked one document, but i have made mistake at the time of entering G/L Account Number. Can i change this account number ? Please advise me. I have used Tcode FBV0, eventhough it is not helpful to me. Thanks in advance for your kind co

  • 2nd MBP has messed up my home network--help please

    I have a linksys wireless router. I have a MBP 1.83 gz and my MBP 2.2 GZ just arrived today. I turned them both on, both will get onto my wireless network (which is WEP protected) and then after two or three minutes neither computer can go online. In

  • How to run SQL script file on Linux using Java ?

    Hi, I need to execute .sql file using java. I used following approach for this. private void runScriptEvent(java.awt.event.ActionEvent evt) {                                        String sqlOutput = "";         String sqlPromptLines="";         Stri

  • Downloading/Installing CS6 Design and Web Premium on 2nd Computer

    I believe I am licensed to have two copies on 2 computers as long as I am the sole user and don't run them both at the same time. As this is no longer a bundled option, am I required to download the trial version, not all of which are available throu

  • Change font with a bottom.

    Hi, I couldn't find an answer for this but: Is there a way to chnage the font in the front panel by pressing a button? As you can see, I am building a farily simple starwars-theme-application, what I want to to is to use that funky starwar font ( lik