SAP Function Modules

TTE_4_DOCUMENT_UPDATE SAP Function module - Save Update Task for TTE Document







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

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


Pattern for FM TTE_4_DOCUMENT_UPDATE - TTE 4 DOCUMENT UPDATE





CALL FUNCTION 'TTE_4_DOCUMENT_UPDATE' "Save Update Task for TTE Document
  EXPORTING
    i_document_atr =            " ttepdt_document  Document data
    i_document_atr_old =        " ttepdt_document  Document data
    modus =                     " ttet_xflag_pd  X=Create, Space=Change
* TABLES
*   it_header =                 " ttepdt_header  Document header
*   it_item =                   " ttepdt_item   Input item
*   it_tranprop =               " ttepdt_tranprop  Document  transaction property
*   it_orgunit =                " ttepdt_orgunit  Document  org unit
*   it_itempart =               " ttepdt_itempart  Document  item  partner
*   it_pricel =                 " ttepdt_pricel  Document / Item pricing element
*   it_taxdate =                " ttepdt_taxdate  Document tax date
*   it_taxevent =               " ttepdt_taxevent  Document / Item tax event
*   it_taxel =                  " ttepdt_taxel  Document / Item tax element
*   it_taxvalue =               " ttepdt_taxvalue  Document / Item tax value
*   it_product =                " ttepdt_product  Document product
*   it_prtaxcl =                " ttepdt_prtaxcl  Document product tax class.
*   it_prprop =                 " ttepdt_prprop  Document product property
*   it_partner =                " ttepdt_partner  Document business partner
*   it_pataxcl =                " ttepdt_pataxcl  Document business partner tax class.
*   it_paprop =                 " ttepdt_paprop  Document business partner property
*   it_pataxnum =               " ttepdt_pataxnum  Document business partner tax number
*   it_currconv =               " ttepdt_currconv  Document  curruncy conversion
*   it_countries =              " ttepdt_countries  Document business partner
*   it_text =                   " ttepdt_text   Document  document textes
*   it_exempt =                 " ttepdt_exempt  Output Exemptions
*   it_taxcodva =               " ttepdt_taxcodva  TaxCode Value
*   it_paexempvalu =            " ttepdt_exempvalu  Document Item Exemption Value
  EXCEPTIONS
    DATABASE_INSERT_FAILURE = 1  "
    .  "  TTE_4_DOCUMENT_UPDATE

ABAP code example for Function Module TTE_4_DOCUMENT_UPDATE





The ABAP code below is a full code listing to execute function module TTE_4_DOCUMENT_UPDATE 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_it_header  TYPE STANDARD TABLE OF TTEPDT_HEADER,"TABLES PARAM
wa_it_header  LIKE LINE OF it_it_header ,
it_it_item  TYPE STANDARD TABLE OF TTEPDT_ITEM,"TABLES PARAM
wa_it_item  LIKE LINE OF it_it_item ,
it_it_tranprop  TYPE STANDARD TABLE OF TTEPDT_TRANPROP,"TABLES PARAM
wa_it_tranprop  LIKE LINE OF it_it_tranprop ,
it_it_orgunit  TYPE STANDARD TABLE OF TTEPDT_ORGUNIT,"TABLES PARAM
wa_it_orgunit  LIKE LINE OF it_it_orgunit ,
it_it_itempart  TYPE STANDARD TABLE OF TTEPDT_ITEMPART,"TABLES PARAM
wa_it_itempart  LIKE LINE OF it_it_itempart ,
it_it_pricel  TYPE STANDARD TABLE OF TTEPDT_PRICEL,"TABLES PARAM
wa_it_pricel  LIKE LINE OF it_it_pricel ,
it_it_taxdate  TYPE STANDARD TABLE OF TTEPDT_TAXDATE,"TABLES PARAM
wa_it_taxdate  LIKE LINE OF it_it_taxdate ,
it_it_taxevent  TYPE STANDARD TABLE OF TTEPDT_TAXEVENT,"TABLES PARAM
wa_it_taxevent  LIKE LINE OF it_it_taxevent ,
it_it_taxel  TYPE STANDARD TABLE OF TTEPDT_TAXEL,"TABLES PARAM
wa_it_taxel  LIKE LINE OF it_it_taxel ,
it_it_taxvalue  TYPE STANDARD TABLE OF TTEPDT_TAXVALUE,"TABLES PARAM
wa_it_taxvalue  LIKE LINE OF it_it_taxvalue ,
it_it_product  TYPE STANDARD TABLE OF TTEPDT_PRODUCT,"TABLES PARAM
wa_it_product  LIKE LINE OF it_it_product ,
it_it_prtaxcl  TYPE STANDARD TABLE OF TTEPDT_PRTAXCL,"TABLES PARAM
wa_it_prtaxcl  LIKE LINE OF it_it_prtaxcl ,
it_it_prprop  TYPE STANDARD TABLE OF TTEPDT_PRPROP,"TABLES PARAM
wa_it_prprop  LIKE LINE OF it_it_prprop ,
it_it_partner  TYPE STANDARD TABLE OF TTEPDT_PARTNER,"TABLES PARAM
wa_it_partner  LIKE LINE OF it_it_partner ,
it_it_pataxcl  TYPE STANDARD TABLE OF TTEPDT_PATAXCL,"TABLES PARAM
wa_it_pataxcl  LIKE LINE OF it_it_pataxcl ,
it_it_paprop  TYPE STANDARD TABLE OF TTEPDT_PAPROP,"TABLES PARAM
wa_it_paprop  LIKE LINE OF it_it_paprop ,
it_it_pataxnum  TYPE STANDARD TABLE OF TTEPDT_PATAXNUM,"TABLES PARAM
wa_it_pataxnum  LIKE LINE OF it_it_pataxnum ,
it_it_currconv  TYPE STANDARD TABLE OF TTEPDT_CURRCONV,"TABLES PARAM
wa_it_currconv  LIKE LINE OF it_it_currconv ,
it_it_countries  TYPE STANDARD TABLE OF TTEPDT_COUNTRIES,"TABLES PARAM
wa_it_countries  LIKE LINE OF it_it_countries ,
it_it_text  TYPE STANDARD TABLE OF TTEPDT_TEXT,"TABLES PARAM
wa_it_text  LIKE LINE OF it_it_text ,
it_it_exempt  TYPE STANDARD TABLE OF TTEPDT_EXEMPT,"TABLES PARAM
wa_it_exempt  LIKE LINE OF it_it_exempt ,
it_it_taxcodva  TYPE STANDARD TABLE OF TTEPDT_TAXCODVA,"TABLES PARAM
wa_it_taxcodva  LIKE LINE OF it_it_taxcodva ,
it_it_paexempvalu  TYPE STANDARD TABLE OF TTEPDT_EXEMPVALU,"TABLES PARAM
wa_it_paexempvalu  LIKE LINE OF it_it_paexempvalu .

DATA(ld_i_document_atr) = 'Check type of data required'.
DATA(ld_i_document_atr_old) = 'Check type of data required'.
DATA(ld_modus) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_header to it_it_header.

"populate fields of struture and append to itab
append wa_it_item to it_it_item.

"populate fields of struture and append to itab
append wa_it_tranprop to it_it_tranprop.

"populate fields of struture and append to itab
append wa_it_orgunit to it_it_orgunit.

"populate fields of struture and append to itab
append wa_it_itempart to it_it_itempart.

"populate fields of struture and append to itab
append wa_it_pricel to it_it_pricel.

"populate fields of struture and append to itab
append wa_it_taxdate to it_it_taxdate.

"populate fields of struture and append to itab
append wa_it_taxevent to it_it_taxevent.

"populate fields of struture and append to itab
append wa_it_taxel to it_it_taxel.

"populate fields of struture and append to itab
append wa_it_taxvalue to it_it_taxvalue.

"populate fields of struture and append to itab
append wa_it_product to it_it_product.

"populate fields of struture and append to itab
append wa_it_prtaxcl to it_it_prtaxcl.

"populate fields of struture and append to itab
append wa_it_prprop to it_it_prprop.

"populate fields of struture and append to itab
append wa_it_partner to it_it_partner.

"populate fields of struture and append to itab
append wa_it_pataxcl to it_it_pataxcl.

"populate fields of struture and append to itab
append wa_it_paprop to it_it_paprop.

"populate fields of struture and append to itab
append wa_it_pataxnum to it_it_pataxnum.

"populate fields of struture and append to itab
append wa_it_currconv to it_it_currconv.

"populate fields of struture and append to itab
append wa_it_countries to it_it_countries.

"populate fields of struture and append to itab
append wa_it_text to it_it_text.

"populate fields of struture and append to itab
append wa_it_exempt to it_it_exempt.

"populate fields of struture and append to itab
append wa_it_taxcodva to it_it_taxcodva.

"populate fields of struture and append to itab
append wa_it_paexempvalu to it_it_paexempvalu. . CALL FUNCTION 'TTE_4_DOCUMENT_UPDATE' EXPORTING i_document_atr = ld_i_document_atr i_document_atr_old = ld_i_document_atr_old modus = ld_modus * TABLES * it_header = it_it_header * it_item = it_it_item * it_tranprop = it_it_tranprop * it_orgunit = it_it_orgunit * it_itempart = it_it_itempart * it_pricel = it_it_pricel * it_taxdate = it_it_taxdate * it_taxevent = it_it_taxevent * it_taxel = it_it_taxel * it_taxvalue = it_it_taxvalue * it_product = it_it_product * it_prtaxcl = it_it_prtaxcl * it_prprop = it_it_prprop * it_partner = it_it_partner * it_pataxcl = it_it_pataxcl * it_paprop = it_it_paprop * it_pataxnum = it_it_pataxnum * it_currconv = it_it_currconv * it_countries = it_it_countries * it_text = it_it_text * it_exempt = it_it_exempt * it_taxcodva = it_it_taxcodva * it_paexempvalu = it_it_paexempvalu EXCEPTIONS DATABASE_INSERT_FAILURE = 1 . " TTE_4_DOCUMENT_UPDATE
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "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_document_atr  TYPE TTEPDT_DOCUMENT ,
it_it_header  TYPE STANDARD TABLE OF TTEPDT_HEADER ,
wa_it_header  LIKE LINE OF it_it_header,
ld_i_document_atr_old  TYPE TTEPDT_DOCUMENT ,
it_it_item  TYPE STANDARD TABLE OF TTEPDT_ITEM ,
wa_it_item  LIKE LINE OF it_it_item,
ld_modus  TYPE TTET_XFLAG_PD ,
it_it_tranprop  TYPE STANDARD TABLE OF TTEPDT_TRANPROP ,
wa_it_tranprop  LIKE LINE OF it_it_tranprop,
it_it_orgunit  TYPE STANDARD TABLE OF TTEPDT_ORGUNIT ,
wa_it_orgunit  LIKE LINE OF it_it_orgunit,
it_it_itempart  TYPE STANDARD TABLE OF TTEPDT_ITEMPART ,
wa_it_itempart  LIKE LINE OF it_it_itempart,
it_it_pricel  TYPE STANDARD TABLE OF TTEPDT_PRICEL ,
wa_it_pricel  LIKE LINE OF it_it_pricel,
it_it_taxdate  TYPE STANDARD TABLE OF TTEPDT_TAXDATE ,
wa_it_taxdate  LIKE LINE OF it_it_taxdate,
it_it_taxevent  TYPE STANDARD TABLE OF TTEPDT_TAXEVENT ,
wa_it_taxevent  LIKE LINE OF it_it_taxevent,
it_it_taxel  TYPE STANDARD TABLE OF TTEPDT_TAXEL ,
wa_it_taxel  LIKE LINE OF it_it_taxel,
it_it_taxvalue  TYPE STANDARD TABLE OF TTEPDT_TAXVALUE ,
wa_it_taxvalue  LIKE LINE OF it_it_taxvalue,
it_it_product  TYPE STANDARD TABLE OF TTEPDT_PRODUCT ,
wa_it_product  LIKE LINE OF it_it_product,
it_it_prtaxcl  TYPE STANDARD TABLE OF TTEPDT_PRTAXCL ,
wa_it_prtaxcl  LIKE LINE OF it_it_prtaxcl,
it_it_prprop  TYPE STANDARD TABLE OF TTEPDT_PRPROP ,
wa_it_prprop  LIKE LINE OF it_it_prprop,
it_it_partner  TYPE STANDARD TABLE OF TTEPDT_PARTNER ,
wa_it_partner  LIKE LINE OF it_it_partner,
it_it_pataxcl  TYPE STANDARD TABLE OF TTEPDT_PATAXCL ,
wa_it_pataxcl  LIKE LINE OF it_it_pataxcl,
it_it_paprop  TYPE STANDARD TABLE OF TTEPDT_PAPROP ,
wa_it_paprop  LIKE LINE OF it_it_paprop,
it_it_pataxnum  TYPE STANDARD TABLE OF TTEPDT_PATAXNUM ,
wa_it_pataxnum  LIKE LINE OF it_it_pataxnum,
it_it_currconv  TYPE STANDARD TABLE OF TTEPDT_CURRCONV ,
wa_it_currconv  LIKE LINE OF it_it_currconv,
it_it_countries  TYPE STANDARD TABLE OF TTEPDT_COUNTRIES ,
wa_it_countries  LIKE LINE OF it_it_countries,
it_it_text  TYPE STANDARD TABLE OF TTEPDT_TEXT ,
wa_it_text  LIKE LINE OF it_it_text,
it_it_exempt  TYPE STANDARD TABLE OF TTEPDT_EXEMPT ,
wa_it_exempt  LIKE LINE OF it_it_exempt,
it_it_taxcodva  TYPE STANDARD TABLE OF TTEPDT_TAXCODVA ,
wa_it_taxcodva  LIKE LINE OF it_it_taxcodva,
it_it_paexempvalu  TYPE STANDARD TABLE OF TTEPDT_EXEMPVALU ,
wa_it_paexempvalu  LIKE LINE OF it_it_paexempvalu.

ld_i_document_atr = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_header to it_it_header.
ld_i_document_atr_old = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_item to it_it_item.
ld_modus = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_tranprop to it_it_tranprop.

"populate fields of struture and append to itab
append wa_it_orgunit to it_it_orgunit.

"populate fields of struture and append to itab
append wa_it_itempart to it_it_itempart.

"populate fields of struture and append to itab
append wa_it_pricel to it_it_pricel.

"populate fields of struture and append to itab
append wa_it_taxdate to it_it_taxdate.

"populate fields of struture and append to itab
append wa_it_taxevent to it_it_taxevent.

"populate fields of struture and append to itab
append wa_it_taxel to it_it_taxel.

"populate fields of struture and append to itab
append wa_it_taxvalue to it_it_taxvalue.

"populate fields of struture and append to itab
append wa_it_product to it_it_product.

"populate fields of struture and append to itab
append wa_it_prtaxcl to it_it_prtaxcl.

"populate fields of struture and append to itab
append wa_it_prprop to it_it_prprop.

"populate fields of struture and append to itab
append wa_it_partner to it_it_partner.

"populate fields of struture and append to itab
append wa_it_pataxcl to it_it_pataxcl.

"populate fields of struture and append to itab
append wa_it_paprop to it_it_paprop.

"populate fields of struture and append to itab
append wa_it_pataxnum to it_it_pataxnum.

"populate fields of struture and append to itab
append wa_it_currconv to it_it_currconv.

"populate fields of struture and append to itab
append wa_it_countries to it_it_countries.

"populate fields of struture and append to itab
append wa_it_text to it_it_text.

"populate fields of struture and append to itab
append wa_it_exempt to it_it_exempt.

"populate fields of struture and append to itab
append wa_it_taxcodva to it_it_taxcodva.

"populate fields of struture and append to itab
append wa_it_paexempvalu to it_it_paexempvalu.

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