Attach a transaction code to abap query program

Hi!
I have developed a report with ABAP query in development server with transaction codes SQ01, SQ02 AND SQ03 respectively.
program is generated from SQ01 and i also got the program name from SQ01.
Now how to attach a transaction code with the program that is generated from ABAP query and transport it to production server
successfully.
points to be rewarded .
regards
Amit

hiiii
go to
sq02 ->
Select Environment -> Query Areas..
Select Standard Area (Client specific)
(If Query does not exist in Standard Area then You will have to copy that Query From Global Area to Standard Area.)
For Coping Query From Global To standard first select that query from list.
Now select Environment-> Transports
In next screen select Copy Global to standard radio button.
Check Overwriting allowed (only with import/upload/copy)
Remove Check for Test Run
Select Transport InfoSets and queries radio button
Fill Infoset and Query with corresponding names.
Now Press Execute button.Copy Log will be displayed.
Now Query exist in Global & Standard Area.
Go to SQ02 .
Select Environment -> Query Areas..
Select Standard Area (Client specific)
Select Infoset from list.
Select Download radio button
Check Overwriting allowed (only with import/upload/copy)
Remove Check for Test Run
Select Transport InfoSets and queries radio button
Click on Execute button
same way you can upload sap query..from one system to another
regards
twinkal
Fill Infoset and Query with corresponding names.

Similar Messages

  • ABAP QUERY PROGRAM OUTPUT SHOULD DISPLAY FROM SAP SCRIPT.

    THIS IS MY URGENT REQUIREMENT ...
    I DONT KNOW ABAP QUERY PROGRAM ..
    PLEASE SUGGEST ME A WAY ON THIS ....
    Functional requirements
    Introduction
    The wish of the customer is a printable customer overview. All desired fields will be shown in a new query called ZZADDRSS_CO. Double entries are taken for granted because of the data taken from the sales area and because of multiple contact persons. The customer accepts this. It should be made possible that the user creates and saves its own variant.
    A second overview is needed, another ABAP will be developed for this requirement. This ABAP will show all the customer data and this list will have the possibility to be printed.
    Solution
    New Query ZZADDRESS_CO
    The desired fields of attachment 1 need to be shown in the query.
    The selection criteria are shown in attachment 2.
    The column names of the additional data have to changed in the query.
    Customer Overview.
    Functional specification.
    On behalf of this customer overview a standard SAP transaction will be used (transaction VC/2).This transaction will be extended.
    The fields are shown on screen with the described headers. Printing of the overview will be done via SAP script. The script makes use of a fixed layout of the data.
    The selection criteria are specified in attachment 2.
    The layout of the customer overview and the SAP Script are specified in attachment 3.
    Specification.
    The next steps need to be performed.
    1.     A routine per infoblock need to be created in Include RV77UNNN. In this routine the data is retrieved and written down to the screen and script,
    Example LST1_901 . In include RV77SNNN you can find the standard infoblocks.
    2.     Adapt via transaction SE16 table TFRM.
    3.     Create a new view in the customizing (sales and distribution- Sales support-sales summary-Assign Reporting Views).Assign the new view to the infoblocks.(Example view 001 is assigned to block 901).
    4.     In customizing it is not possible to assign the correct window and element to the infoblock .so this is done via SE16 in table T182A.
    5.     Adapt script. Copy script SD-SALES-SUMMARY to a Z-SALES_SUMM.
    Assign this new version to the new view in customizing. Create in the main window the element who writes the data on behalf of the print.
    Attachment 1 Desired fields
    Header: Address
    ~ Customer number                          KNA1-KUNNR
    ~ Title                                               KAN1-ANRED
    ~ Name1                                           ADRC-NAME1
    ~ Name2                        ADRC-NAME2
    ~ Name3                                           ADRC-NAME3
    ~ Name4                                           ADRC-NAME4
    ~ PO Box                                         ADRC-PO_BOX
    ~ PO Box POSTAL CODE             ADRC-POST_CODE2
    ~ PO Box city                                  ADRC-PO_BOX_LOC
    ~ Telephone no1                              ADR2-TEL_NUMBER   1ST RECORD
    ~ Telephone no2                              ADR2-TEL_NUMBER   2ND RECORD
    ~ Fax number1                                 ADR3-FAX_NUMBER 1ST RECORD
    ~ Fax number2                                ADR3-FAX_NUMBER 2ND RECORD
    ~ E-mail                                            ADR6-SMTP_ADDR
    ~ Search item                                   ADRC-SORT1
    ~ Notes                                            ADRT-REMARK
    Header: control data
    ~ VAT registration number              KAN1-STCEG
    Header: Payment transactions
    ~Bank country key                         KNBK-BANKS
    ~Bank key                                      KNBK-BANKL
    ~Bank Account number                 KNBK-BANKN
    Header: Marketing
    ~ Industry key                                   KNA1-BRSCH
    ~ Industry code 1                              KNA1-BRAN1
    ~ Industry code 2                              KNA1-BRAN2
    ~ Industry code 3                                KNA1-BRAN3
    ~ Industry code 4                                KNA1-BRAN4
    ~ Industry code 5                               KNA1-BRAN5
    ~Annual sales, currency, year           KNA1-UMSA1, KNA1-UWAER, KNA1-UMAH
    ~ Yearly no of employees, year      KAN1-JMZAH, KNA1-JMJAH       
    ~ Fiscal year variant                          KNA1-PERIV
    ~Legal status                                      KNA1-GFORM
    Header: Correspondence
    ~ Our account number at customer            KNB1-EIKTO
    Header: sales
    ~ Sales office                                              KNVV-VKBUR
    ~ Customer group                                       KNVV-KDGRP
    ~ ABC-classification                                  KNVV-KLABC
    Header: Invoice
    ~Tax classification                          KNVI-TAXKD
    ~Terms of payment key                    KNVV-ZTERM
    ~
    Header: Contact Persons
    ~Title                                   KNVK-ANRED
    ~Name                                   KNVK-NAME1
    ~Advertising material                         KNVK-NMAIL
    ~Martial Status                         KNVK-FAMST
    ~Notes                                   KNVK-PARAU
    ~Function                              KNVK-PAFKT
    ~Department                              KNVK-ABTNR
    Header: Partnerroles
    ~Personnel Number                         KNVP-PERNR
    ~Name of employee                         PA0001-ENAME
    Header: Additional Data
    ~Attribute 1                              KNA1-KATR1
    ~Creation date                              KNA1-ERDAT
    ~Attribute 2                              KNA1-KATR2
    ~Change date of field KNA1-KATR2          CDHDR-UDATE
    ~Attribute 3                              KNA1-KATR3
    ~Attribute 4                              KNA1-KATR4          
    ~Attribute 5                              KNA1-KATR5
    ~Attribute 6                              KNA1-KATR6
    Attachment 2 Selection fields
    ~Customer number
    ~Sales office
    ~Personnel Number
    ~Sales Organization (default NL01)
    ~Industry key
    ~Industry codes (1 till 5)
    ~ABC- classification
    ~Creation date
    ~Attribute 1
    ~Attribute 2
    ~Attribute 3
    ~Attribute 4
    ~Attribute 5
    Attachment 3 Customer overview + SAP Script
    Customer master data sheet: 11490                 Page1
    Requested by karen Dunnewold                Date: 25.08.2004
    Address
    (Default SAP script ADDRESS statement)
    Title
    Name1
    Street + number
    PO Box city
    Country
    Search term: ADRC-SORT1
    Telephone 1:      ADR2-TEL_NUMBER     2: ADR2-TEL_NUMBER
    Fax 1:          ADR3-FAX_NUMBER     2: ADR3-FAX_NUMBER
    E-mail:          ADR6-SMTP_ADDR     
    Notes:           ADRT-REMARK
    PO BOX
    ADRC-PO_BOX
    ADRC-POST_CODE2 ADRC-PO_BOX_LOC
    T005T-LANDX (T005T-LAND1 = ADRC-COUNTRY)
    Control data
    VAT registration number:     KNA1-STCEG
    Payment transactions
    Country: KNBK-BANKS Bank-key: KNBK u2013 BANKL Bank account: KNBK-BANKN
    Marketing
    Industry           KNA1-BRSCH     Industry Description
    Industry code1          KNA1-BRAN1     Industry Description
    Industry code2          KNA1-BRAN2     Industry Description
    Industry code3          KNA1-BRAN3     Industry Description
    Industry code4          KNA1-BRAN4     Industry Description
    Industry code5          KNA1-BRAN5     Industry Description
    Figures
    Annual Sales          KNA1-UMSA1, KNA1-UWAER in KNA1-UMAH
    Employees          KNA1-JMZAH                         in KNA1-JMJAH
    Legal status            KNA1-GFORM description
    Customer master data sheet 11490                         Page 2
    Requested by karen Dunnewold                         Date: 25.08.2004
    Contact Persons
    KNVK-ANRED
    Mailings: KNVK-NMAIL           Notes: KNVK-PARAU
    KNVK-ANRED
    Mailings: KNVK-NMAIL           Notes: KNVK-PARAU
    Correspondence
    Our account number at customer      KNB1-EIKTO
    Sales
    Sales office          KNVV-VKBUR     Description
    Customer group     KNVV-KDGRP     Description
    ABC-classify          KNVV-KLABC
    Currency          KNVV-WAERS
    Invoice
    Terms of payment key KNVV-ZTERM      Tax classification KNV1-TAXKD
                                  Description     
    Partner (Leave SAP default)
    Partnerrole               Number          Name
    KNVP-PARVW          KNVP-KUNNR     NAME1
    KNVP-PARVW          KNVP-KUNNR     NAME1
    Additional data
    Attribute1          kna1-katr1     Description
    Attribute2          kna1-katr2     Description
    Attribute3          kna1-katr3     Description
    Attribute4          kna1-katr4     Description
    Attribute5          kna1-katr5     Description
    Attribute6          kna1-katr6     Description

    hi narayana
    i think u need to write a driving program and a provided with a smatform u sit along with the SD consultant.
    ur further views can be shared.
    Rgs,
    Venkat.

  • Calling a transaction code in between the program and use the output

    Hi frnds,
              i want to call a transaction code in between the program   and pass the input .After getting the output, use that output in the program

    Hi Navin,
                     Why don't you sit with ABAPer he can explain better.
    Regards,
    HAri.

  • Transaction code for SAP query reports

    Hi All,
    I am trying to create transaction code for sap query report but couldn't go further.
    1) Created User group in SQ03
    2) Created infoset in SQ03 and assigned that to the user group
    3) Created query in SQ01 using the infoset.
    I executed the report in SQ01 and it is working fine.
    Now I try to create a transaction code in SE93 using the steps mentioned in the following link:
    Assign transaction code to SAP Query (created via SQ01)
    But when try to execute the report using the transaction code, it is giving error message 'User group xxxxxx is not yet created'
    Could any one advice me if I miss something? Or please help me to create this transaction code and transport to production?
    Thanks in advance

    HI,
    based on the thread you've already mentioned:
    In SE93, Create a Paramter Transaction
    -> Transaction = Start_report
    -> In default values, give the below details:
    D_SREPOVARI-REPORTTYPE = AQ
    D_SREPOVARI-EXTDREPORT = Name of the Query
    D_SREPOVARI-REPORT = User Group
    So check if the user group is typed correct in SE93 and check also if the user group exits in the system where you are trying to run the transaction.
    best regards, Christian

  • How to create Transaction code for ABAP and execution by other user

    Hi All,
    Could someone please let me know how to create transaction code in detail for ABAP program. Step by step procedure expected. I would like to know how other user can execute the report using same transaction code which I have created.
    More about authorization.
    Thanks in advance.

    Hello,
    You can create transaction code from se80 as well.In object navigator,right click on your program name and create->transaction code.You can create transaction and select if it is only a report,a report with selection-screen depending on your requirement.You can run your report directly by entering the transaction code in the command field.
    You can authorise the users who can use your transaction:
    <b>Authorisation objects</b> are used to restrict certain transactions to users.Critical data must be protected from unauthorised users.For example,the head has access to certain data.But it cannot be accessed by his subordinate.For this we need to define <b>roles</b>.
    •Create an authorization object with transaction SU21.
    An object usually consists of the ACTVT (activity) field and one other field,which specifies the data type to be protected.By ACTVT, we can decide if the data is accessible for change,display only etc.
    •Add authorization fields to the authorization object created.
    •Assign the authorization object to the transaction using SE93.
    Attach the authorization object to the role using transaction PFCG.
    If you want <b>to assign roles</b>,use transaction PFCG.Create a new role.In the AUTHORIZATIONS tab,you can get a self generated profile name and a profile text by clicking on the icon next to it.Then go to the "Change Authorization data" and choose an authorization template.Then you can choose to display/change/create an activity and after the selection,click on the red and white circle.The profile will now be created.
    In the user tab,you can give the user details who can use this role.
    <b>Also check this link:</b>
    http://www.*********************/r3_security/r3_security_tips.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/52/6716a6439b11d1896f0000e8322d00/content.htm
    <b>Very helpful guide:</b>
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a92195a9-0b01-0010-909c-f330ea4a585c
    Regards,
    Beejal
    **Reward if answer is helpful

  • Creating t.code for ABAP query and Transport  it TO Production and run it .

    Hi Friends
    Thanks for ur reply ,
    The requirement is that i want to create tcode for abap query and that query can be regenearted ,
    in case of regeneration programe name i got answer programame name will be change, i created and modified query but i saw the same programe name ,,, may be it changed when it is trasnported if so then what ??
    and also pls give me solution for asiging tcode for query which is going to be regenerated.
    thanks and regards
    farukh

    Dear Farukh,
    As we know,
    Query is created in Production server and a corresponding program is generated by System.
    What we have to do is just to assign the program to the desired transaction code in Development server and transport it.
    If you have any doubts please let me know.
    Kindly assign points if you find this info usefull.
    Regards,
    Lijo Joseph

  • How to add the fields to the transaction 'Z10SD25' using ABAP Query

    Hello,
    I want to add the new fields like 'From' and 'To' depending on some conditiions. But i have to do this using ABAP Query.
    Can any one help me with this as I am not much aware of ABAP Query .
    Regards,
    Darshana

    Hi,
    ABAP/4 query can be designed in four steps
    1.     Creation of a user group
    2.     Creation of Infoset
    3.     Assignment of user group to Infoset
    4.     Creation of the query based on Infoset
    By executing the transaction codes mentioned below
    u2022     SQ01   ABAP/4 Query
    u2022     SQ02   Infosets
    u2022     SQ03   User group
    Step 1: To create an Infoset without a logical database
    One of the following can be selected
    u2022     Based on a single table
    u2022     Using an ABAP/4 program
    u2022     Using Table Joins
    u2022     Using Sequential Dataset
    NOTE: The tables to be used in the join should have at least one field in common i.e. it should have the same name, domain or data element.
    Step 2: Here you specify the users who should be authorized to run the query. A user group is always associated with a Infoset.
    Step 3: In Query Definition you can define the Selections Screen. Here you can check against the fields(fields from the tables specified in the infoset above) that you require to be shown on the selection screen.
    Now we Finally need to specify the output type for the query as Basic List, Statistics or Ranked List. Choose the option Basic List and also select the fields to be displayed in the output list(in your case from and to fields...)
    After providing all the above options you can save the query and execute it by clicking the Execute button twice.
    Hope this helps
    Regards
    Shiva
    Edited by: Shiva Kumar Tirumalasetty on Sep 15, 2009 12:44 PM

  • Creting t.code for ABAP query and Transport  it TO Production and run it .

    Hi Friends
    Thanks for ur reply ,
    The requirement is that i want to create tcode for abap query and that query can be regenearted ,
    in case of regeneration programe name i got answer programame name will be change, i created and modified query but i saw the same programe name ,,, may be it changed when it is trasnported if so then what ??
    and also pls give me solution for asiging tcode for query which is going to be regenerated.
    thanks and regards
    farukh

    Hi farukh,
    1. If any query is re-generatred,
       then some MANUAL INTERVENTION
       is absolutely required.
    2. Hence, what we prefer is this :
       1. Generate first query.
       2. Copy the code to a Z Program
       3. Attach tcode to THIS z program.
       4. Transport
    3. Now,
      whener the query is generated again,
       AGAIN COPY THE CODE
      TO OUR Z PROGRAM (2ND STEP ABOVE)
                        (which has already been created)
      AND TRANSPORT JUST THIS Z PROGRAM.
      REST WILL TAKE CARE OF ITSELF.
    4. In such cases,
      ONLY COPY-PASTE IS REQUIRED.
      (and it takes not more than 15 SECONDS)
    regards,
    amit m.

  • Transaction Code assignment for Query created in SQVI

    Dear All,
    Good morning I hope you are doing great...
    Can any body help me out to assign transaction code for Query which was created through SQVI transaction.
    Regards,
    Murali.

    Hi Murali Mohan
    1>go to SQVI t code and  enter your query name and press enter
    2>In the menu path select Quick view--> additional functions-->Generate Program
    3>After Generating the program In the menu path select Quick view--> additional functions-->Display report Name
    4>Now in se38 enter the report name in Program field and execute
    5>You will get the Initial Selection screen of the report . Go to Menu of System -->Status
    6> Note down the Program name and Screen number
    7>Go to SE93 and Create a Z tcode for the query, Enter the description  and importantly you have to select the 2nd Option radio Button Program and Selection Screen (Report Transaction) and Press enter
    8>In the next screen enter the Report name In Program field and enter the screen number
    9>In the classification Section select Professional user  Transaction
    10>In GUI support section select all the options  i.e SAPGUI for HTML,Java,Windows
    and save
    the system will ask for Package select your package if not there then select local object
    now execute the Z tcode your report will run sucessfully
    Regards
    Vijay hebbal

  • Performance of ABAP query program

    Hi All,
    A custom program AQNWZ_TALAT=====TCS_AP_ITEMS== is taking lot of time running. And when checked the cost of the select statement is very high.
    I guessed it must be some custom abap query. Correct me if I am wrong.
    Also please let me know how to do the performance tuning on this code? Should I be editing the program directly or should I edit at the abap query level.
    Regards,
    Pooja
    Moderator message: Please Read before Posting in the Performance and Tuning Forum
    Edited by: Thomas Zloch on Dec 3, 2010 11:01 AM

    >A few tips you can use for finetuning a Report
    The actually a good collection of the most important pain points. But the recommendations are unfortunately quite poor, and even wrong. I have updated them a little bit.
    And for German speaking people I have added a reference to a textbook, where arll my recommendations are explained in detail.
    Siegfried
    1) Use mostly primary key to access data.
    ... nonsense, the task determines the WHERE clause, it is not your choice
    2) Before READ u sort the itab
    No
    3) use mostly the indexes fields in ur where clause.
    ... as 1, it is the other way, the task determines the WHERE-clause, make surwe that there is an index which
    supports it
    4) Restrict the the fields retrieved by your select sentences to the minimal set. (Avoid select *)
    nonsense, most SELECT use and must use *, use field list in wide tables
    5) try to use specify where clause so the abap sql optimizer chooses the right index.
    o.k., but who understands that in depth?
    6) Avoid sentences like select lifnr name1 into corresponding fields of lfa1 from lfa1 where....
    feel free to use if required
    (You should declare a working area and select into the working area, is twice faster)
    ... such general statements are always incorrect
    7) use hashed tables instead of standard tables. They are faster
    no, use sorted tables, hashed are very special and can only be used if there is a unique key
    8) avoid the use of collect as much as you can.
    total nonsense, use collect with hashed tables, works perfect, if you use it with standard tables, do not mix it with other statements
    1 Always check the driver internal tables is not empty , while using FOR ALL ENTRIES
    100% correct
    2 Avoid for all entries in JOINS
    ... not generally true
    3 Try to avoid joins and use FOR ALL ENTRIES.
    ... hmmm, there are pages of discussions, this statement was wrong, is wrong and will be wrong!!!
    4 Try to restrict the joins to 1 level only ie only for 2 tables
    nonsense, joins are complicated, you must know hw indexes are used, if everything is fine, then 10 or 20 tables can be joined
    5 Avoid using Select *.
    see 4)
    6 Avoid having multiple Selects from the same table in the same object.
    ... try to avoid to SELECT the same data, different criteria can be necessary
    7 Try to minimize the number of variables to save memory.
    ... obvious,
    8 The sequence of fields in 'where clause' must be as per primary/secondary index ( if any)
    ... no is must not the optimizer will not be influenced be the order , but do it, it increases readability
    9 Avoid creation of index as far as possible
    ... no, o.k. if you are not experienced than avoid ... otherwise the creation of the required indexes is absolutely mandatory for new tables, for SAP standard tables most indexes are already there. But still if very new accesses are added, then new indexes can become necessary.
    10 Avoid operators like , > , < & like % in where clause conditions
    ... no, you must add them, but be aware that the search is only poorly supported by them, but the result set is reduced.
    11 Avoid select/select single statements in loops.
    ... if they are going to the database! If the tables are buffered, then these statements are perfect!
    12 Try to use 'binary search' in READ internal table. Ensure table is sorted before using BINARY SEARCH.
    .... Actually try to avoid standard tables, use sorted tables instead. If you must use a standard table, than the recommendation is true.
    13 Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,)
    .... no, use them if required. Again, if table is buffered, then they MUST be avoided.
    14 Avoid using ORDER BY in selects
    ... if it is not ORDER BY PRIMARY KEY. Again, if the table is buffered, then other orders MUST be avoided.
    15 Avoid Nested Selects
    ... use join. Again, if the tables are buffered, then Nested SELECTs are fine!
    16 Avoid Nested Loops of Internal Tables
    .... impossible, there is no other option. Use sorted tables and verything is fine!
    17 Try to use FIELD SYMBOLS.
    ... what means try? Use ASSIGNING fieldsymbol in LOOPs, but use it in READs only for very wide tables (>1kB). Use it always for tables with tables in the workarea!
    18 Try to avoid into Corresponding Fields of
    ... see 6) is wrong!
    19 Avoid using Select Distinct, Use DELETE ADJACENT.
    .... no, use it if required and if it can reduce the result set by a factor of 2 or more. Again, if table is buffered, then it MUST be avoided.
    Wenn Sie mit der Performance Ihres ABAP Programms nicht zufrieden sind, werfen Sie doch einen Blick in mein neues Buch:
    Siegfried Boes: Performance-Optimierung von ABAP®-Programmen Nov. 2009 464 Seiten  59u20AC
    Leseproben und weitere Informationen: http://www.dpunkt.de/buecher/3096.html
    Edited by: Thomas Zloch on Dec 3, 2010 10:53 AM

  • Transaction code thro' SAP Query for customer spefific report

    hi experts,
    how to create transaction code (using SE43-) for the sap query created on own??
    I have created the following required for a customer specific report
    1.Infoset thro sq02
    2.user group thro sq03 and assigned it to infoset
    3.query thro sq01 and saved it with text
    earlier i have used logical database PNPCE ( relevant for PA and payroll modules reports)
    using sq01 , go to basic list , selected required infotypes and fields and
    then selected, SAP List viewer for viewing and i get the report.
    Now my question is how to create a separate transaction code for this sap query which i created
    should i use SE43( area menu maintenance and area class???_)
    should i create a variant and go to SE43??
    advice solicited
    snr

    Hello
    when you excecute the query in right han side corner  you can get the program name
    go to se80 select program & type this name and then you can create a tcode for that prog in SE80
    reward points if helpful.
    the prog name will be something like : AQZZ/SAPQUERY/* " ur query name
    you can search for the name also in this manner

  • Select from KONV using Additional Code in ABAP Query

    I'm attempting to modify an ABAP Query Infoset (using transaction SQ02) that already has a join in it between tables VBAP and VBAK, and two additional alias tables on KONV (to get price history for sales documents).  I wish to get history of all PN00 records from KONV.  I can get ONE record with the following code in the Record Processing of the Extras element in my Infoset:
    SELECT SINGLE KBETR KPEIN KMEIN KDATU
    INTO (PN00_PRICE, PN00_PER, PN00_UOM, PN00_DATE) FROM KONV
      WHERE KNUMV  = VBAK-KNUMV
      AND KPOSN  = VBAP-POSNR
      AND STUNR = 198
      AND ZAEHK = 01.
    But we have many counters (field ZAEHK) for the PN00 condition and I want to have a new row for each PN00 record in KONV.  I've tried some loop syntax, but I've not been able to get any code to function or return more than one row for each sales order item row (VBAP-POSNR).
    Thanks for any hints.
    Dan Gallagher

    Change it like this
    SELECT KBETR KPEIN KMEIN KDATU
      INTO (PN00_PRICE, PN00_PER, PN00_UOM, PN00_DATE)
      FROM KONV
    WHERE KNUMV = VBAK-KNUMV
       AND KPOSN = VBAP-POSNR
       AND STUNR = 198.
    ..... do something with this record and store
    ENDSELECT.

  • Adding code in ABAP Query(ABAP HR)

    I have created an ABAP Query for getting the Absence details of employee within a specified period.I am populating the fields
    Employee number, Organization Unit,Absence start date,Absence hours, Absence enddate.
    If an employee is in leave for 10 days, this information will be stored in PA2001 table,and this table is not Organization specific.
    During the specified period(20 days), if an employee is under two Organization units(5 days in 1st Org Unit,15 days in 2nd Org Unit). The query is extracting two records for the same employee, because of two Organization units. And while populating the data, the query is getting the Absence information from PA2001 table, and this is causing overlapping of data. So it is showing the Absence details for that employee as 40 days(20 days in 1st Org Unit and 20 days in 2nd Org Unit,Instead of total 20 days). So i would like to add validation over here after extraction of data from the PA2001 table,before displaying the data.
    I have tried adding the code in the infoset, at END OF SELECTION Event,but i am not able to change the list, as i am not able to access the tables used by the Query.
    Can anybody suggest me where to add the code in the Query, so that i will be able to solve this issue, instead of changing the code in the Report program generated by the Query.

    you can look at BAPI_PTIMEOVERVIEW_GET
    this gives the output back for the selected period so you don't get alle the records back from you're pa2001 table. (only this overview doesn't take into considerationd the distiction the difference between leave and illness)
    further on if you consider using the pa2001 table you can loop through the begda and endda and add 1 day for each record and programm the logic how you want to intrepet each day you'reself
    I use the data from perws which comes from the function HR_PERSONAL_WORK_SCHEDULE
    (which is also used in the BAPI mentioned above)
    and from PA0001 you can retrieve how long somebody was in 1 org unit !!
      LOOP AT it_2001 WHERE begda BETWEEN i_begda AND i_endda
                        OR endda BETWEEN i_begda AND i_endda.
          h_datum = it_2001-begda.
          IF it_2001-awart BETWEEN '0100' AND '0199'.
            WHILE h_datum <= it_2001-endda.
              READ TABLE it_perws WITH KEY datum = h_datum.
              IF sy-subrc = 0.
    * you're logic
              ENDIF.
              CALL FUNCTION 'FKK_DTE_ADD'
                EXPORTING
                  i_base_date               = h_datum
                 i_periode                 = 'D'
                 i_period_factor           = 1
    *       I_USE_FACCAL              = ' '
    *       I_WORKDAY_INDICATOR       = '-'
                IMPORTING
                  e_datum                   = h_datum
    *     EXCEPTIONS
    *       ERROR_OCCURED             = 1
    *       OTHERS                    = 2
              IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
              ENDIF.
            ENDWHILE.
    kind regards
    arthur de smidt
    Edited by: A. de Smidt on Jul 16, 2008 8:47 AM

  • Create transaction code for abap report

    Hello,
    don't know if this is the correct subforum (sorry in advance).
    I have created a ABAP Report in SE38 having a SELECTION-SCREEN.
    Now I would like to have a Transaction code to refer to the report. So that I can call the Transaction and then get the selection screen to use the abap report.
    How can I do this the simplest way? I can't find anything in google, can you give me some hints?

    hi
    goto se93
    give transaction code and click create
    select the second radio button(transaction code for reports)
    give short description and press enter
    after that give your program name
    and select the gui check boxes as required for html ,java,
    and save it
    you can use the transaction code
    REGARDS
    PRASANTH

  • Attaching a Transaction Code to Report Painter Report

    Hi All
    After creating a report painter report in GRR2 ... I tried to attach it to a transaction code in SE93...
    But am not able to do so?
    Is this possible and if so how is it done?
    Thank you
    Rukshana

    I assume that you were copying the report/program from one environment to the next? DEV->QA->PRD
    Using the Elias' example above, for program name, ensure that the last portion of it coincides with the environment in which you are executing the transaction code.
    GP4FGHMLN5Z2Q5MDAN2A89TGV1K010.
    Notice the '010'? Is that the client number for the environment in which you wish to run this program?
    If your PRD environment is for example, client 100, then you will need to change the t-code to point appropriately to the program for that client. In this case (using my example), the program name to be referenced by the t-code would be:
    GP4FGHMLN5Z2Q5MDAN2A89TGV1K100.
    Try that out. If all else fails, if you have access to t-code SE38, search for your program name (except for the last portion, etc.) with a wildcard (*). If you find the program, run it to make sure that this is what you were expecting. Now that you have the correct program name, use that in SE93 for your t-code.

Maybe you are looking for