How to incorporate Current Tax Period in Select Query.

i need to extract the data based on the Current Tax Period
say current tax perios is
06-04-2007  to 05-04-2008
how to incorporate this in my select query.
i need to fetch
PERNR
BEGDA
ENDDA
STAT2
FROM PA0001 INTO TABLE IT_P0001
for all entries in T_TXT_UPLOAD
WHERE PERNR = T_TXT_UPLOAD-PERNR.
In this t_txt_upload is an internal table.(input file which is taking using GUI_UPLOAD).

Use this FM  HR_ID_TAX_YEAR to get the starting and end date for tax year and pass the date to your SELECT command for BEGDA & ENDDA.
Regards,
Amit
Reward all helpful replies.
<b>P.S</b> Close the queries when get solved.

Similar Messages

  • How can i use SUM aggregate in select query?

    HI,
    GURUS,
    How can i use SUM function in Select Query and i want to store that value into itab.
    for ex:
    TABLES: vbap.
    types: begin of ty_vbap,
           incluse type vbap,
           sum type string,
          end of ty_vbap.
    data: i_vbap type TABLE OF ty_vbap,
          w_vbap type ty_vbap.
    SELECT sum(posnr) FROM vbap into table i_vbap up to 5 rows.
                            (or)
    SELECT sum(posnr) FROM vbap into table i_vbap group by vbeln.
      loop at i_vbap into w_vbap
    " which variable have to use to display summed value.
      endloop.
    if above code is not understandable pleas give ome sample code on  above query.
    Thank u,
    shabeer ahmed.

    Hi,
    Check this sample code.
    TABLES SBOOK.
    DATA:  COUNT TYPE I, SUM TYPE P DECIMALS 2, AVG TYPE F.
    DATA:  CONNID LIKE SBOOK-CONNID.
    SELECT CONNID COUNT( * ) SUM( LUGGWEIGHT ) AVG( LUGGWEIGHT )
           INTO (CONNID, COUNT, SUM, AVG)
           FROM SBOOK
           WHERE
             CARRID   = 'LH '      AND
             FLDATE   = '19950228'
           GROUP BY CONNID.
      WRITE: / CONNID, COUNT, SUM, AVG.
    ENDSELECT.
    Regards,
    Sravanthi

  • How to truncate a field in a Select Query

    Hello Gurus,
    I am new in SAP, i have a question i am making an appointment letter in SMARTFORMS , in global declaration (initialization) i am using a select query
    SELECT SINGLE BET01 FROM PA0008 INTO G_BET01 WHERE PERNR = WA_PERNR.
    where BET01 is the Amount field which is getting printed in the smart form but its takes 5 to 6 character blank spaces in the printing time, i want to truncate this space (remove this space ) in the print time , please tell me how to remove this space , the field size is 13 , how can i reduce the field size in my smartform query. please help . G_BET01 is a variable

    Maybe you can use this.
    DATA: d_char(15).
    WRITE G_BET01 TO d_char CURRENCY 'XXX'.
    'Then you can remove the spaces using :
    CONDENSE d_char no-gaps.

  • How to use Field-symbol with dynamic select query

    Can anybody tell me, how to use field-symbols in the dynamic select query.

    FIELD-SYMBOLS <fs> { typing | STRUCTURE struc DEFAULT dobj }.
    1. ... typing
    2. ... STRUCTURE struc DEFAULT dobj
    The FIELD-SYMBOLS statement declares a field symbol <fs>. The name conventions apply to the name fs. The angle brackets of the field symbols indicate the difference to data objects and are obligatory. You can declare field symbols in any procedure and in the global declaration section of an ABAP program, but not in the declaration section of a class or an interface. You can use a field symbol in any operand position in which it is visible and which match the typing defined using typing.
    After its declaration, a field symbol is initial - that is, it does not reference a memory area. You have to assign a memory area to it (normally using the ASSIGN statement) before you can use it as an operand. Otherwise an exception will be triggered.
    eg.
    FIELD-SYMBOLS <fs> TYPE ANY.
    DATA: BEGIN OF line,
            string1(10) VALUE '0123456789',
            string2(10) VALUE 'abcdefghij',
          END OF line.
    WRITE / line-string1+5.
    ASSIGN line-string1+5(*) TO <fs>.
    WRITE / <fs>.
    output:
    56789
    56789
    reward if helpful
    anju

  • How can i use param in my select query ( see code)

    Hi ,
    I need to use the param instead of hardcoding the value in the select query , when i did that it is working .
    I think the limit of args is only till the end of main and my select query is in a method called Load() .
    How can i use the param in my select query .
    public static void main(String[] args){
    name = args[0];
    class= args[1];
    new Load();
    }//end of main
    public Load()
              try {
                   Class.forName(JDBC_DRIVER);
                   connection = DriverManager.getConnection(DATABASE_URL,"username","pw");
                   statement = connection.createStatement();
                   //First Query : pin and ticket number
                   ResultSet resultSet = statement.executeQuery("SELECT pin , ticketnumber from airport ,year where "+                                                                      "year.year_name= Here i need to use the param (instead of hardcoding) and year.class_year= Here too i need to use param");
    }// end of method Load()Edited by: 1sai on Sep 24, 2008 7:34 AM
    Edited by: 1sai on Sep 24, 2008 7:35 AM

    Might I suggest you change the structure of your program to the following:
    public class Load {
      private Connection conn;
      private PreparedStatement statement;
      public Load(String sql) {
        init(sql);
      protected void init(String sql) throws Exception {
        Class.forName(JDBC_DRIVER);
        conn = DriverManager.getConnection(DATABASE_URL, "username", "pw");
        statement = conn.prepareStatement(sql);
      public ResultSet execute(String p1, String p2) throws Exception {
        statement.setString(1, p1);
        statement.setString(2, p2);
        return statement.executeQuery();
      public void close() throws Exception {
        if (statement != null)
          statement.close();
        statement = null;
        if (conn != null)
          conn.close();
        conn = null;
      public static void main(String[] args) throws Exception {
        String sql = args[0];
        String param1 = args[1];
        String param2 = args[2];
        Load load = new Load(sql);
        ResultSet rs = load.execute(param1, param2);
        while (rs.next())
          System.out.println(rs.get(0));
        rs.close();
        load.close();
    }This allows you to use the same "Load" object for multiple queries with different parameters.
    I do not recommend you actually use the code above in any sort of production application. You should really take a look at Spring Framework along with an ORM tool like Hibernate or Ibatis to simplify your DAO layer.
    Hope this helps,
    David

  • How to create a DB Adapter with select query having inner query

    Hi All,
    I am trying to create a DB Adapter with select query. The query has some inner queries in it. It is just like this select a, b, c, (select d from e) d, (select e from e) e from tablename.
    The problem here is with the xsd generated for this query. Xsd is not getting generated properly for all the fields it is just getting generated till c element and when it encounters
    the inner query it is stopping the generation of xsd. So for the above query the xsd is something similar to the below
    <xs:complexType name="rewOutput">
    <xs:sequence>
    <xs:element name="a" type="xs:string" nillable="true"/>
    <xs:element name="b" type="xs:string" nillable="true"/>
    <xs:element name="c" type="xs:string" nillable="true"/>
    <xs:element name="select_d" type="xs:string" nillable="true"/>
    </xs:sequence>
    </xs:complexType>
    as shown above the xsd is just getting generated till the first inner query. What should be done to get the full fledged xsd. Should it be manually built ?? Please help me on this.
    Thanks In Advance.
    Edited by: 959766 on Nov 30, 2012 1:20 AM

    Hi,
    I don't think the parser will be able to understand your query properly... I would try building the xsd manually...
    Cheers,
    Vlad

  • How can replace IF condition for a Select query in my reports?

    IF s_bukrs-LOW = '4312' OR s_bukrs-LOW = '4313' OR s_bukrs-LOW = '4349'  .
    ELSEIF s_bukrs-LOW = '4310' OR s_bukrs-LOW = '4311' OR s_bukrs-LOW = '4587'.
    ENDIF.
    What if I want to use select query in place of IF condition, in my report for a Z -table in which I have made entries of ZZUSEREXIT-my progam name ,VAR1-4310,VAR2-4311,VAR3-4312,VAR4-4313,VAR5-4349,VAR6-4587?

    HI
    U can do this by two ways-
    (1) Using Two SELECT statementsie. one for IF statements and second for ELSEIF statements.
    Like--
        SELECT < field name>,
    WHERE s_bukrs-LOW = '4312' OR s_bukrs-LOW = '4313' OR s_bukrs-LOW = '4349' 
    SELECT < field name>,
    WHERE s_bukrs-LOW = '4310' OR s_bukrs-LOW = '4311' OR s_bukrs-LOW = '4587'.
    (2) U can do this in using IF with select statements.
    This will help u

  • How to determine current tax configuration owner (content_owner_id)

    I am attempting to query zx_rates_b to find a record where tax_rate_code = '6X' to find only the record for the current configuration owner. In 11i, we used the organziation id to identify the correct record.
    The following query returns too many records and need to be limited by content_owner_id.
    SELECT zrat.tax_rate_id, zrat.tax_rate_code --atco.tax_id, atco.tax_rate
    INTO v_tax_code_id, v_ap_tax_rate
    FROM --ap_tax_codes_all atco,
    po_vendor_sites_all pvsi, zx_rates_b zrat
    WHERE pvsi.vendor_site_id = r_ooli.execute_vendor_site_id
    --AND atco.name = pvsi.vat_code
    AND zrat.tax_rate_code = pvsi.vat_code
    --AND atco.org_id = r_ooli.debited_org_id
    --AND atco.enabled_flag = 'Y';
    AND zrat.active_flag = 'Y'
    AND trunc(sysdate) between zrat.effective_from and zrat.effective_to;
    How should I determine the content_owner_id?
    This code is executed during a concurrent request

    ZX_TAXES_B, ZX_STATUS_B and ZX_RATES_B tables contain content Owner Id column... you have to first find out the relevant content owner id from the complete list of options that are available, then hardcode the same to your SQl query to narrow down on unique record ...
    Regards,
    Ivruksha

  • How to use user defined function in select query using Toplink

    Hi Friends
    I am little bit of new in Toplink stuff... so please help me...
    I have to database functions 1. encrypt and 2. decrypt.
    I want to exceute the following sql query using toplink
    select port, database, user_name, decrypt(encrypt('String which is to be encrypt ','password'),'password') from CONFIGURATION
    can anyone tell me , how to write code in toplink which will give the about sql output.
    thanks .....

    The "Specifying a Custom SQL String in a DatabaseQuery" section in the TopLink Developer's Guide may help... http://download-uk.oracle.com/docs/cd/B32110_01/web.1013/b28218/qrybas.htm#BCFHDHBG

  • How to transfer current user id to BW query?

    Hello:
       I create a iView based on BW query ,how to pass the current user id to BW?
       Thanks!

    Hi,
    If the portal user id and BW userid are same then no problem
    Otherwise do the user mapping in the portal
    Regards
    Arun

  • How to use field symbols in dynamic select query

    I have a requirement to take the table name from selection screen and get data from that table 
      SELECT * FROM (P_TBLNM)
      INTO TABLE  <ITAB>
      WHERE <condition>.
    I have declared field symbol as type any table , but i am getting dump saying fieldsymbol is not getting assigned .
    Any pointers , please help.

    Hi laxmi,
    for your second question, try this one:
    DATA : ref_table_des TYPE REF TO cl_abap_structdescr,
    <itab> TYPE STANDARD TABLE,
    <wtab> TYPE ANY,
    dref TYPE REF TO DATA.
    DATA: <knumh>.
    ref_table_des ?= cl_abap_typedescr=>describe_by_name( P_TBLNM ).
    create data dref type handle ref_table_des.
    assign dref->* to <wtab>.
    create data dref like standard table of <wtab>.
    assign dref->* to <itab>.
    SELECT * FROM (P_TBLNM)
    INTO TABLE <itab>
    WHERE <condition>.
    LOOP AT <itab> ASSIGNING <wtab>.
    assign component 'KNUMH' of structure <wtab> to <knumh>.
    SELECT * FROM KONP
    APPENDING TABLE GI_KONP
    WHERE KNUMH = <knumh>.
    ENDLOOP.
    Regards,
    Richard
    Edited by: richard santos on Nov 17, 2009 8:16 AM

  • DB Adapter : How to limit number parent records in select query.

    Hi All,
    I am querying a master-detail tables from a database.
    I want to limit the number of parent records to 15.
    Ex: Resources is parent table. It has two child tables "Skills" & "PersonalDetails".
    Resources table has 1 to many relationship with above tables.
    When i use rownum <= 15 in the where clause i am seeing different results each time.
    Sample query is as below.
    select distict t0.resourceName , t1.skillName , t2.location
    from .table_names
    where .....join between tables..
    and rownum <= 15
    Note : I selected the checkbox "Use outer joins to return a single result set for both master and detail tables" in DBAdapter wizard.
    Let me know if i am missing anything important.
    Thanks,
    Sid.

    Hi,
    You can set the "Max Rows" at the DBAdapter wizard ("Advanced Options" step).
    Regards,
    Daniel

  • How to compare char and numc in select query

    Hi  Experts,
    I am using For all entries  to combine two tables.
    I want to fetch the data from these tables.
    The field in one table char, and in another the field is numc.
    1st Query from table BDCP2  and get the tabkey value is like (2000000000000000000086200000000000000000000)
    2nd query     For all entries found,
    query table ESTMJ with the following parameter.
         ESTMJ-RECN = BDCP2-TABKEY+3(20)
    1.TABKEY         CHAR     254
    2.RECN         NUMC     20     
    How to compare these two ?
    Regards,
    Bindhu Priya.

    for  two fields numc & char , please check out their Conversion routine in their respective Database table.
    1st in SE11-> enter table names in different sessions. and check out the data domain used by this fields
    In their respective domains of fields, click on tab 'DEFINITIONS', then check out the conversion routines in Output Characteristics of the Data Domain of field
    From my point of view, both the Conversion routines should be the same.
    If Conversion Routines are not there, then insert suitable Conversion routine for both the fields domain
    For help for for conversion routines:
    conversion routine
    http://help.sap.com/saphelp_46c/helpdata/en/cf/21ee19446011d189700000e8322d00/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/35/26b217afab52b9e10000009b38f974/content.htm
    http://abaplovers.blogspot.com/2008/03/conversion-routines-in-sap.html
    hope this solution could solve your issue..
    <begging removed by moderator>
    Gaur Mayank
    Edited by: Gaur Mayank on Nov 5, 2011 10:40 AM
    Edited by: Thomas Zloch on Nov 6, 2011 3:59 PM

  • How to show current currency rates in a query?

    Hello!
    I want to get a query like this:
    Input fields:
    - Currency (e.g. USD)
    - Period (e.g. 001.2008 - 003.2008)
    Output table:
    RUB-------EUR
    Jan 2008---24.2--
    0.8
    Feb 2008--23.5--
    0.9
    Mar 2008--25.6--
    0.7
    I use 0CURRENCY and 0FISCPER charasteritics to form this table, but what key figures should I use to get this vlaues?

    Is this query needed for end users ?
    if not, just go into your SPRO, and check the Currency conversion rates.
    If yes, maybe you should create an ODS feeded by TCURR and relative tables.

  • How to incorporate a Document(link) for a query for documentation purposes

    Hello Everybody,
    we have on our project very complex queries, where the Queries need to be explained to the user, especially what it means when (s)he enters certain values in the popup and what then the rows and columns of the query then actually state.
    So we would like to have one link, preferably in the generic navigation block of the BEx and the Web. The user should be able to click on the link or icon and so the prepared documentation (pdf, doc or any other file type) opens. The documents could be linked by an administrator in the backend.
    We do not want to have that little paper icon in every cell of the query.
    We explored the functionality in RSA1/Documents, but are not satisfied with the options.
    Does anyone have an idea how to implement such a functionality?
    kind regards
    Marko

    Hi,
    1) create a word document choosing the tecnical name of the query as filename
    2) upload the document in rsa1
    3) in the web template use a javascript to create the link with the technical name of the query and writw the link to the page
    regards,
    Michael

Maybe you are looking for

  • Restoring from iPhone 5 to iPhone 6 Plus issue

    Yesterday, I received my iPhone 6 Plus in the mail via AT&T.  Before I started with the new phone, I checked my current phone, iPhone 5, and it showed a iCloud backup from earlier that day. I chose to use iTunes to backup my iPhone 5 and selected the

  • Can't change RUS in interop environment Exchange 2003/Exchange 2010

    Hello! We have interop environment with Exchange 2003 and Exchange 2010 Servers. We have many Exchange 2010 servers, and not so many days ago had a lot of exchange 2003 servers. So we moved all mailboxes from Exchange 2003 servers and started to remo

  • How do I renew my IP address?

    I want to update/change my IP address. How can I?

  • Update Query For Hierarchy Table

    Hi All I have a Hierarchy table that has news categories. I want use a query than when user deactivate a category, all child category has been deactivated. For example 1- Politics 1-1- National Politics 1-2- International Politics 1-2-1- Asia 1-2-2-

  • Updating JTable From Database

    Hi, I am new to Swing and I was wondering if anyone could help me with the following problem. I have a tablemodel which extends AbstractTableModel which is used to create my JTable. The data to display in the table is got from a SELECT statement from