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.

Similar Messages

  • Is it possible to can a program (report output) from SAP Script?

    Hi,
    From SAP Script I would like to call a report output (without displaying the selection screen).
    Is this possible. If so, how can I do this?
    Thanks.

    H i kumar g,
    why not?
    In script you can call external subroutine. You must define the subroutine in a program, there you can do a SUBMIT or whatever you want.
    See online docu for further explanation.
    Regards,
    Clemens

  • New_hier_root but generally it should display all SAP R/3 DataSoruces.

    Hai all,
    I newly install ECC 6.0 When i gave RSA5 it display's new_hier_root but generally it should display all SAP R/3 DataSoruces. What the problem. One of my f riend suggest that initially use RSA9 Tcode, it will  work . I gave RSA9 it ask create hiereachy i gave yes but i got error message no TR414. Can any one help please.
    Thanks & Regards
    Suresh

    Matias
    <<<< with front-end do you refer to SAP R/3 ?
    No Matias with Front-End I meant Third Party is providing the web-page where end-user can enter the details & those will be refined & corrected by the Third-Party Application.
    <<<<< Which ways has the Third-Party app to connect with (file, database, jms, etc.).
    Third-Party App is providing Java Classes & Web-Services for integration but we don't want to access them directly, first of all we would like to invoke/access the Front-end application.
    <<<< What is the purpose of this third-party app ? just to receive data, validate it and return it once it is corrected ?
    Actually in this Front-end user can enter the data on given fields & data will be keep on refining while he is entering the more information into that given field. For e.g if the field says "City" & user enters "DE", a drop-down will come with all the cities in the world starting with "DE" like Delhi, Denmark etc.Once all the fields are populated with correct data user will click on "Submit" button which will send the data to SAP R/3 ( which we wish to do ).
    Now in this case when user will click on Submit button ( means Third-party will initiate the process ) & data will be send to XI using ( for e.g ) HTTP sender then ABAPer's raised concern that how they will be able to show it in the right screen without using proper thread ID.
    Pls. let me know in case you require any further information. My problem is this how to relate the Third-Party data with correct screen of SAP.
    Thanks
    - lalit -

  • Save option enabling  in spool created from sap script.

    Hi,
    I got a requirement where in the output letter created using sap script, needs to be saved on local desktop. when the form is displayed from sp02 the save button is greyed out and also the path system->list->save option is also disabled.
    in foreground when we preview the form, there too the save options are not working.
    is there any option to enable the saving of form / letter on local machine.
    awaiting your response....
    thanxs

    Spool generated from SAPScript output can be converted to PDF on local/desktop using program RSTXPDFT4.
    -Alpesh

  • Subroutine call from SAP Script

    Hi,
    I need to calculate required/outstanding qty. hence am passing existing values of reservation#/item# and issued qty.
    both req/out qty are returned blank by the code. please help.
    Following is my code segment for a external routine call from SAP Script.
    /:   PERFORM P_GET_QTY IN PROGRAM ZTEST
    /:   USING &MSEG-RSNUM&                     
    /:   USING &MSEG-RSPOS&                     
    /:   CHANGING &REQ_QTY&                     
    /:   CHANGING &MSEG-MENGE&                  
    /:   CHANGING &OUT_QTY&                     
    /:   ENDPERFORM
    REPORT ztest .
    TABLES resb.
    DATA: wa_resb TYPE resb,
          req_qty TYPE resb-bdmng,
          isd_qty TYPE mseg-menge,
          out_qty TYPE resb-bdmng.
    FORM p_get_qty TABLES input  STRUCTURE itcsy
                          output STRUCTURE itcsy.
      DATA: avlbl TYPE resb-bdmng.
      READ TABLE input WITH KEY 'MSEG-RSNUM'.
      CHECK sy-subrc = 0.
      wa_resb-rsnum = input-value.
      READ TABLE input WITH KEY 'MSEG-RSPOS'.
      CHECK sy-subrc = 0.
      wa_resb-rspos = input-value.
      READ TABLE input WITH KEY 'REQ_QTY'.
      CHECK sy-subrc = 0.
      req_qty = input-value.
      READ TABLE input WITH KEY 'MSEG-MENGE'.
      CHECK sy-subrc = 0.
      isd_qty = input-value.
      SELECT SINGLE * INTO wa_resb
                      FROM resb
                      WHERE rsnum = wa_resb-rsnum
                      AND   rspos = wa_resb-rspos.
      CHECK sy-subrc = 0.
      avlbl   = wa_resb-bdmng - wa_resb-enmng.
      req_qty = avlbl - out_qty.
      out_qty = req_qty - isd_qty.
      output-name = 'REQ_QTY'.
      output-value = req_qty.
    MODIFY output TRANSPORTING name value WHERE name = 'REQ_QTY'.
      APPEND output.
      output-name = 'OUT_QTY'.
      output-value = out_qty.
    MODIFY output TRANSPORTING name value WHERE name = 'OUT_QTY'.
      APPEND output.
    ENDFORM.
    Thanks,
    Ram.

    Hi Ram,
    I think you have to use MODIFY instead of append for the OUTPUT table.
    MOdify the table with KEY. This should resolve the problem.
    Ram, you can check this code and see how the MODIFY is to be used.
    REPORT YLSD999A.
    DATA  W_LENGTH TYPE I.
    *   GENERAL PURPOSE SUBROUTINES FOR CALLING FROM SAPSCRIPTS
    FORM DISPLAY_POUND TABLES IN_TAB STRUCTURE ITCSY
                              OUT_TAB STRUCTURE ITCSY.
      DATA: COUNT TYPE P VALUE 16.
      DATA: W_VALUE(17) TYPE C.        "defined as 7 chars to remove pence
      DATA: W_CHAR TYPE C.
      DATA: W_DUMMY TYPE C.
      DATA: W_CURR(3) TYPE C.
    *    Get first  parameter in input table.
      READ TABLE IN_TAB INDEX 1.
      WRITE IN_TAB-VALUE TO W_VALUE .
    * get second parameter in input table
      READ TABLE IN_TAB INDEX 2.
      MOVE IN_TAB-VALUE TO W_CURR.
      IF W_CURR = 'GBP'.
        W_CURR = '£'.
      ENDIF.
      W_LENGTH = STRLEN( W_CURR ).
    *    look for first space starting at right.
      WHILE COUNT > -1.
        W_CHAR = W_VALUE+COUNT(1).
    *  W_CHAR = IN_TAB-VALUE+COUNT(1).
        IF W_CHAR = ' '.
          COUNT = COUNT - W_LENGTH + 1.
          W_VALUE+COUNT(W_LENGTH) = W_CURR.
          COUNT = -1.
        ELSE.
    *     W_VALUE+COUNT(1) = W_CHAR.
          COUNT = COUNT - 1.
        ENDIF.
      ENDWHILE.
    * read only parameter in output table
      READ TABLE OUT_TAB INDEX 1.
      OUT_TAB-VALUE = W_VALUE.
      MODIFY OUT_TAB INDEX SY-TABIX.
    ENDFORM.
    Cheers
    VJ

  • How to call a subroutine from sap script

    hi friends,
    Can anybody tell me How to call a subroutine from sap script .
    thanks n regards .
    Mahesh

    hi..
    Calling ABAP Subroutines: PERFORM 
    You can use the PERFORM command to call an ABAP subroutine (form) from any program, subject to the normal ABAP runtime authorization checking. You can use such calls to subroutines for carrying out calculations, for obtaining data from the database that is needed at display or print time, for formatting data, and so on.
    PERFORM commands, like all control commands, are executed when a document is formatted for display or printing. Communication between a subroutine that you call and the document is by way of symbols whose values are set in the subroutine.
    The system does not execute the PERFORM command within SAPscript replace modules, such as TEXT_SYMBOL_REPLACE or TEXT_INCLUDE_REPLACE. The replace modules can only replace symbol values or resolve include texts, but not interpret SAPscript control commands.
    Syntax in a form window:
    /: PERFORM <form> IN PROGRAM <prog>
    /: USING &INVAR1&
    /: USING &INVAR2&
    /: CHANGING &OUTVAR1&
    /: CHANGING &OUTVAR2&
    /: ENDPERFORM
    INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
    OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
    The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
    FORM <form> TABLES IN_TAB STRUCTURE ITCSY
    OUT_TAB STRUCTURE ITCSY.
    ENDFORM.
    The values of the SAPscript symbols passed with /: USING... are now stored in the internal table IN_TAB . Note that the system passes the values as character string to the subroutine, since the field Feld VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR 80). See the example below on how to access the variables.
    The internal table OUT_TAB contains names and values of the CHANGING parameters in the PERFORM statement. These parameters are local text symbols, that is, character fields. See the example below on how to return the variables within the subroutine.
    From within a SAPscript form, a subroutine GET_BARCODE in the ABAP program QCJPERFO is called. Then the simple barcode contained there (‘First page’, ‘Next page’, ‘Last page’) is printed as local variable symbol.
    Definition in the SAPscript form:
    /: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
    /: USING &PAGE&
    /: USING &NEXTPAGE&
    /: CHANGING &BARCODE&
    /: ENDPERFORM
    / &BARCODE&
    Coding of the calling ABAP program:
    REPORT QCJPERFO.
    FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
    OUT_PAR STRUCTURE ITCSY.
    DATA: PAGNUM LIKE SY-TABIX, "page number
    NEXTPAGE LIKE SY-TABIX. "number of next page
    READ TABLE IN_PAR WITH KEY ‘PAGE’.
    CHECK SY-SUBRC = 0.
    PAGNUM = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY ‘NEXTPAGE’.
    CHECK SY-SUBRC = 0.
    NEXTPAGE = IN_PAR-VALUE.
    READ TABLE OUT_PAR WITH KEY ‘BARCODE’.
    CHECK SY-SUBRC = 0.
    IF PAGNUM = 1.
    OUT_PAR-VALUE = ‘|’. "First page
    ELSE.
    OUT_PAR-VALUE = ‘||’. "Next page
    ENDIF.
    IF NEXTPAGE = 0.
    OUT_PAR-VALUE+2 = ‘L’. "Flag: last page
    ENDIF.
    MODIFY OUT_PAR INDEX SY-TABIX.
    ENDFORM.
    regards,
    veeresh

  • Driver program for the Dunning letter SAP Script

    Hello All,
    Can someone please tell me how to find the "Driver program for the Dunning letter SAP Script". I checked the Transaction OB96 but I dont find any Dunning scripts here i.e., the standard Dunning letter SAP Script F150_DUNN_01.
    Is there any Transaction like NACE of logistics for FI module to find the Driver programs. My requirement is to find the Driver program for the Dunning letter SAP Script and have a new Driver program instead of the standard SAP given driver program. Example is in transaction NACE we can change the driver program for Invoice like from RVADIN01 to ZRVADIN01.
    Thanks and Regards,
    SNK.

    Yes you can, using FIBF, change the FM associated with event 1720 like when SapScript is replaced with SmartForms. Look at [Define Dunning Forms (with SAP Smart Forms)|http://help.sap.com/saphelp_46c/helpdata/es/7d/c7a0a535e1d311ba4d0800060d888b/content.htm] for reference.
    But notice
    - PRINT_DUNNING_NOTICE call many FM of the same FG which share the same global data area.
    - During following upgrades of your system you will have to manage a copy of standard.
    Regards,
    Raymond

  • Covesion from sap scripts to smart forms

    hi everybody
    I want covert from sap scripts to smartform,There are already develoepd scipts in my development system.my requirement is to covert to smartfomr,how can we do that..
    Regards
    madhoo

    Hi,
    Goto SMARTFORMS and name your smartform. Dont press Create Button.
    Now follow the path. GOTO -> Migrate SAP Script form.
    You will get a pop-up window to enter the name of SAPscript from which you would like to migrate and choose language and then press enter.
    Also, have alook at the following link
    http://help.sap.com/saphelp_nw04/helpdata/en/9d/9599386185c064e10000009b38f8cf/frameset.htm
    The specified item was not found.
    Migrating SAPscript print program to Smartform
    Smartforms -> sapscript
    Re: Convert SapScript to Smartforms ?
    Hope this helps.
    Regards,
    Richa

  • Creating an RDI  file from SAP script

    Hello All,
    I would like to create an RDI file from SAP Script.
    Please can anyone let me know how do we do it programmatically.
    I am aware of the option of setting RDI parameter to 'X'.
    However my requirement is to allow user to have a print preview option and simulatenously create RDI file .
    Thanks and Regards
    Amruta

    See:
    http://discussions.apple.com/message.jspa?messageID=11535851#11535851

  • How to pass tables data from SAP script to the routine.

    Hi,
    I have standard program RPCTEAL0_01 which calls a SAP script form(Custom) to print the form.
    Now I have to add some additional functionality to change the values in the form. Since it is custom form I can add ROUTINE and then pass the values to the custom program to modify the variables.
    My concern here, I would like to pass the tables like RT,CRT to the custom program via form.
    Is this possible?  RT and CRT filled by standard progam.
    Regarsd
    Eswar
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Edited by: Alvaro Tejada Galindo on Jan 20, 2009 9:06 AM

    Hi, The suggested option is not working.
    Actually I am using the below code in SCRIPT
    /:   PERFORM CAL_2008 IN PROGRAM ZHR_TEST1
    /:   USING &PER_NO&
    /:   CHANGING &W12&
    /:   ENDPERFORM
    and calling form in ZHR_TEST1. But this will pass only variables. Now my requirement is to pass tables also.

  • PDF creator display bold output instead of defined mix from SAP Script

    Dear all,
    we've a little trouble with the pdf converter in SAP 4.6C.
    In the systeme there is a custom based soft font implemented (RSTXPDF2). The Forms work with SAPScript and use the global imported soft font , the direct printed output and local created pdf are fine.
    But when i try to use the archive for this documents the output use the right font, some characters are different so that i can see that the creator use the font.
    But the created and stored document in the archiv display all character in bold version, so that this isn't like the original.
    I try to use the testreport RSTXPDFT4 from sap to create a pdf download from spool, which was created witht the printer that create the paper output as well.
    The created pdf has the same problems, so that all is printed in a bold version of the style.
    The form has a headline in bold and after this there are some normal characters parts  and two parts with bold words.
    It's seems that the data in the output send all, but the converter can't interpret the bold end information as in the paper output.
    The target solution is to archive the pdf, but when the short spool isn't fine so i think that the archive printer isn't the problem. The printer was copied from the default, because the archivlink type can't use global softfonts.
    The fonts are activated in the se73 for the archive printer type and e. g. sapwin.
    Hint when i use the archive default which can't use softfonts the courier was used and the different areas will be display in bold and normal as defined.
    Every hint is welcome to find out why the convertor makes all in bold.
    Best regards
    Thorsten Stracke

    Dear all,
    we've a little trouble with the pdf converter in SAP 4.6C.
    In the systeme there is a custom based soft font implemented (RSTXPDF2). The Forms work with SAPScript and use the global imported soft font , the direct printed output and local created pdf are fine.
    But when i try to use the archive for this documents the output use the right font, some characters are different so that i can see that the creator use the font.
    But the created and stored document in the archiv display all character in bold version, so that this isn't like the original.
    I try to use the testreport RSTXPDFT4 from sap to create a pdf download from spool, which was created witht the printer that create the paper output as well.
    The created pdf has the same problems, so that all is printed in a bold version of the style.
    The form has a headline in bold and after this there are some normal characters parts  and two parts with bold words.
    It's seems that the data in the output send all, but the converter can't interpret the bold end information as in the paper output.
    The target solution is to archive the pdf, but when the short spool isn't fine so i think that the archive printer isn't the problem. The printer was copied from the default, because the archivlink type can't use global softfonts.
    The fonts are activated in the se73 for the archive printer type and e. g. sapwin.
    Hint when i use the archive default which can't use softfonts the courier was used and the different areas will be display in bold and normal as defined.
    Every hint is welcome to find out why the convertor makes all in bold.
    Best regards
    Thorsten Stracke

  • 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

  • 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.

  • ABAP Query Program name is !Q........

    Hi Friends,
    I have created ABAP Query and on executing its running fine and in status its showing the program name starting with !QTQO2C=========PRICING005====   instead of AQTQO2C=========PRICING005====  ...
    On checking the both in SE38 it says as not Exists. Please help me in this .
    Thanks
    Rajesh

    Hello Rajesh,
    When you create a query, SAP Creates a program internally. So it is that program name. You cannot see that program.
    Rgds,
    Rupali.

  • Extract program to extract data from SAP into multiple worksheets of excel

    Hi , I am currently facing an issue.
    Extracting the data during data extraction, conversion into an excel and also into multiple worksheets withing a excel file.
    What is the function which can help me. Also how do you give refernce to multiple worksheets to be created withing a excel file (which is the destination)
    Any sample program extracting data from SAP tables into a excel with multiple worksheet will be of immense help
    Please respond. Appreciate it.
    Rgds
    Madhu

    Hi Madhu,
    Here is the program for creating the excel file and creating the multiple worksheets.
    *& Report  ZEXCEL_UPLOAD2
    REPORT  ZEXCEL_UPLOAD2.
    INCLUDE ole2incl.
    DATA: application TYPE ole2_object,
           workbook TYPE ole2_object,
           sheet TYPE ole2_object,
           cells TYPE ole2_object.
    CONSTANTS: row_max TYPE i VALUE 256.
    DATA index TYPE i.
    DATA: BEGIN OF itab1 OCCURS 0, first_name(10), END OF itab1.
    DATA: BEGIN OF itab2 OCCURS 0, last_name(10), END OF itab2.
    DATA: BEGIN OF itab3 OCCURS 0, formula(50), END OF itab3.
    *START-OF-SELECTION
    START-OF-SELECTION.
      APPEND: 'Peter' TO itab1, 'Ivanov' TO itab2,
                                  '=Sheet1!A1 & " " & Sheet2!A1' TO itab3,
                'John' TO itab1, 'Smith' TO itab2,
                                  '=Sheet1!A2 & " " & Sheet2!A2' TO itab3.
      CREATE OBJECT application 'excel.application'.
      SET PROPERTY OF application 'visible' = 0.
      CALL METHOD OF application 'Workbooks' = workbook.
      CALL METHOD OF workbook 'Add'.
    Create first Excel Sheet
      CALL METHOD OF application 'Worksheets' = sheet
                                   EXPORTING #1 = 1.
      CALL METHOD OF sheet 'Activate'.
      SET PROPERTY OF sheet 'Name' = 'Sheet1'.
      LOOP AT itab1.
        index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
        CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
        SET PROPERTY OF cells 'Value' = itab1-first_name.
      ENDLOOP.
    Create second Excel sheet
      CALL METHOD OF application 'Worksheets' = sheet
                                   EXPORTING #1 = 2.
      SET PROPERTY OF sheet 'Name' = 'Sheet2'.
      CALL METHOD OF sheet 'Activate'.
      LOOP AT itab2.
        index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
        CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
        SET PROPERTY OF cells 'Value' = itab2-last_name.
      ENDLOOP.
    Create third Excel sheet
      CALL METHOD OF application 'Worksheets' = sheet
                                   EXPORTING #1 = 3.
      SET PROPERTY OF sheet 'Name' = 'Sheet3'.
      CALL METHOD OF sheet 'Activate'.
      LOOP AT itab3.
        index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
        CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
        SET PROPERTY OF cells 'Formula' = itab3-formula.
        SET PROPERTY OF cells 'Value' = itab3-formula.
      ENDLOOP.
    Save excel speadsheet to particular filename
      CALL METHOD OF sheet 'SaveAs'
                      EXPORTING #1 = 'c:\temp\exceldoc1.xls'     "filename
                                #2 = 1.                          "fileFormat
    Closes excel window, data is lost if not saved
    SET PROPERTY OF application 'visible' = 0.
    **Quick guide to some of the OLE statements for OLE processing in this program as well as a few other ones.
    Save Excel speadsheet to particular filename
    CALL METHOD OF sheet 'SaveAs'
                    EXPORTING #1 = 'C:\Users\dprasad\Desktop\excel_sheet.xls'     "filename
                              #2 = 1.                          "fileFormat
    Save Excel document
    CALL METHOD OF sheet 'SAVE'.
    Quits out of Excel document
    CALL METHOD OF sheet 'QUIT'.
    Closes visible Excel window, data is lost if not saved
    SET PROPERTY OF application 'visible' = 0.

Maybe you are looking for

  • PDFX1a 2001  - WebNative has detected message appears?

    From within indesign CS5 I have to export HIRES pdf files using the above settings. But when I go to export the pdf I have a message appear 'WebNative has detected that the Exported PDF not work with the PDF imaged Replacement worflow. Compatibility

  • Animation problem

    For some reason my animations started acting up, every time I Ctrl+V'd it pasted it over all layers,unlike before and It will not show the change in images if I hide some until I move the image in the layer , how do I fix it?

  • Partner bank type

    Hi, Vendor 1000000 under company code 1000 has 4 bank accounts  Each (USD, GBP, SGD, EUR) is identified by BnkT (Partner Bank Type) field in vendor master. When we performed F110 payment, system automatically picks the first bank account in the vendo

  • Get the csv output

    I need to make a script that pulls the server uptime information and saves the results into csv format. I am able to create a csv file, however the values are not coming in the different columns.. The data is getting saved only in one column. $Output

  • Can anyone explain data usage for streaming music like Pandora

    Can anyone explain data usage for streaming music like Pandora