SAP Function Modules

PRELIMINARY_POSTING_DOC_WRITE SAP Function module - Write a parked document







PRELIMINARY_POSTING_DOC_WRITE 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 PRELIMINARY_POSTING_DOC_WRITE into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: F042
Released Date: Not Released
Processing type: Start update immediately (start immed)
update module start immediate settings


Pattern for FM PRELIMINARY_POSTING_DOC_WRITE - PRELIMINARY POSTING DOC WRITE





CALL FUNCTION 'PRELIMINARY_POSTING_DOC_WRITE' "Write a parked document
* EXPORTING
*   i_uf05a =                   " uf05a
*   i_bstat =                   " bkpf-bstat
  TABLES
    t_vbkpf =                   " fvbkpf        Document headers
    t_vbsec =                   " fvbsec        One-time account data
    t_vbseg =                   " fvbseg        Line items
    t_vbset =                   " fvbset
*   t_vacsplt =                 " fvacsplt      Carrier for Split Information re: Current Account Line Items
*   t_vspltwt =                 " vspltwt       FI Document Parking (Enjoy): W/Tax Data Amount Split
  EXCEPTIONS
    ABNORMAL_TERMINATION = 1    "
    INSERT_ERROR = 2            "
    UPDATE_ERROR = 3            "
    READ_ERROR = 4              "
    .  "  PRELIMINARY_POSTING_DOC_WRITE

ABAP code example for Function Module PRELIMINARY_POSTING_DOC_WRITE





The ABAP code below is a full code listing to execute function module PRELIMINARY_POSTING_DOC_WRITE 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_t_vbkpf  TYPE STANDARD TABLE OF FVBKPF,"TABLES PARAM
wa_t_vbkpf  LIKE LINE OF it_t_vbkpf ,
it_t_vbsec  TYPE STANDARD TABLE OF FVBSEC,"TABLES PARAM
wa_t_vbsec  LIKE LINE OF it_t_vbsec ,
it_t_vbseg  TYPE STANDARD TABLE OF FVBSEG,"TABLES PARAM
wa_t_vbseg  LIKE LINE OF it_t_vbseg ,
it_t_vbset  TYPE STANDARD TABLE OF FVBSET,"TABLES PARAM
wa_t_vbset  LIKE LINE OF it_t_vbset ,
it_t_vacsplt  TYPE STANDARD TABLE OF FVACSPLT,"TABLES PARAM
wa_t_vacsplt  LIKE LINE OF it_t_vacsplt ,
it_t_vspltwt  TYPE STANDARD TABLE OF VSPLTWT,"TABLES PARAM
wa_t_vspltwt  LIKE LINE OF it_t_vspltwt .

DATA(ld_i_uf05a) = 'Check type of data required'.

SELECT single BSTAT
FROM BKPF
INTO @DATA(ld_i_bstat).


"populate fields of struture and append to itab
append wa_t_vbkpf to it_t_vbkpf.

"populate fields of struture and append to itab
append wa_t_vbsec to it_t_vbsec.

"populate fields of struture and append to itab
append wa_t_vbseg to it_t_vbseg.

"populate fields of struture and append to itab
append wa_t_vbset to it_t_vbset.

"populate fields of struture and append to itab
append wa_t_vacsplt to it_t_vacsplt.

"populate fields of struture and append to itab
append wa_t_vspltwt to it_t_vspltwt. . CALL FUNCTION 'PRELIMINARY_POSTING_DOC_WRITE' * EXPORTING * i_uf05a = ld_i_uf05a * i_bstat = ld_i_bstat TABLES t_vbkpf = it_t_vbkpf t_vbsec = it_t_vbsec t_vbseg = it_t_vbseg t_vbset = it_t_vbset * t_vacsplt = it_t_vacsplt * t_vspltwt = it_t_vspltwt EXCEPTIONS ABNORMAL_TERMINATION = 1 INSERT_ERROR = 2 UPDATE_ERROR = 3 READ_ERROR = 4 . " PRELIMINARY_POSTING_DOC_WRITE
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here 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_i_uf05a  TYPE UF05A ,
it_t_vbkpf  TYPE STANDARD TABLE OF FVBKPF ,
wa_t_vbkpf  LIKE LINE OF it_t_vbkpf,
ld_i_bstat  TYPE BKPF-BSTAT ,
it_t_vbsec  TYPE STANDARD TABLE OF FVBSEC ,
wa_t_vbsec  LIKE LINE OF it_t_vbsec,
it_t_vbseg  TYPE STANDARD TABLE OF FVBSEG ,
wa_t_vbseg  LIKE LINE OF it_t_vbseg,
it_t_vbset  TYPE STANDARD TABLE OF FVBSET ,
wa_t_vbset  LIKE LINE OF it_t_vbset,
it_t_vacsplt  TYPE STANDARD TABLE OF FVACSPLT ,
wa_t_vacsplt  LIKE LINE OF it_t_vacsplt,
it_t_vspltwt  TYPE STANDARD TABLE OF VSPLTWT ,
wa_t_vspltwt  LIKE LINE OF it_t_vspltwt.

ld_i_uf05a = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_vbkpf to it_t_vbkpf.

SELECT single BSTAT
FROM BKPF
INTO ld_i_bstat.


"populate fields of struture and append to itab
append wa_t_vbsec to it_t_vbsec.

"populate fields of struture and append to itab
append wa_t_vbseg to it_t_vbseg.

"populate fields of struture and append to itab
append wa_t_vbset to it_t_vbset.

"populate fields of struture and append to itab
append wa_t_vacsplt to it_t_vacsplt.

"populate fields of struture and append to itab
append wa_t_vspltwt to it_t_vspltwt.

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 PRELIMINARY_POSTING_DOC_WRITE or its description.