SAP TAXDOC_ADD_TO_DOCUMENT Function Module for Add new line to list of collected document data.
TAXDOC_ADD_TO_DOCUMENT is a standard taxdoc add to document SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Add new line to list of collected document data. processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for taxdoc add to document FM, simply by entering the name TAXDOC_ADD_TO_DOCUMENT into the relevant SAP transaction such as SE37 or SE38.
Function Group: FYTX_TAXD
Program Name: SAPLFYTX_TAXD
Main Program:
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function TAXDOC_ADD_TO_DOCUMENT pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'TAXDOC_ADD_TO_DOCUMENT'"Add new line to list of collected document data..
EXPORTING
I_KALSM = "
I_DOC_NUMBER = "
I_KPOSN = "
I_MWSKZ = "
I_XEXTN = "
I_TAXIN = "
IMPORTING Parameters details for TAXDOC_ADD_TO_DOCUMENT
I_KALSM -
Data type: TTXD-KALSMOptional: No
Call by Reference: No ( called with pass by value option)
I_DOC_NUMBER -
Data type: TTXY-AWREFOptional: No
Call by Reference: No ( called with pass by value option)
I_KPOSN -
Data type: TTXY-KPOSNOptional: No
Call by Reference: No ( called with pass by value option)
I_MWSKZ -
Data type: KOMP-MWSKZOptional: No
Call by Reference: No ( called with pass by value option)
I_XEXTN -
Data type: TTXD-XEXTNOptional: No
Call by Reference: No ( called with pass by value option)
I_TAXIN -
Data type: COM_TAXOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for TAXDOC_ADD_TO_DOCUMENT Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_i_kalsm | TYPE TTXD-KALSM, " | |||
| lv_i_doc_number | TYPE TTXY-AWREF, " | |||
| lv_i_kposn | TYPE TTXY-KPOSN, " | |||
| lv_i_mwskz | TYPE KOMP-MWSKZ, " | |||
| lv_i_xextn | TYPE TTXD-XEXTN, " | |||
| lv_i_taxin | TYPE COM_TAX. " |
|   CALL FUNCTION 'TAXDOC_ADD_TO_DOCUMENT' "Add new line to list of collected document data. |
| EXPORTING | ||
| I_KALSM | = lv_i_kalsm | |
| I_DOC_NUMBER | = lv_i_doc_number | |
| I_KPOSN | = lv_i_kposn | |
| I_MWSKZ | = lv_i_mwskz | |
| I_XEXTN | = lv_i_xextn | |
| I_TAXIN | = lv_i_taxin | |
| . " TAXDOC_ADD_TO_DOCUMENT | ||
ABAP code using 7.40 inline data declarations to call FM TAXDOC_ADD_TO_DOCUMENT
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single KALSM FROM TTXD INTO @DATA(ld_i_kalsm). | ||||
| "SELECT single AWREF FROM TTXY INTO @DATA(ld_i_doc_number). | ||||
| "SELECT single KPOSN FROM TTXY INTO @DATA(ld_i_kposn). | ||||
| "SELECT single MWSKZ FROM KOMP INTO @DATA(ld_i_mwskz). | ||||
| "SELECT single XEXTN FROM TTXD INTO @DATA(ld_i_xextn). | ||||
Search for further information about these or an SAP related objects