SAP Query, SAP Script

please give the step by step details . SAP Script and SAP Query .

Hi Krishna,
<b>SAP query</b>
http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp
https://www.sdn.sap.com/irj/sdn/advancedsearch?query=how%20to%20create%20sap%20query&cat=sdn_all
<b>SAP Scripts</b>
http://www.sap-img.com/sapscripts.htm
http://sappoint.com/abap/
http://www.henrikfrank.dk/abapexamples/SapScript/sapscript.htm
http://help.sap.com/saphelp_crm40/helpdata/en/16/c832857cc111d686e0000086568e5f/content.htm
http://www.sap-basis-abap.com/sapabap01.htm
http://www.sap-img.com/sapscripts.htm
http://searchsap.techtarget.com/tip/1,289483,sid21_gci943419,00.html
http://sap.ittoolbox.com/topics/t.asp?t=303&p=452&h2=452&h1=303
http://www.sapgenie.com/phpBB2/viewtopic.php?t=14007&sid=09eec5147a0dbeee1b5edd21af8ebc6a
Regards
Aneesh.
~~The best practice is to search the forum before posting a thread.

Similar Messages

  • Select query in SAP SCRIPT

    Dear Experts,
    In printing of MB23n , I need to print STR_SUPPL1 and STR_SUPPL2 from ARDC table. I already have ADDRNUMBER.
    We are using SAP SCRIPT.
    Please guide me how to insert the following query in SAP SCRIPT.
    tables: lfa1, adrc.
    data: begin of it_test occurs 0 ,
    str_suppl1 like adrc-str_suppl1,
    str_suppl2 like adrc-str_suppl2,
    end of it_test.
    select str_suppl1 str_suppl2 into corresponding fields of table it_test from adrc addrnumber = lfa1-adrnr.
    Please hekp me to solve the issue.
    Thanks in advance.
    Regards
    Ankur

    Hi,
    In Script - Page Window -
         PERFORM <form name> IN PROGRAM <Program Name>
         USING &VBDKR-VBELN_VL&
         USING &VBDKR-VBELN_VAUF&
         CHANGING &ADDR_LINE1&
         CHANGING &ADDR_LINE2&
         CHANGING &ADDR_LINE3&
         CHANGING &ADDR_LINE4&
         CHANGING &ADDR_LINE5&
         ENDPERFORM
                         &ADDr_line1&&ADDR_LINE3& &ADDr_line2&
         &ADDR_LINE4&
         PROTECT
         &ADDR_LINE5&
         ENDPROTECT
    In SE38 - Create Prog as Subroutine pool --> Write a Form with same name
    SELECT SINGLE adrnr INTO twlad-adrnr FROM twlad WHERE werks = lips-werks AND
                                                              lgort = lips-lgort.
        IF sy-subrc = 0.
          CALL FUNCTION 'ADDRESS_INTO_PRINTFORM'
            EXPORTING
              address_type            = '1'
              address_number          = twlad-adrnr
            IMPORTING
              address_printform_table = lt_address.

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

  • Query on SAP-scripts

    Hi friends
    What's the functionality of 'CONTROL_FORM' function module in SAP-scripts.
    Thanks
    Suren

    Hi
    CONTROL_FORM function
    The CONTROL_FORM function module alows you to create SapScript control statements from within
    an APAB program.
    Syntax:
    CALL FUNCTION 'CONTROL_FORM'
    EXPORTING
    command         =
    EXCEPTIONS
      UNOPENED        = 1
      UNSTARTED       = 2
      OTHERS          = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Example:
    Protecting the text element ITEM_LINE
    CALL FUNCTION 'CONTROL_FORM'
    EXPORTING
    COMMAND = 'PROTECT'.
    CALL FUNCTION 'WRITE_FORM'
    EXPORTING
    TEXELEMENT = 'ITEM_LINE'.
    CALL FUNCTION 'CONTROL_FORM'
    EXPORTING
    COMMAND = 'ENDPROTECT'.

  • SAP Script form Related Query

    Hello Everyone,
    I am a newbie to SAP Script.I have to find a way to display an alternative payee addrees on the cheque output, if specified in the vendor record rather than the actual vendor's address, Can any one please help me out here,Thanks.At the moment it is just printing the each line of the address as a separate fields from the REGUH table.

    Hi ,
                  You need to create a new Subroutine type program, with name which you will be giving in your PERFORM statement.
                   For that you write the PERFORM statement in IF and ENDIF statement.
    Ex:-
    /: IF &REGUH-LIFNR& EQ '   '.
    /: PERFORM ....
    code
    /:ENDPERFORM
    address fields of Alternate Payee
    /: ENDIF
    Regards
    Bala Krishna
    Edited by: Bala Krishna on Sep 5, 2008 1:23 PM

  • Query Regarding SAP SCRIPT

    I have a normal report output with a field "HIDE" to make it interactive. When clicked on any of the values of this field(s), the value (say VBELN) has to be passed to SAP SCRIPT and all the SELECT QUERIES needs to be written in SAP SCRIPT to get the desired output.
    How do i get this feature?

    hi
    U have to call perform in SAP script '/:'.
    In that u have to pass parameter and get(changing) parameter.
    FORM get_value  TABLES  inpar  STRUCTURE itcsy
                                    outpar STRUCTURE itcsy.
    u have to read value from inpar and append value in outpar into the form.
    Hope thiw will be useful.
    regards
    vinod

  • How to print line item 2times in two different main window in Sap Script

    Hi,
    I am designing check printing form using Sap script. I need to print line items 2times in different 2main window.can yu pls explain  how print like this.
    JK

    i cud not get ur query..pls elaborate

  • Sap script form perform statement

    HI ALL ,
    CAN ANYONE HELP ME WITH SAP-SCRIPT FORM AND PERFORM SYNTAX. THAT IS WHEN U NEED TO ADD A FIELD TO AN EXISTING SAPSCRIPT, BY USING AN EXTERNAL SUBROUTINE.
    i NEED THE SYNTAX BOTH FOR PERFORM AND ENDPERFORM STATEMENT AND ALSO THE FORM STSEMENT. ANOTHER TRHING IS IF CAN LET ME KNOW HOW TO USE DEFINE STATEMENT IN SAPSCRIPT. WHATS ITS USE AND IS IT RELATED TO THE QUERY ABOVE.
    else,
    U PLZ LET ME KNOW ANY HELPFUL LINKS TO GO THROUGH.
    THANLS IN ADVANCE,
    ANUPMA.

    Hi anupma,
    1. while calling subroutines from sapscripts,
    there is a special technique,
    which has got its own limitations.
    2.
    FORM abc
    TABLES
    in_tab STRUCTURE itcsy
    out_tab STRUCTURE itcsy.
    ENDFORM.
    3. The perform in se38 program should be of the
    above format only.
    4. We cannot pass internal tables.
    5. Rather we need to pass
    VARIABLE NAME
    VARIABLE VALUE
    (see the structure of itcsy in se11)
    6. In this form, we have to read
    the internal table in_tab
    to capture the variable name and its value.
    7. Similary, to return the values,
    we have to put one record (for each variable)
    in out_tab.
    regards,
    amit m.

  • How to change the font size in sap scripts?

    hi friends,
        i had a query regarding to SAPSCRIPT.
      how to change the font size of a text in sap script form in which it should change it  dynamically.
    is it possible to change the font size dynamically in scripts.
    one more query regarding to this only.
    i need to get the hard copy of a script .
    what is the transaction code to get the hard copy?

    Hi venkata,
    You can specify the font size either in the Character format or pharagraph format.
    You better decide it according to your requirement.  If you want to apply the same font size for the entire form create the Paragraph format and give the paragraph format in the default paragraph format.
    If you want to apply that to limited text, then create character format.
    The process of creating it is just after going inside paragraph format click EDIT-> Create Element and give the font size.
    This applies for character format also.
    Reward points if useful.
    Thanks,
    karthik

  • Text translation in sap-script

    Hi
    I am using sapscript for PO printing . I need to translate some texts in the PO depending upon the language . I have the translated text in all languages . How to go about it . putting condition on language would be a tedious job . Is there some better way to perform these translations .
    Awaiting response . Would reward any sort of help .
    Thanks

    Instead Create A TExt Element and euate the text element to the corresponding field  which u r transferring to the S. Script.
    Suppose ur displaying : &VA_DESCRIPTION& in the SAP Script...
    Then Do like this:
    VA_DESCRIPTION = TEXT-001.
    Now using TRANSLATION TOOL LOAD THE TEXT-001 for all useful languages with the description u already have...
    Hope this is clear... For any query write back to me....
    Lastly: Don't forget to give POINTS.. as we are putting extra efforts by seating late in office and trying to help u...
    Darshan Patel

  • How to test the performed  SAP SCRIPT

    Hi friends can any one help for
    how to test the performed  SAP SCRIPT. What are the necessary codes or anything else for performing it

    Praveen,
    Can you be much clear with your query? What do you mean by performing? Do you mean how to execute it ?
    Regards,
    Vinod.

  • Need to restrict the form into one page with out second page in SAP Script

    Hello Friends,
    I have a query in SAP script form, I had created one form for confirmation request for FI, i had copied the standard form F130_CONFIRM_01 and made the changes as per the requirements and checked in f.17 which was perfect. I had removed all the lines except wherever the changes i had made in the form.
    Here iam getting one problem, when iam printing the confirmation request it should give me in one page but here iam getting two pages of which one page iam getting the complete information and the second page iam getting the empty page.
    It should not give the second page. i also checked by giving the condition if &page& eq 1  but no difference iam getting two pages.
    Pl. let me know how to solve this problem since this is very very emergency issue.

    Hi Mark,
                  If i am not wrong is this Tcode for customer/vendor balance confirmation? In the standard script that u mentioned, the first page id the letter, and the second page contains the balance sheet.You would not be able to restrict the blank pages from coming, coz there are in all three scripts configured for the TCode F.17, so the blank pages are bound to come, even if the conditions for pages are maintained. I have faced similar problems in my development too....
    Thanks & Regards
    Nayan
    SAP Consulatant.
    Reward with points if useful

  • Report ,sap-script,sreen painter,DDIC

    Hi all ,
    I have some query to ask.
    1)How to transport sap-script.
    2) print program of sap script are client-dependent or client-independent.
    3)Database tables ( on se11) are client-dependent or client-independent. ( is sy-mandt will make dependent or independent)
    4) how to create select-option on screen painter or with module pool programming.
    5)performance tips while creating ABAP report.
    6) How to generate new number whenever a new report is created.(e.g. when we create a customer or materia one new number ro name will be generated for customer or material).
    points for all answers assured.
    thanks.

    Hi Pillac,
    Here is answers..
    1)How to transport sap-script.
    While creating sap-script form it will ask you for abap package (class), if you assign standard package then it will ask you for change request. After completing your development you need to release your request and transport across system.
    2) print program of sap script are client-dependent or client-independent.
    Print program is client independent.
    3)Database tables ( on se11) are client-dependent or client-independent. ( is sy-mandt will make dependent or independent)
    MANDT field indicates it is client dependent table.
    4) how to create select-option on screen painter or with module pool programming.
    Check out following link...
    http://help.sap.com/saphelp_erp2005/helpdata/en/fc/eb2d81358411d1829f0000e829fbfe/frameset.htm
    5)performance tips while creating ABAP report.
    1. Do not use nested select statement.
    2. Use joins if possible ( But with limited number of tables)
    3. If you have more than 100-200 records do not use for all entries which degrades the performance.
    4. Try to use primary keys while selecting data from tables.
    5. If number of records too high in DB table and  select is not on primary key...create secondary index with where clause..will imrpove performance.
    6) How to generate new number whenever a new report is created.(e.g. when we create a customer or materia one new number ro name will be generated for customer or material).
    Create Number Range. You can use function module GET_NEXT_NUMBER which will give you next number everytime whenever you execute it.
    Cheers,
    Nilesh
    Message was edited by: Nilesh Kshirsagar

  • Regarding Multiple pages in SAP Script Output

    Hi All,
    I have a requirement in SAP Script where i need to print data in multiple pages. I had created 1 page - FIRST with properties <b>Next Page</b> as FIRST , <b>Mode</b> as INC.
    In the output i have multiple line items, the data will carry upto 3 pages.
    Now In the output First page data is printing correctly.
    In the second page all the windows are carried forward to print all the data correctly except in MAIN WINDOW.
    In Second page in MAIN Window i have ITEM HEADER which i want to print on every page as it is printing in First page of output, but i am not been able print ITEM HEADER though i am able to print all the ITEM DETAILS correctly on every page.
    Can anybody tell how can i print ITEM HEADER on every page which is in MAIN Window.
    Thanks in advance.
    Thanks & Regards,
    Rayeezuddin.

    Hi Shaik,
             If you are only printing Item Details in the Main Window, why don't you create a saperate window just above your main window for Item Headers.
    Hope this should solve your problem or Please elobarate your query.
    Thanks,
    Vinod.

  • Sap Script Queries

    Hi Experts,
    I need to print Long Text maintained for a record in sap.
    I have the Text ID and Text Object but don't know about the Text Name
    and I have to print this Long Text in my SAP SCRIPT to be shown on the Form and i am not doing changes in standard print program instead using the subroutine pool.
    Please tell me in Detail how can i achieve this.
    And one more query, i also have to print Digital signature for a document.
    Please tell me in Detail how can i get the details for a Digital signature (for a particular record) and get them printed in SAP Script.
    Thanks

    Hi,
    data: T_TEXT like tline occurs 0 with header line.
      IF NOT thead_011 IS INITIAL.
        CALL FUNCTION 'READ_TEXT'
          EXPORTING
            id                      = thead_011-tdid
            language                = thead_011-tdspras
            name                    = thead_011-tdname
            object                  = thead_011-tdobject
          TABLES
            lines                   = T_TEXT
          EXCEPTIONS
            id                      = 1
            language                = 2
            name                    = 3
            not_found               = 4
            object                  = 5
            reference_check         = 6
            wrong_access_to_archive = 7
            OTHERS                  = 8.
    T_TEXT is an internal table and contains the all the text which is there in ur transaction.
    now, u Loop the table T_TEXT and call WRITE_FORM fm in the loop.
    LOOP AT t_text.
      call function 'WRITE_FORM'
        EXPORTING
           element = 'TEXT'.
    ENDLOOP.
    now u call the element 'TEXT' in ur form, and print &T_TEXT-TDLINE& in that element..
    so it will print all the lines in T_TEXT table.
    In Script:
    eg: 
    /E  TEXT
    P1 &T_TEXT-TDLINE&
    Hope it helps
    Rgds,
    Pavan

Maybe you are looking for

  • Screen flashing in Satellite L500D

    Welcome! I have a laptop Toshiba L500D. Since about two weeks something happens with my laptop. Laptop is on, and when I open the lid, or closed, the screen flashes, colors change, you can see the different stripes in black and white or color, genera

  • My husband just bought an iphone and i want to sync my contacts to his ... how?

    my husband just bought an iphone and i wanted to sync my contacts with his ... I have tried through itunes ... but so far with no success

  • External Control in 5.5

    Am I reading the specs right? Is Adobe discontinuing support for external control in the new release????? If this is true, it is VERY DISAPOINTING as using my Mackie Control is intregral to my workflow. Also, did I read it correctly that there is NO

  • Album Art Websites

    I have seen on various posts, different websitesor programs where people get their album art from. Maybe we can consolidate it all here. Please post any website or program you use to get album art for your ipod. Please specify if the program is for M

  • Mail alert tone

    I cannot seem to figure out how to change the alert tone for mail. Is there a way? I've heard Other iPhones with different mail sounds but not sure how they did it.