SAP Function Modules

OL_PREPARE_OUTPUT SAP Function module







OL_PREPARE_OUTPUT is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name OL_PREPARE_OUTPUT into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: WSO7
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM OL_PREPARE_OUTPUT - OL PREPARE OUTPUT





CALL FUNCTION 'OL_PREPARE_OUTPUT' "
* EXPORTING
*   lifnr = SPACE               " lfa1-lifnr
*   ekorg = SPACE               " lfm1-ekorg
*   no_warnings = ' '           " wtdy-typ01
  TABLES
    a_mara =                    " wsol_matnr
    error_table =               " wsol_matnr
    fprot =                     " reo_message
*   pt_twpdo =                  " twpdo
*   pt_swhactor =               " swhactor
    .  "  OL_PREPARE_OUTPUT

ABAP code example for Function Module OL_PREPARE_OUTPUT





The ABAP code below is a full code listing to execute function module OL_PREPARE_OUTPUT including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
it_a_mara  TYPE STANDARD TABLE OF WSOL_MATNR,"TABLES PARAM
wa_a_mara  LIKE LINE OF it_a_mara ,
it_error_table  TYPE STANDARD TABLE OF WSOL_MATNR,"TABLES PARAM
wa_error_table  LIKE LINE OF it_error_table ,
it_fprot  TYPE STANDARD TABLE OF REO_MESSAGE,"TABLES PARAM
wa_fprot  LIKE LINE OF it_fprot ,
it_pt_twpdo  TYPE STANDARD TABLE OF TWPDO,"TABLES PARAM
wa_pt_twpdo  LIKE LINE OF it_pt_twpdo ,
it_pt_swhactor  TYPE STANDARD TABLE OF SWHACTOR,"TABLES PARAM
wa_pt_swhactor  LIKE LINE OF it_pt_swhactor .


SELECT single LIFNR
FROM LFA1
INTO @DATA(ld_lifnr).


SELECT single EKORG
FROM LFM1
INTO @DATA(ld_ekorg).


DATA(ld_no_warnings) = some text here

"populate fields of struture and append to itab
append wa_a_mara to it_a_mara.

"populate fields of struture and append to itab
append wa_error_table to it_error_table.

"populate fields of struture and append to itab
append wa_fprot to it_fprot.

"populate fields of struture and append to itab
append wa_pt_twpdo to it_pt_twpdo.

"populate fields of struture and append to itab
append wa_pt_swhactor to it_pt_swhactor. . CALL FUNCTION 'OL_PREPARE_OUTPUT' * EXPORTING * lifnr = ld_lifnr * ekorg = ld_ekorg * no_warnings = ld_no_warnings TABLES a_mara = it_a_mara error_table = it_error_table fprot = it_fprot * pt_twpdo = it_pt_twpdo * pt_swhactor = it_pt_swhactor . " OL_PREPARE_OUTPUT
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_lifnr  TYPE LFA1-LIFNR ,
it_a_mara  TYPE STANDARD TABLE OF WSOL_MATNR ,
wa_a_mara  LIKE LINE OF it_a_mara,
ld_ekorg  TYPE LFM1-EKORG ,
it_error_table  TYPE STANDARD TABLE OF WSOL_MATNR ,
wa_error_table  LIKE LINE OF it_error_table,
ld_no_warnings  TYPE WTDY-TYP01 ,
it_fprot  TYPE STANDARD TABLE OF REO_MESSAGE ,
wa_fprot  LIKE LINE OF it_fprot,
it_pt_twpdo  TYPE STANDARD TABLE OF TWPDO ,
wa_pt_twpdo  LIKE LINE OF it_pt_twpdo,
it_pt_swhactor  TYPE STANDARD TABLE OF SWHACTOR ,
wa_pt_swhactor  LIKE LINE OF it_pt_swhactor.


SELECT single LIFNR
FROM LFA1
INTO ld_lifnr.


"populate fields of struture and append to itab
append wa_a_mara to it_a_mara.

SELECT single EKORG
FROM LFM1
INTO ld_ekorg.


"populate fields of struture and append to itab
append wa_error_table to it_error_table.

ld_no_warnings = some text here

"populate fields of struture and append to itab
append wa_fprot to it_fprot.

"populate fields of struture and append to itab
append wa_pt_twpdo to it_pt_twpdo.

"populate fields of struture and append to itab
append wa_pt_swhactor to it_pt_swhactor.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name OL_PREPARE_OUTPUT or its description.