SAP Function Modules

PP_WRAP_DOCUMENT_ENJ SAP Function module







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

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


Pattern for FM PP_WRAP_DOCUMENT_ENJ - PP WRAP DOCUMENT ENJ





CALL FUNCTION 'PP_WRAP_DOCUMENT_ENJ' "
  EXPORTING
    i_belnr =                   " vbkpf-belnr
    i_bukrs =                   " vbkpf-bukrs
    i_gjahr =                   " vbkpf-gjahr
*   i_funcl = 'U'               " t020-funcl    Function class
  IMPORTING
    e_xwffr =                   " xwffr         Required Release
    e_xfrge =                   " xfrge         Release carried out
    e_upddt =                   " upddt         Date of the Last Document Update
    e_reldt =                   " releasedate   Release Date
    e_updtm =                   " cputm         Time data was entered at
    e_reltm =                   " cputm         Time data was entered at
    e_xprfg =                   " xprfg         Document Complete
    e_pargb =                   " pargb         Partner Business Area
* TABLES
*   t_xbkpf =                   " bkpf
*   t_xbsec =                   " bsec
*   t_xbseg =                   " bseg
*   t_xbset =                   " bset
*   t_xbsez =                   " bsez          Line Item Additional Information (Online)
*   t_splttab =                 " acsplt        Carrier for Split Information re: Current Account Line Items
*   t_spltwt =                  " with_itemx    Auxiliary structure for table WITH_ITEM
  EXCEPTIONS
    CANCELLED = 1               "
    DOCUMENT_DISPLAYED = 2      "
    FOREIGN_LOCK = 3            "               Document is locked
    .  "  PP_WRAP_DOCUMENT_ENJ

ABAP code example for Function Module PP_WRAP_DOCUMENT_ENJ





The ABAP code below is a full code listing to execute function module PP_WRAP_DOCUMENT_ENJ 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:
ld_e_xwffr  TYPE XWFFR ,
ld_e_xfrge  TYPE XFRGE ,
ld_e_upddt  TYPE UPDDT ,
ld_e_reldt  TYPE RELEASEDATE ,
ld_e_updtm  TYPE CPUTM ,
ld_e_reltm  TYPE CPUTM ,
ld_e_xprfg  TYPE XPRFG ,
ld_e_pargb  TYPE PARGB ,
it_t_xbkpf  TYPE STANDARD TABLE OF BKPF,"TABLES PARAM
wa_t_xbkpf  LIKE LINE OF it_t_xbkpf ,
it_t_xbsec  TYPE STANDARD TABLE OF BSEC,"TABLES PARAM
wa_t_xbsec  LIKE LINE OF it_t_xbsec ,
it_t_xbseg  TYPE STANDARD TABLE OF BSEG,"TABLES PARAM
wa_t_xbseg  LIKE LINE OF it_t_xbseg ,
it_t_xbset  TYPE STANDARD TABLE OF BSET,"TABLES PARAM
wa_t_xbset  LIKE LINE OF it_t_xbset ,
it_t_xbsez  TYPE STANDARD TABLE OF BSEZ,"TABLES PARAM
wa_t_xbsez  LIKE LINE OF it_t_xbsez ,
it_t_splttab  TYPE STANDARD TABLE OF ACSPLT,"TABLES PARAM
wa_t_splttab  LIKE LINE OF it_t_splttab ,
it_t_spltwt  TYPE STANDARD TABLE OF WITH_ITEMX,"TABLES PARAM
wa_t_spltwt  LIKE LINE OF it_t_spltwt .


SELECT single BELNR
FROM VBKPF
INTO @DATA(ld_i_belnr).


SELECT single BUKRS
FROM VBKPF
INTO @DATA(ld_i_bukrs).


SELECT single GJAHR
FROM VBKPF
INTO @DATA(ld_i_gjahr).


SELECT single FUNCL
FROM T020
INTO @DATA(ld_i_funcl).


"populate fields of struture and append to itab
append wa_t_xbkpf to it_t_xbkpf.

"populate fields of struture and append to itab
append wa_t_xbsec to it_t_xbsec.

"populate fields of struture and append to itab
append wa_t_xbseg to it_t_xbseg.

"populate fields of struture and append to itab
append wa_t_xbset to it_t_xbset.

"populate fields of struture and append to itab
append wa_t_xbsez to it_t_xbsez.

"populate fields of struture and append to itab
append wa_t_splttab to it_t_splttab.

"populate fields of struture and append to itab
append wa_t_spltwt to it_t_spltwt. . CALL FUNCTION 'PP_WRAP_DOCUMENT_ENJ' EXPORTING i_belnr = ld_i_belnr i_bukrs = ld_i_bukrs i_gjahr = ld_i_gjahr * i_funcl = ld_i_funcl IMPORTING e_xwffr = ld_e_xwffr e_xfrge = ld_e_xfrge e_upddt = ld_e_upddt e_reldt = ld_e_reldt e_updtm = ld_e_updtm e_reltm = ld_e_reltm e_xprfg = ld_e_xprfg e_pargb = ld_e_pargb * TABLES * t_xbkpf = it_t_xbkpf * t_xbsec = it_t_xbsec * t_xbseg = it_t_xbseg * t_xbset = it_t_xbset * t_xbsez = it_t_xbsez * t_splttab = it_t_splttab * t_spltwt = it_t_spltwt EXCEPTIONS CANCELLED = 1 DOCUMENT_DISPLAYED = 2 FOREIGN_LOCK = 3 . " PP_WRAP_DOCUMENT_ENJ
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 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_e_xwffr  TYPE XWFFR ,
it_t_xbkpf  TYPE STANDARD TABLE OF BKPF ,
wa_t_xbkpf  LIKE LINE OF it_t_xbkpf,
ld_i_belnr  TYPE VBKPF-BELNR ,
ld_e_xfrge  TYPE XFRGE ,
it_t_xbsec  TYPE STANDARD TABLE OF BSEC ,
wa_t_xbsec  LIKE LINE OF it_t_xbsec,
ld_i_bukrs  TYPE VBKPF-BUKRS ,
it_t_xbseg  TYPE STANDARD TABLE OF BSEG ,
wa_t_xbseg  LIKE LINE OF it_t_xbseg,
ld_i_gjahr  TYPE VBKPF-GJAHR ,
ld_e_upddt  TYPE UPDDT ,
ld_i_funcl  TYPE T020-FUNCL ,
it_t_xbset  TYPE STANDARD TABLE OF BSET ,
wa_t_xbset  LIKE LINE OF it_t_xbset,
ld_e_reldt  TYPE RELEASEDATE ,
it_t_xbsez  TYPE STANDARD TABLE OF BSEZ ,
wa_t_xbsez  LIKE LINE OF it_t_xbsez,
ld_e_updtm  TYPE CPUTM ,
ld_e_reltm  TYPE CPUTM ,
it_t_splttab  TYPE STANDARD TABLE OF ACSPLT ,
wa_t_splttab  LIKE LINE OF it_t_splttab,
ld_e_xprfg  TYPE XPRFG ,
it_t_spltwt  TYPE STANDARD TABLE OF WITH_ITEMX ,
wa_t_spltwt  LIKE LINE OF it_t_spltwt,
ld_e_pargb  TYPE PARGB .


"populate fields of struture and append to itab
append wa_t_xbkpf to it_t_xbkpf.

SELECT single BELNR
FROM VBKPF
INTO ld_i_belnr.


"populate fields of struture and append to itab
append wa_t_xbsec to it_t_xbsec.

SELECT single BUKRS
FROM VBKPF
INTO ld_i_bukrs.


"populate fields of struture and append to itab
append wa_t_xbseg to it_t_xbseg.

SELECT single GJAHR
FROM VBKPF
INTO ld_i_gjahr.


SELECT single FUNCL
FROM T020
INTO ld_i_funcl.


"populate fields of struture and append to itab
append wa_t_xbset to it_t_xbset.

"populate fields of struture and append to itab
append wa_t_xbsez to it_t_xbsez.

"populate fields of struture and append to itab
append wa_t_splttab to it_t_splttab.

"populate fields of struture and append to itab
append wa_t_spltwt to it_t_spltwt.

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