Recent Updates Page 2 Toggle Comment Threads | Keyboard Shortcuts

  • saphelpdeskinfo 1:15 pm on September 22, 2011 Permalink | Reply  

    What is the difference between macro and subroutine 

    difference between macro and subroutine

    Macros can only be used in the program they are defined in and only after the definition are expanded at compilation /generation. If you want to reuse the same set of statements more than once in a program, you can include them in a macro. For example, this can be useful for long calculations or complex WRITE statements. You can only use a macro within the program in which it is defined, and it can only be called in lines of the program following its definition.

    The following statement block defines a macro macro:
    DEFINE makro.
    You must specify complete statements between DEFINE and END‑OF‑DEFINITION. These statements can contain up to nine placeholders &1&2,…., &9). You must define the macro before the point in the program at which you want to use it.
    Macros do not belong to the definition part of the program. This means that the DEFINE statement block is not interpreted before the processing blocks in the program. At the same time, however, macros are not operational statements that are executed within a processing block at runtime. When the program is generated, macro definitions are not taken into account at the point at which they are defined. For this reason, they do not appear in the overview of the structure of processing logic.
    A macro definition inserts a form of shortcut at any point in a program and can be used at any subsequent point in the program. As the programmer, you must ensure that the macro definition occurs in the program before the macro itself is used. Particular care is required if you use both macros and include programs, since not all include programs are included in the syntax check (exception: TOP include).
    To use a macro, use the following form:
    makro [p1 p2… p9].
    When the program is generated, the system replaces the macro by the appropriate statements and the placeholders &1&2, …, &9 by the parameter p1p2, …, p9. You can use macros within macros. However, a macro cannot call itself.

    Defining Subroutines

    A subroutine is a block of code introduced by FORM and concluded by ENDFORM.
    FORM <subr> [USING   … [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]… ]
                [CHANGING… [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]… ].
    ENDFORM.<subr> is the name of the subroutine. The optional additions USING and CHANGING define the parameter interface. Like any other processing block, subroutines cannot be nested. You should therefore place your subroutine definitions at the end of the program, especially for executable programs (type 1). In this way, you eliminate the risk of accidentally ending an event block in the wrong place by inserting a FORM…ENDFORM block.

    (FORM) can be called from both the program they are defined in and other programs. 
    A MACRO is more or less an abbreviation for some lines of code that are used more than once or twice. A FORM is a local subroutine (which can be called external). 
    A FUNCTION is (more or less) a subroutine that is called external. Since debugging a MACRO is not really possible, prevent the use of them (I’ve never used them, but seen them in action). If the subroutine is used only local (called internal) use a FORM. If the subroutine is called external  (used by more than one program) use a FUNCTION.

  • saphelpdeskinfo 1:11 pm on September 22, 2011 Permalink | Reply  

    How can I make a differentiate dependent Vs independent data 

    How can I make a differentiation between dependent and independent data

    •  Client dependent or independent transfer requirements include client specific or cross clientobjects in the change requests.
    •  Workbench objects like SAPScript are client specific; some entries in customizing are client independent. 

    • If you display the object list for one change request,and then for each object the object attributes, you will find the flag client specific.
    •  If one object in the task list has this flag on, then that transport will be client dependent.
    • Dominik Tylczyński 8:09 am on September 23, 2011 Permalink | Reply

      Also client dependent data is stored in tables with MANDT field (data element MANDT) as first key field.

  • saphelpdeskinfo 12:30 pm on September 22, 2011 Permalink | Reply  

    Smart Forms 

    What is Smart Forms 
    Smart Forms allows you to create forms using a graphical design tool with robust functionality, color, and more. Additionally, all new forms developed at SAP will be created with the new Smart Form solution


    You use Smart Forms to create and maintain forms for mass printing in SAP systems. Besides using the printer for standard output you can also select the Internet (by using a generated HTML output), a fax, or e-mail as the output medium.
    In addition to the tool, SAP delivers a selection of forms for central business processes. This includes forms in Customer Relationship Management (CRM) as well as in the applications SD, FI, and HR.
    Smart Forms offers the following advantages:
    ·        Creating and maintaining forms requiring half the time
    ·        Adapting forms without any programming knowledge due to entirely graphical user interface
    ·        Integrating input elements into the HTML output, which enables you to use a form in Internet applications as well
    Smart Forms replace SAPscript forms. SAPscript forms will still be supported in the future; you can use them without making any changes for years to come. You can even use SAPscript texts in the Smart Forms. Migration of SAPscript forms into Smart Forms is supported.


    Smart Forms allows you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won’t include any programming effort. Thus, a user who is familiar with the tool but has only rudimentary programming knowledge can configure forms with data from an SAP system for the relevant business processes. The result of the form development is a Smart FormAfter it is activated, the Smart Form is similar to a callable function module in the SAP system.
    The logic of the form is mapped entirely in the Smart Form. To print a form, you call it from within an application program, in which you retrieve the application data to be merged into the form. As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary. The application program passes the data via a function module interface to the Smart Form.



    To develop a Smart Form you use the Form Builder in which you describe the attributes of the Smart Form by using the integrated graphical tools, such as the Form Painter for the layout of a form page or the Table Painter for the design of table output. The form logic is represented by a hierarchy structure (tree structure) that you construct of individual nodes together with the relevant attributes. Besides using existing nodes for global settings you may create, for example, nodes for the output of texts, of tables, or of graphics. To make changes, use Drag&Drop, Copy&Paste, and select different attributes. These actions do not require writing coding lines or using a Script language.
    You can check individual nodes as well as the entire form and find any existing errors in the tree structure. The data flow analysis checks whether all fields (variables) have a defined value at the moment they are displayed.


    You can include static and dynamic tables into a Smart Form. Dynamic tables enable you to display tables whose size is determined only at the moment of their output by the number of the table items to be displayed. Table functions are:
    ·        Line feeds in individual table cells
    ·        Event-controlled output of table headings and footers
    ·        Integrated calculation of grand totals and subtotals
    ·        Colored boxes and shadings in tables


    To position output on a form page you use windows. Besides using simple windows for displaying output of fixed length there are special window types, for example, for continuous text or for distinctions between the original and a copy of a form.
    You can include background pictures as graphics, which you can either use as copy templates for a form or print as background graphics.
    You can specify spool attributes in the form to allow for postage optimizing.

    Interactive Web Forms

    You use HTML output to integrate forms into Internet applications. This allows you to use the same Smart Form both for printing and for the Internet application. The layout of the form in the web browser corresponds to the print layout.
    You can enhance the web forms with input-enabled elements, allowing the recipient or user of a web form to change or supplement data. The data the user entered can either be queried by the Internet application or be evaluated automatically by the system.
  • saphelpdeskinfo 12:25 pm on September 22, 2011 Permalink | Reply  

    Uploading data using CATT 

    How to upload data using CATT? 
    These are the steps to be followed to upload data through CATT: Creation of the CATT test case & recording the sample data input. Download of the source file template. Modification of the source file. Upload of the data from the source file.

    Simply, any one in SAP can use this tool as long as you can access to the tcode.  I used CATT atleast in 3 different SAP modules.  Typically, in SAP projects, CATT execution is a favorite task for “technical” associates.  When the technical resources are either not available immediately or their plate is full with other important tasks, functional associates can simply jump into this activity, since there is no coding or programming involved.  This tool has been a great gift from SAP since I am a functional person and could not do coding !  I can remember at least 30 or 40 occassions where I used CATT to get this and that done.
    Below find few examples:
    1. Created multiple sales orders (excess of 200) in a matter of minutes for the purpose of end user training
    2. Created multiple purchase ordes (excess of 200) in a matter of minutes for the purpose of end user training
    3. Created Deliveries for the sales orders in a matter of minutes for the purpose of end user training
    4. Created config. entires, if the volume of records is large.  I remember once I entered 900 records.
    5. Extensively used in preparing the transactional data for the purpose of archiving.  It worked impeccably.
    6. Loading of master data (example: material groups)

  • saphelpdeskinfo 12:22 pm on September 22, 2011 Permalink | Reply  


    What is a batch input session 

    •  BATCH INPUT SESSION is an intermediate step between internal table and database table. Data along with the action is stored in session ie data for screen fields, to which screen it is passed, program name behind it, and how next screen is processed.

    Process Overview: Batch Input PurposeBatch input is one of the primary ways in which data can be transferred into the R/3 System. Batch input is used for bulk data transfers and not for near real-time data transfers.
    Typical uses of batch input include the one-time import of data from a legacy system into a newly installed R/3 System. Another typical use is for periodic (hourly, daily…) transfers of data from external systems or legacy systems that are still in use into R/3, where all enterprise data is consolidated.
    For the system administrator, batch input usually requires minimal attention, only a periodic check to make sure all batch input sessions have been processed successfully. In the event of an error in a session, then the responsibility for triggering the error analysis and correction of the problem usually lies with the system administrator. Detailed analysis of the problem will require the help of the department or specialist responsible for the data to be entered. Incorrect entries in an R/3 financials transaction in a session, for example, have to be evaluated and corrected by the book-keeping department.
    The process description here explains the typical workflow in batch-input operation from the point of view of the system administrator.
    PrerequisitesThe R/3 applications deliver many programs for batch input that are ready to use. Sometimes, however, a customer must write his or her own batch input program in order to convert data from a legacy system or from a proprietary format into an R/3 data format.
    Batch input operation occurs only if a customer explicitly sets its up. The customer must activate a program that prepares a batch input session and that delivers it to the R/3 System.
    Process Flow

    • Data transfer decision-making: The batch input process begins with a decision to transfer data from an external source into R/3. The external source may be a legacy system that is being replaced. In this case, a one-time bulk data transfer is foreseen. For example, customer data from a customer’s old financials system may be transferred with batch input to a new R/3 System.

    Alternatively, the external source may be an external system that is to remain in use, another R/3 System, or an R/2 System. In this case, a regularly-recurring bulk data transfer is foreseen. For example, data from a free-standing engineering system may be taken over into R/3 by means of a daily batch-input run.

    • Setting up batch-input for data transfers: If R/3-standard one-time or regular data transfers are required, then these may be set up by means of customizing settings in the R/3 Customizing System in SAP ASAP. Example: Batch input data transfers can be activated for legacy data in the Materials Management application (see ‘Data Transfer’).

    Custom batch input procedures must be set up by hand. That is, the system administrator must schedule the data conversion program that creates the batch input session. How frequently data is made available from the external system, how frequently the conversion program should run, and whether the conversion program runs in R/3 (ABAP program) or in a host system (external program) must all be determined by the system administrator and the batch input programmer. See also the online guide  Basis Programming Interfaces.

    • Processing batch input sessions: The actual transfer of data into R/3 takes place when a batch input session is processed.

    For the system administrator, processing of batch input sessions requires little attention. Usually, system administrators automate the starting of batch input sessions (see Processing Sessions Automatically). Administrators can also start batch input sessions explicitly from transaction SM35, if necessary.

    • Checking batch input sessions: The only routine activity for a system administrator is to check daily or more frequently in transaction SM35 that all batch input sessions have been completed successfully. The schedule for checking sessions depends upon the schedule for running batch input sessions. The R/3 System provides easy-to-use batch input management tools for doing this check (see Selecting Sessions).

    • Analyzing errors: If one or more transactions in a session ended in errors, then the system administrator must analyze the problem. Usually, the system administrator will need the assistance of the affected data entry specialist or department for this analysis. The programmer who wrote the data conversion program may also need to be involved, if the problem was caused by incorrect data conversion or incorrect generation of the batch input session.

    The batch input system offers detailed logging and powerful analysis tools to help you find out the cause of a problem (see Analyzing Sessions and Displaying Session Logs).
    Most problems fall into one of two categories:

    • Required data is missing from the batch-input session or invalid data has been included in the session. Possible external causes of this type of problem include errors in the data conversion program or the presence of unexpected types of data or incorrect data in the legacy database. Causes for this type of problem within R/3 include incorrect or incomplete customizing in an application. For example, a legacy data type may not have been foreseen in the check table entries made in application customizing.
    • Technical/programming problems. A batch input session enters data by running R/3 transactions non-interactively. A typical technical or programming problem is therefore incorrect identification of one of the data fields in a transaction. Or the conversion program may not fill a required data field or may have provided invalid values.

    • Correcting errors:

    The batch input system processes all correct transactions in a session. It also guarantees that successfully completed transactions in a session cannot be run again. To correct transactions with errors, the system administrator or the responsible department can interactively correct and reprocess the transactions.

    Batch Input, Fast Input, and the Data Transfer Workbench

    Batch input is one of several techniques that are in use for transferring data into the R/3 System. Different R/3 applications and SAP components may use batch input, fast input, or data transfer by way of calls to a BAPI interface.
    All of these data transfer techniques are brought together in the data transfer workbench. In the workbench (transaction BMV0), you can find all batch input, fast input, and BAPI data transfer programs. And you can branch to transaction SM35 to run batch input sessions from the workbench.BAPI-based data transfer interfaces are individually documented in the Business Object Repository.You can find information on the technical implementation of batch input and fast input and on the programming of these techniques in the online guide  Basis Programming Interfaces. Here you will also find information on how these two techniques for transferring data differ.


    Batch input is a key technology for integrating R/3 into heterogenous ERP environments. Batch input provides the capabilities necessary to ensure a smooth and efficient flow of information into R/3 from external sources.

  • saphelpdeskinfo 11:31 am on September 22, 2011 Permalink | Reply  

    logical databases 

    What are logical databases? n   What are the advantages/ dis-advantages of logical databases? – 

    To read data from a database tables we use logical database. A logical database  provides read-only access to a group of related tables to an ABAP/4 program.


     i) check functions which check that user input is complete, correct, and plausible.
     ii) Meaningful data selection.
    iii) Central authorization checks for database accesses.
     iv)good read access performance while retaining the hierarchical data view determined by the application logic.


     i)If you do not specify a logical database in the program attributes, the GET events never occur.
     ii)There is no ENDGET command, so the code block associated with an event
    ends with the next event statement (such as another GET or an END-OF-SELECTION).

  • saphelpdeskinfo 11:25 am on September 22, 2011 Permalink | Reply  

    Change and Transport System (CTS) 

    What is CTS and what do you know about it?- 

    • The Change and Transport System (CTS) is a tool that helps you to organize development projects in the ABAP Workbench and in  Customizing, and then transport the changes between the SAP Systems and clients in your system landscape. This documentation provides you with an overview of how to manage changes with the CTS and essential information on setting up your system and client landscape and deciding on a transport strategy. Read and follow this documentation when planning your development project

    This article answers following queries in SAP ?
    • What is Change and Transport System (CTS) in SAP ?
    • What is Transport Management System(TMS) in SAP ?
    • What is Change and Transport Organiser (CTO) in SAP ?
    • What are the transport tools  in SAP ?
    • What is the transport control program and what is its significance in SAP ?
    • What is the functionality of R3trans program in SAP?
    Change and Transport System (CTS) is the tool provided by SAP for the creation, documentation and distribution of changes within a system landscape.
    CTS comprises of 

    Change and Transport Organiser (CTO) : This provides several functions to facilitate software development 
     Transport Management System (TMS) : This is used to setup transport routes in the landscape. This provides functions to perform organize, monitor and perform transports within the landscape 
    Transport Tools (R3trans and TP) : These are the tools that are used by SAP at operating system level to communicate with SAP, database and the files generated during the export process.
    The transport control program (TP) is a utility for provided by SAP for managing transports and to handle release upgrades. This utility is inturn called by other programs like CTS, TMS and Upgrade control program (R3up)
    R3trans is a transport program provided by SAP to handle transports between different SAP systems and for the release upgrades. R3trans is usually not called directly and it is called mostly by Transport control program(TP) and Upgrade control program(R3up)

  • saphelpdeskinfo 11:18 am on September 22, 2011 Permalink | Reply  

    events in ABAP/4 language 

    What are the events in ABAP/4 language?-

    • Initialization, 
    • At selection-screen,
    •  Start-of-selection, 
    • end-of-selection,
    •  top-of-page, 
    • end-of-page, 
    • At line-selection, 
    • At user-command, 
    • At PF,
    •  Get,
    •  At New, 
    • At LAST,
    •  AT END,
    •  AT FIRST.
  • saphelpdeskinfo 11:16 am on September 22, 2011 Permalink | Reply  

    ALV programming in ABAP 

    What is ALV programming in ABAP?  When is this grid used in ABAP? – 

    • ALV is Application List viewer. Sap provides a set of ALV (ABAP LIST VIEWER) function modules which  can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length. In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output. The report output can contain up to 90 columns in the display with the wide array of display options.

    Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length. 
    In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output. 
    The report output can contain up to 90 columns in the display with the wide array of display options.
    The commonly used ALV functions used for this purpose are;

    Purpose of the above Functions are differ not all the functions are required in all the ALV Report. 
    But either no.7 or No.8 is there in the Program. 
    How you call this function in your report?
    After completion of all the data fetching from the database and append this data into an Internal Table. say I_ITAB.
    Then use follwing function module.
                I_CALLBACK_PROGRAM       = ‘’
                I_STRUCTURE_NAME         = ‘I_ITAB’
                I_DEFAULT                = ‘X’
                I_SAVE                   = ‘A’
                T_OUTTAB                 = I_ITAB.
      IF SY-SUBRC <> 0.
        WRITE: ‘SY-SUBRC: ‘, SY-SUBRC .
    ENDFORM.                    ” GET_FINAL_DATA

  • saphelpdeskinfo 11:11 am on September 22, 2011 Permalink | Reply  

    components of SAP scripts 

    What are the components of SAP scripts  
     SAP scripts is a word processing tool of SAP which has the following components: Standard text. It is like a standard normal document.
    Layout sets. – Layout set consists of the following components: Windows and pages, Paragraph formats, Character formats. Creating forms in the R/3 system. Every layout set consists of
    Header, paragraph, and character string. ABAP/4 program

    SAP script is the SAP System’s own text-processing system.It looks and feels a lot like other leading text-processing systems.
    It is used to print preformatted text in pre-formatted forms.

    Components of SAP Script

    SAP Scripts comprises of five main components:
    1. An editor for entering and editing the lines of a text
    2. Styles and layout sets for print layout. These are created independent of the individual texts using the corresponding maintenance transactions and are allocated to the texts later
    3. The composer is a central output module. The SAP script composer is invisible to the outside
    4. A programming interface that allows you to include SAP script components into your own application programs and to control the output of layout sets from within the programs
    5. Several database tables for storing texts, styles and layout sets

    Layout Set

    To output documents using the programming interface, R/3 application programs need so-called layout sets (a kind of form).In SAP script a layout set describes the layout of the individual print pages and uses text elements to supply definable output blocks, which a print program can call.A layout set can be defined as a page design for a document
    Layout set on its own doesn’t contain any data. The selection of data for the document is done through the print program.   The print program selects the data from database table and feeds it to the layout set. When the print program is executed the document is printed on the screen, printer.
    Usually a SAPScript Layout consists of following components
    1. Header Data:
      Header data is used for information and control of SAP printing. The header data comprises of 2 parts – Device Independent – Stores information like Start page , Default paragraph ,Language Attributes etc. And Device Dependent stores information like Page format ,Orientation Lines per inch etc
    2. Paragraph and Character Formats:
      Paragraphs are formatted using various attributes. For instance Standard paragraph attributes specify Left or Right margin, Alignment ,Line spacing etc. Font attributes specify Font family ,Font size etc. Character formats allow to format entire blocks of text within a paragraph
    3. Windows and Text Elements:
      Windows are individual text areas (header address, date, footer) in a page . It helps combine the information contained in a document into certain groups and make each group appear on the printed page in an individual area.You can define text elements (window texts) for each window. The print program accesses text elements by name, formats them and prints them in the respective window. The paragraph and the character formats used must be defined in the form.
    4. Pages: 
      They are individual pages of a document and must have a unique name. You will often find different layouts for individual pages: The first page of an invoice differs from the subsequent pages, on which you need not repeat general information, such as address or customer data.
    5. Page Windows:
      While defining windows and pages, you do not yet determine the position and spacing of the texts to be output.A page window defines the rectangular output area in the output medium by specifying the left upper edge of the output area and its width and height

    Control Commands

    The purpose of “control commands” is to allow control of the output formatting.These commands are not interpreted by the SAP script editor, but are passed through to the SAP script Composer for processing. This includes, for example, line and page formatting, the formatting of text according to the paragraph and character formats specified.
    Enter /: in the paragraph format
    • NEW-PAGE – Explicit page break
    • PROTECT ………ENDPROTECT – To print complete paragraph in one page.
    • INCLUDE – To include the content of another text into current text
    • PERFORM – To call a subroutine of any ABAP program

    Print Program

    The execution of script is done through an ABAP program, which is referred as Print Program. Each print program should have an ENTRY form , which will be called from customization.
    For a standard configuration we can see the form name (script name), print program name and output type in the table TNAPR.The print program uses the Form control functions to call the script.
    The print program call either all or some of the form control functions to execute the script
    • OPEN_FORM (Mandatory) Opens the layout set output
    • CLOSE_FORM (Mandatory) Ends the layout set output
    • START_FORM (Optional) Starts a new layout set
    • WRITE_FORM (Mandatory) Calls a layout set element
    • END_FORM (Optional) Ends the current layout set

    Output Types

    The output type can specify, a printed form that you need for internal use or a form that you want to send to a customer or vendor . The output type can also be an internal electronic mail message that you want to send to staff in another department.
    For example “Print out” can be classified as one output type of a billing document, i.e. when this output type is executed the billing document is printed. Similarly “Fax” can be an output type, i.e. when this output type is executed a fax of the billing document is sent
    All the output types for any document (e.g. billing document) will be stored in the table NAST.Output types are executed through the program RSNAST00 .
    Example : Output type in a billing document-
    1. Go to VF03
    2. Enter billing document number and press enter again
    3. Chose Output under the menu Goto -> Header
    4. Here Z101 is an output type of a print output

    Standard Texts and Graphics

    Standard Texts for your report can be created using transaction SO10
    Graphics and printer macros are uploaded with report RSTXLDMC into individual standard text documents or through transaction SE78. Graphics are uploaded  in “Baseline TIFF 6.0″ format (.tif files on PC)
    SAP Script & Standard text elements can exported or imported between two systems using RSTXSCRP program
    Copying Scripts Across clients:
    SAP Script is a client dependent object.Unlike programs, changes done to SAP script in one client will not be reflected in other clients. For copying script from one client to another, go to SE71and use “Copy from Client” option available under Utilities menu or import the transport request, in which the script is saved, from the original client using the transaction SCC1 .
    Important Points to Note
    1. SAP script does not maintain any versions. So when modifying the SAP script , ensure that the changes are well documented in script. This applies to the standard texts too.
    2. The output of the form will differ when viewed on the screen and on the printer. So always test the output of the script on the printer.
Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc