SAP Function Modules

TTE_3_DOCUMENT_GET SAP Function module - Get TTE Document







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

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


Pattern for FM TTE_3_DOCUMENT_GET - TTE 3 DOCUMENT GET





CALL FUNCTION 'TTE_3_DOCUMENT_GET' "Get TTE Document
  EXPORTING
    i_handle =                  " ttepdt_save_handle_st  Document header
*   i_with_usitems = 'Y'        " c
*   i_read_from_tte = 'X'       " c             Flag space= Read from DB
  IMPORTING
    o_document_atr =            " ttepd3_document  TTE Persistency Document
  TABLES
    it_header =                 " ttet_i_head_com  Header
    it_item =                   " ttet_i_item_com  Item
    it_product =                " ttet_it_product_com  Product
    it_productusage =           " ttet_i_prousag_com  ProductUsage
    it_partner =                " ttet_i_partner_com  Partner
    it_partnertaxnumber =       " ttet_i_pataxno_com  PartnerTaxNumber
    it_pricingelement =         " ttet_it_prieles_com  Pricing Element
    it_exemption =              " ttet_it_exemption_com  Exemptions
    it_taxclassification =      " ttet_i_taxclas_com  TaxClassification
    it_currencyconversion =     " ttet_it_currcon_com  CurrencyConversions
    it_reportingfield =         " ttet_i_repflds_com  Reporting Field
    it_taxsituation =           " ttet_io_taxsitu_com  TaxSituation
    it_taxdetermination =       " ttet_i_taxdete_com  TaxDetermination
    ot_header =                 " ttet_o_head_com  Header
    ot_item =                   " ttet_o_item_com  Item
    ot_taxelement =             " ttet_o_taxele_com  TaxElement
    ot_taxvalue =               " ttet_ot_taxval_com  TaxValue
    ot_taxsituation =           " ttet_io_taxsitu_com  TaxSituation
    ot_currencyconversion =     " ttet_it_currcon_com  CurrencyConversions
    ot_exemption =              " ttet_it_exemption_com  Exemptions
    ot_partner =                " ttet_i_partner_com  Partner
    ot_partnertaxnumber =       " ttet_i_pataxno_com  PartnerTaxNumber
    ot_taxclassification =      " ttet_i_taxclas_com  TaxClassification
    ot_traceentry =             " ttet_o_trace_com  Header
    ot_us_tax =                 " ttet_uscom_tax_com  US Tax Interface : Communication Structure for Tax Calc.
  EXCEPTIONS
    COMMUNICATION_FAILURE = 1   "               RFC error
    NO_TTE_DOCUMENT = 2         "               TTE document does not exist
    SYSTEM_FAILURE = 3          "               System failure
    IMPORT_ERROR = 4            "               Problems with IMPORT from cluster
    OTHERS = 5                  "               Others
    .  "  TTE_3_DOCUMENT_GET

ABAP code example for Function Module TTE_3_DOCUMENT_GET





The ABAP code below is a full code listing to execute function module TTE_3_DOCUMENT_GET 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_o_document_atr  TYPE TTEPD3_DOCUMENT ,
it_it_header  TYPE STANDARD TABLE OF TTET_I_HEAD_COM,"TABLES PARAM
wa_it_header  LIKE LINE OF it_it_header ,
it_it_item  TYPE STANDARD TABLE OF TTET_I_ITEM_COM,"TABLES PARAM
wa_it_item  LIKE LINE OF it_it_item ,
it_it_product  TYPE STANDARD TABLE OF TTET_IT_PRODUCT_COM,"TABLES PARAM
wa_it_product  LIKE LINE OF it_it_product ,
it_it_productusage  TYPE STANDARD TABLE OF TTET_I_PROUSAG_COM,"TABLES PARAM
wa_it_productusage  LIKE LINE OF it_it_productusage ,
it_it_partner  TYPE STANDARD TABLE OF TTET_I_PARTNER_COM,"TABLES PARAM
wa_it_partner  LIKE LINE OF it_it_partner ,
it_it_partnertaxnumber  TYPE STANDARD TABLE OF TTET_I_PATAXNO_COM,"TABLES PARAM
wa_it_partnertaxnumber  LIKE LINE OF it_it_partnertaxnumber ,
it_it_pricingelement  TYPE STANDARD TABLE OF TTET_IT_PRIELES_COM,"TABLES PARAM
wa_it_pricingelement  LIKE LINE OF it_it_pricingelement ,
it_it_exemption  TYPE STANDARD TABLE OF TTET_IT_EXEMPTION_COM,"TABLES PARAM
wa_it_exemption  LIKE LINE OF it_it_exemption ,
it_it_taxclassification  TYPE STANDARD TABLE OF TTET_I_TAXCLAS_COM,"TABLES PARAM
wa_it_taxclassification  LIKE LINE OF it_it_taxclassification ,
it_it_currencyconversion  TYPE STANDARD TABLE OF TTET_IT_CURRCON_COM,"TABLES PARAM
wa_it_currencyconversion  LIKE LINE OF it_it_currencyconversion ,
it_it_reportingfield  TYPE STANDARD TABLE OF TTET_I_REPFLDS_COM,"TABLES PARAM
wa_it_reportingfield  LIKE LINE OF it_it_reportingfield ,
it_it_taxsituation  TYPE STANDARD TABLE OF TTET_IO_TAXSITU_COM,"TABLES PARAM
wa_it_taxsituation  LIKE LINE OF it_it_taxsituation ,
it_it_taxdetermination  TYPE STANDARD TABLE OF TTET_I_TAXDETE_COM,"TABLES PARAM
wa_it_taxdetermination  LIKE LINE OF it_it_taxdetermination ,
it_ot_header  TYPE STANDARD TABLE OF TTET_O_HEAD_COM,"TABLES PARAM
wa_ot_header  LIKE LINE OF it_ot_header ,
it_ot_item  TYPE STANDARD TABLE OF TTET_O_ITEM_COM,"TABLES PARAM
wa_ot_item  LIKE LINE OF it_ot_item ,
it_ot_taxelement  TYPE STANDARD TABLE OF TTET_O_TAXELE_COM,"TABLES PARAM
wa_ot_taxelement  LIKE LINE OF it_ot_taxelement ,
it_ot_taxvalue  TYPE STANDARD TABLE OF TTET_OT_TAXVAL_COM,"TABLES PARAM
wa_ot_taxvalue  LIKE LINE OF it_ot_taxvalue ,
it_ot_taxsituation  TYPE STANDARD TABLE OF TTET_IO_TAXSITU_COM,"TABLES PARAM
wa_ot_taxsituation  LIKE LINE OF it_ot_taxsituation ,
it_ot_currencyconversion  TYPE STANDARD TABLE OF TTET_IT_CURRCON_COM,"TABLES PARAM
wa_ot_currencyconversion  LIKE LINE OF it_ot_currencyconversion ,
it_ot_exemption  TYPE STANDARD TABLE OF TTET_IT_EXEMPTION_COM,"TABLES PARAM
wa_ot_exemption  LIKE LINE OF it_ot_exemption ,
it_ot_partner  TYPE STANDARD TABLE OF TTET_I_PARTNER_COM,"TABLES PARAM
wa_ot_partner  LIKE LINE OF it_ot_partner ,
it_ot_partnertaxnumber  TYPE STANDARD TABLE OF TTET_I_PATAXNO_COM,"TABLES PARAM
wa_ot_partnertaxnumber  LIKE LINE OF it_ot_partnertaxnumber ,
it_ot_taxclassification  TYPE STANDARD TABLE OF TTET_I_TAXCLAS_COM,"TABLES PARAM
wa_ot_taxclassification  LIKE LINE OF it_ot_taxclassification ,
it_ot_traceentry  TYPE STANDARD TABLE OF TTET_O_TRACE_COM,"TABLES PARAM
wa_ot_traceentry  LIKE LINE OF it_ot_traceentry ,
it_ot_us_tax  TYPE STANDARD TABLE OF TTET_USCOM_TAX_COM,"TABLES PARAM
wa_ot_us_tax  LIKE LINE OF it_ot_us_tax .

DATA(ld_i_handle) = 'Check type of data required'.
DATA(ld_i_with_usitems) = 'Check type of data required'.
DATA(ld_i_read_from_tte) = '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_product to it_it_product.

"populate fields of struture and append to itab
append wa_it_productusage to it_it_productusage.

"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_partnertaxnumber to it_it_partnertaxnumber.

"populate fields of struture and append to itab
append wa_it_pricingelement to it_it_pricingelement.

"populate fields of struture and append to itab
append wa_it_exemption to it_it_exemption.

"populate fields of struture and append to itab
append wa_it_taxclassification to it_it_taxclassification.

"populate fields of struture and append to itab
append wa_it_currencyconversion to it_it_currencyconversion.

"populate fields of struture and append to itab
append wa_it_reportingfield to it_it_reportingfield.

"populate fields of struture and append to itab
append wa_it_taxsituation to it_it_taxsituation.

"populate fields of struture and append to itab
append wa_it_taxdetermination to it_it_taxdetermination.

"populate fields of struture and append to itab
append wa_ot_header to it_ot_header.

"populate fields of struture and append to itab
append wa_ot_item to it_ot_item.

"populate fields of struture and append to itab
append wa_ot_taxelement to it_ot_taxelement.

"populate fields of struture and append to itab
append wa_ot_taxvalue to it_ot_taxvalue.

"populate fields of struture and append to itab
append wa_ot_taxsituation to it_ot_taxsituation.

"populate fields of struture and append to itab
append wa_ot_currencyconversion to it_ot_currencyconversion.

"populate fields of struture and append to itab
append wa_ot_exemption to it_ot_exemption.

"populate fields of struture and append to itab
append wa_ot_partner to it_ot_partner.

"populate fields of struture and append to itab
append wa_ot_partnertaxnumber to it_ot_partnertaxnumber.

"populate fields of struture and append to itab
append wa_ot_taxclassification to it_ot_taxclassification.

"populate fields of struture and append to itab
append wa_ot_traceentry to it_ot_traceentry.

"populate fields of struture and append to itab
append wa_ot_us_tax to it_ot_us_tax. . CALL FUNCTION 'TTE_3_DOCUMENT_GET' EXPORTING i_handle = ld_i_handle * i_with_usitems = ld_i_with_usitems * i_read_from_tte = ld_i_read_from_tte IMPORTING o_document_atr = ld_o_document_atr TABLES it_header = it_it_header it_item = it_it_item it_product = it_it_product it_productusage = it_it_productusage it_partner = it_it_partner it_partnertaxnumber = it_it_partnertaxnumber it_pricingelement = it_it_pricingelement it_exemption = it_it_exemption it_taxclassification = it_it_taxclassification it_currencyconversion = it_it_currencyconversion it_reportingfield = it_it_reportingfield it_taxsituation = it_it_taxsituation it_taxdetermination = it_it_taxdetermination ot_header = it_ot_header ot_item = it_ot_item ot_taxelement = it_ot_taxelement ot_taxvalue = it_ot_taxvalue ot_taxsituation = it_ot_taxsituation ot_currencyconversion = it_ot_currencyconversion ot_exemption = it_ot_exemption ot_partner = it_ot_partner ot_partnertaxnumber = it_ot_partnertaxnumber ot_taxclassification = it_ot_taxclassification ot_traceentry = it_ot_traceentry ot_us_tax = it_ot_us_tax EXCEPTIONS COMMUNICATION_FAILURE = 1 NO_TTE_DOCUMENT = 2 SYSTEM_FAILURE = 3 IMPORT_ERROR = 4 OTHERS = 5 . " TTE_3_DOCUMENT_GET
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 ELSEIF SY-SUBRC EQ 5. "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_o_document_atr  TYPE TTEPD3_DOCUMENT ,
ld_i_handle  TYPE TTEPDT_SAVE_HANDLE_ST ,
it_it_header  TYPE STANDARD TABLE OF TTET_I_HEAD_COM ,
wa_it_header  LIKE LINE OF it_it_header,
ld_i_with_usitems  TYPE C ,
it_it_item  TYPE STANDARD TABLE OF TTET_I_ITEM_COM ,
wa_it_item  LIKE LINE OF it_it_item,
ld_i_read_from_tte  TYPE C ,
it_it_product  TYPE STANDARD TABLE OF TTET_IT_PRODUCT_COM ,
wa_it_product  LIKE LINE OF it_it_product,
it_it_productusage  TYPE STANDARD TABLE OF TTET_I_PROUSAG_COM ,
wa_it_productusage  LIKE LINE OF it_it_productusage,
it_it_partner  TYPE STANDARD TABLE OF TTET_I_PARTNER_COM ,
wa_it_partner  LIKE LINE OF it_it_partner,
it_it_partnertaxnumber  TYPE STANDARD TABLE OF TTET_I_PATAXNO_COM ,
wa_it_partnertaxnumber  LIKE LINE OF it_it_partnertaxnumber,
it_it_pricingelement  TYPE STANDARD TABLE OF TTET_IT_PRIELES_COM ,
wa_it_pricingelement  LIKE LINE OF it_it_pricingelement,
it_it_exemption  TYPE STANDARD TABLE OF TTET_IT_EXEMPTION_COM ,
wa_it_exemption  LIKE LINE OF it_it_exemption,
it_it_taxclassification  TYPE STANDARD TABLE OF TTET_I_TAXCLAS_COM ,
wa_it_taxclassification  LIKE LINE OF it_it_taxclassification,
it_it_currencyconversion  TYPE STANDARD TABLE OF TTET_IT_CURRCON_COM ,
wa_it_currencyconversion  LIKE LINE OF it_it_currencyconversion,
it_it_reportingfield  TYPE STANDARD TABLE OF TTET_I_REPFLDS_COM ,
wa_it_reportingfield  LIKE LINE OF it_it_reportingfield,
it_it_taxsituation  TYPE STANDARD TABLE OF TTET_IO_TAXSITU_COM ,
wa_it_taxsituation  LIKE LINE OF it_it_taxsituation,
it_it_taxdetermination  TYPE STANDARD TABLE OF TTET_I_TAXDETE_COM ,
wa_it_taxdetermination  LIKE LINE OF it_it_taxdetermination,
it_ot_header  TYPE STANDARD TABLE OF TTET_O_HEAD_COM ,
wa_ot_header  LIKE LINE OF it_ot_header,
it_ot_item  TYPE STANDARD TABLE OF TTET_O_ITEM_COM ,
wa_ot_item  LIKE LINE OF it_ot_item,
it_ot_taxelement  TYPE STANDARD TABLE OF TTET_O_TAXELE_COM ,
wa_ot_taxelement  LIKE LINE OF it_ot_taxelement,
it_ot_taxvalue  TYPE STANDARD TABLE OF TTET_OT_TAXVAL_COM ,
wa_ot_taxvalue  LIKE LINE OF it_ot_taxvalue,
it_ot_taxsituation  TYPE STANDARD TABLE OF TTET_IO_TAXSITU_COM ,
wa_ot_taxsituation  LIKE LINE OF it_ot_taxsituation,
it_ot_currencyconversion  TYPE STANDARD TABLE OF TTET_IT_CURRCON_COM ,
wa_ot_currencyconversion  LIKE LINE OF it_ot_currencyconversion,
it_ot_exemption  TYPE STANDARD TABLE OF TTET_IT_EXEMPTION_COM ,
wa_ot_exemption  LIKE LINE OF it_ot_exemption,
it_ot_partner  TYPE STANDARD TABLE OF TTET_I_PARTNER_COM ,
wa_ot_partner  LIKE LINE OF it_ot_partner,
it_ot_partnertaxnumber  TYPE STANDARD TABLE OF TTET_I_PATAXNO_COM ,
wa_ot_partnertaxnumber  LIKE LINE OF it_ot_partnertaxnumber,
it_ot_taxclassification  TYPE STANDARD TABLE OF TTET_I_TAXCLAS_COM ,
wa_ot_taxclassification  LIKE LINE OF it_ot_taxclassification,
it_ot_traceentry  TYPE STANDARD TABLE OF TTET_O_TRACE_COM ,
wa_ot_traceentry  LIKE LINE OF it_ot_traceentry,
it_ot_us_tax  TYPE STANDARD TABLE OF TTET_USCOM_TAX_COM ,
wa_ot_us_tax  LIKE LINE OF it_ot_us_tax.

ld_i_handle = 'Check type of data required'.

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

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

"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_productusage to it_it_productusage.

"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_partnertaxnumber to it_it_partnertaxnumber.

"populate fields of struture and append to itab
append wa_it_pricingelement to it_it_pricingelement.

"populate fields of struture and append to itab
append wa_it_exemption to it_it_exemption.

"populate fields of struture and append to itab
append wa_it_taxclassification to it_it_taxclassification.

"populate fields of struture and append to itab
append wa_it_currencyconversion to it_it_currencyconversion.

"populate fields of struture and append to itab
append wa_it_reportingfield to it_it_reportingfield.

"populate fields of struture and append to itab
append wa_it_taxsituation to it_it_taxsituation.

"populate fields of struture and append to itab
append wa_it_taxdetermination to it_it_taxdetermination.

"populate fields of struture and append to itab
append wa_ot_header to it_ot_header.

"populate fields of struture and append to itab
append wa_ot_item to it_ot_item.

"populate fields of struture and append to itab
append wa_ot_taxelement to it_ot_taxelement.

"populate fields of struture and append to itab
append wa_ot_taxvalue to it_ot_taxvalue.

"populate fields of struture and append to itab
append wa_ot_taxsituation to it_ot_taxsituation.

"populate fields of struture and append to itab
append wa_ot_currencyconversion to it_ot_currencyconversion.

"populate fields of struture and append to itab
append wa_ot_exemption to it_ot_exemption.

"populate fields of struture and append to itab
append wa_ot_partner to it_ot_partner.

"populate fields of struture and append to itab
append wa_ot_partnertaxnumber to it_ot_partnertaxnumber.

"populate fields of struture and append to itab
append wa_ot_taxclassification to it_ot_taxclassification.

"populate fields of struture and append to itab
append wa_ot_traceentry to it_ot_traceentry.

"populate fields of struture and append to itab
append wa_ot_us_tax to it_ot_us_tax.

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