Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

function modules for printing

Former Member
0 Likes
3,272

can anyone explain me the need of thses FMs.

1. GET_PRINT_PARAMETERS

2. G_SET_GET_ID_FROM_NAME

3.G_SET_SEARCH_FOR_INTERVAL

2 REPLIES 2
Read only

Former Member
0 Likes
1,778

Hi Camila,

just enter the FM name in transaction code SE37, click on display and then on 'function module documentation' and you'll find any information you need.

Regards

Nicola

Read only

Former Member
0 Likes
1,778

hi camila,

1.GET_PRINT_PARAMETERS

Read, determine, change spool print parameters and archive parameters

Functionality

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

parameters.

The sytem returns the values for the current user and

report.

'DISPLAY' Displays the print parameters passed.

IMPORTANT:

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

2. G_SET_GET_ID_FROM_NAME

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

Parameters

CLIENT

SHORTNAME

OLD_SETID

TABNAME

FIELDNAME

KOKRS

KTOPL

LIB

RNAME

SETCLASS

CHECK_SET_EMPTY

SUPRESS_POPUP

NO_DYNAMIC_SETS

NEW_SETID

SET_INFO

T_SETS

Exceptions

NO_SET_FOUND

NO_SET_PICKED_FROM_POPUP

WRONG_CLASS

WRONG_SUBCLASS

TABLE_FIELD_NOT_FOUND

FIELDS_DONT_MATCH

SET_IS_EMPTY

FORMULA_IN_SET

SET_IS_DYNAMIC

Function Group

GSAC

3.G_SET_SEARCH_FOR_INTERVAL

Short Text

Check Whether a Set Contains Values in Specified Value Interval

Functionality

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

Parameters

SET

FROM

TO

TABELLE

INCLUDE_SUBSETS

INTERNAL_VALUES

VALLIST

Exceptions

VALUE_NOT_FOUND

SET_NOT_FOUND

CONVERSION_ERROR

WRONG_SETTYPE

WRONG_INTERVAL

Function Group

GSOV

if helpful reward some points.

with regards,

suresh babu aluri.