Skip to Content
author's profile photo Former Member
Former Member

printing a file


i want a FM which can prints a file.

the import parameter should take the file path as

eg. ' c:\xyz.bmp '

and prints the file.



Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2007 at 11:10 AM


    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2007 at 11:14 AM


    Read, determine, change spool print parameters and archive parameters


    The function module GET_PRINT_PARAMETERS is used to define, modify and display the print and archive parameters. Using this function module is the only correct way to modify a print or archive parameter record. The print parameters are closely related and contain a check total. This check total becomes invalid if any of the print parameters are changed and causes a runtime error when the print parameters are used later.

    The required parameters are defined in the structure IN_PARAMETERS or IN_ARCHIVE_PARAMETERS. These input parameters must originate from another call of GET_PRINT_PARAMETERS or must be initial. The resulting print and archive parameters are returned with the function parameters OUT_PARAMETERS or OUT_ARCHIVE_PARAMETERS. The remaining IMPORT parameters, such as DESTINATION, LIST_NAME etc., are used to define the values to be passed to OUT_PARAMETERS or OUT_ARCHIVE_PARAMETERS. The output parameter VALID has the value BLANK in an interactive call if the user canceled the print screen.

    You can use the function module with dialog (parameter NO_DIALOG = SPACE) or without dialog. If you use a dialog, a screen appears on which the user can change the print parameters.

    Note: The "Print from page to page" option on the screen is not suitable for printing from ABAP programs, and is therefore not part of the structure PRI_PARAMS.

    The module recognizes the following modes (values of parameter MODE):

    'PARAM' Normal case. Define the print parameters for the

    current program. The values that are not defined

    are specified from the user master record or are

    assigned default values. The print parameter screen

    displays the PRINT key. This mode is used

    if the MODE parameter is not specified.

    'PARAMSEL' Like PARAMS, except that the print parameter screen

    includes an option to activate the selection screen.

    'BATCH' Define the print parameters for a background job.

    In this mode, the name of the report to be started

    is passed with the REPORT parameter.The REPORT

    statement of the specified report is checked for

    LINE-SIZE and LINE-COUNT definitions. These

    definitions are passed as default specifications.

    Furthermore, the SAVE key is offered

    instead of the PRINT key in this mode.

    'CURRENT' Define the current valid print parameters:

    These parameters come from the following sources:

    1.) From the user-specific print parameters

    2.) From the LINECOUNT and LINESIZE additions in

    the REPORT statement

    3.) If the report is running in the background or

    with Execute and Print, from the print parameters

    passed from the report.

    Otherwise it behaves as with PARAMSEL. In general, you should

    set import parameter NO_DIALOG in this modus,

    becausethis mode is only pointful, if it is run in the background.

    'DEFVALS' Display for the default values.

    Some of the default values are stored in the user defaults,

    others can be maintained specifically for users and reports

    using System -> List -> Print -> User-specific print


    The sytem returns the values for the current user and


    'DISPLAY' Displays the print parameters passed.


    In DEFVALS mode, the fields in out_parameters that are not contained in the user defaults are initial (type unknown). This means that the fields are not considered if out_parameters is passed again in a subsequent call of GET_PRINT_PARAMETERS.

    In all other modes, all fields of out_parameters are filled with values (possibly default values). This means that the fields are considered if out_parameters is passed in a subsequent call of GET_PRINT_PARAMETERS.

    You should normally query the value of VALID. It has the possible values TRUE and FALSE. If it is FALSE, the user has either canceled the print dialog, or the function module has been called with parameters that cannot be used to print properly (for example, printing in the background on a frontend printer).


    Use this module to derive the internal set Id from the name that appears on the user interface, for example, in order then to import the set (see the function group documentation).

    The function module first determines a candidate list of sets based on the set name and the class that might have been specified that could match the set name. The class can also be masked (e.g. 000+ for all FI-SL sets, including dynamic sets).

    Case 1: A CO group class has been specified.

    If the controlling area has been transferred, then a search is made for groups of the specified class in this controlling area that have the name specified. Otherwise a search is made for groups from all controlling areas. During the search for cost element and account groups the chart of accounts is taken into consideration. If this was not specified it is derived from the controlling area.

    Case 2: A set class is specified but it is not a class from CO.

    A search is made for all sets belonging ot this class that have the specified name.

    Case 3: No set clas is specified.

    A search is made for all sets that match the name.

    The sets are processed further as follows:

    If a table field has been specified, a check is made whether the set table fields are compatible with the field specified. That means, a check is whether they have the same representative data element . If this is not the case for any of the sets, the exception TABLE_FIELDS_DONT_MATCH is triggered. If only the table and not the field name was specified, a search is only made for sets created for this table.

    Case 1: G_SET_GET_ID_FROM_NAME found a set that matched exactly.

    The set ID is returned.

    Case 2: G_SET_GET_ID_FROM_NAME found more than one set.

    If OLD_SETID was transferred and this ID is in the list of sets found, it is returned. Otherwise the function module offers a dialog box to select a set. If the parameter SUPRESS_POPUP has been set to 'X', the exception NO_SET_PICKED_FROM_POPUP is triggered instead.

    Case 3: G_SET_GET_ID_FROM_NAME has not found a set.

    In this case an exception is triggered. For CO groups the function module also checks whether there is a CO group with the same name in a different controlling area or chart of accounts. If there is, the exception WRONG_SUBCLASS is triggered. Otherwise it checks whether there is a set with the given name in a different class. If there is, the exception WRONG_CLASS is triggered.

    If the parameter CHECK_SET_EMPTY has been flagged, the set found is imported and checked whether it is empty or contains formulas. If required, information about the set is returned in the parameter SET_INFO (analog to the module G_SET_GET_INFO).




























    Function Group



    Short Text

    Check Whether a Set Contains Values in Specified Value Interval


    This function module checks whether a value interval (FROM, TO) overlaps with the value intervals in a specified set.

    If no overlapping is found, the function module triggers the exception "NO_VALUES_FOUND".















    Function Group


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.