SAP BAPI_CTE_J_1B_NF_CREATFROMDATA Function Module for Create CT-e Object from data
BAPI_CTE_J_1B_NF_CREATFROMDATA is a standard bapi cte j 1b nf creatfromdata SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Create CT-e Object from 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 bapi cte j 1b nf creatfromdata FM, simply by entering the name BAPI_CTE_J_1B_NF_CREATFROMDATA into the relevant SAP transaction such as SE37 or SE38.
Function Group: J1BCTE
Program Name: SAPLJ1BCTE
Main Program: SAPLJ1BCTE
Appliation area:
Release date: 06-Nov-2012
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function BAPI_CTE_J_1B_NF_CREATFROMDATA 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 'BAPI_CTE_J_1B_NF_CREATFROMDATA'"Create CT-e Object from data.
EXPORTING
IS_HEADER = "Transfer Structure: Nota Fiscal Header Data
* IS_HEADER_ADD = "Transfer Structure for Nota Fiscal Header Data - Additions
* IS_NFCHECK = "Check Control for Business Object BUS2143 - Nota Fiscal
IMPORTING
EV_DOCNUM = "Document Number
TABLES
* O_PARTNER = "Transfer Structure: Nota Fiscal Partners
* O_CTE_DOCREF = "Reference to the NF-e being transported
* O_CTE_RES = "Information about resource
RETURN = "Return Parameter
O_ITEM = "Transfer Structure: Nota Fiscal Line Items
* O_ITEM_ADD = "Transfer Structure for Nota Fiscal Item Data - Additions
O_ITEM_TAX = "Transfer Structure: Nota Fiscal Tax Per Item
* O_HEADER_MSG = "Transfer Structure: Nota Fiscal Header Outpug
* O_REFER_MSG = "Transfer Structure: Nota Fiscal Reference to Header Output
* O_OT_PARTNER = "Transfer Structure: Notas Fiscal One-Time Accounts
* O_IMPORT_DI = "Nota Fiscal Data for Import Documents
* O_IMPORT_ADI = "Assignment of NF Items to Import Documents and Additions
IMPORTING Parameters details for BAPI_CTE_J_1B_NF_CREATFROMDATA
IS_HEADER - Transfer Structure: Nota Fiscal Header Data
Data type: BAPI_CTE_J_1BNFDOCOptional: No
Call by Reference: No ( called with pass by value option)
IS_HEADER_ADD - Transfer Structure for Nota Fiscal Header Data - Additions
Data type: BAPI_CTE_J_1BNFDOC_ADDOptional: Yes
Call by Reference: No ( called with pass by value option)
IS_NFCHECK - Check Control for Business Object BUS2143 - Nota Fiscal
Data type: BAPI_CTE_J_1BNFCHECKOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_CTE_J_1B_NF_CREATFROMDATA
EV_DOCNUM - Document Number
Data type: BAPI_CTE_J_1BNFDOC-DOCNUMOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BAPI_CTE_J_1B_NF_CREATFROMDATA
O_PARTNER - Transfer Structure: Nota Fiscal Partners
Data type: BAPI_CTE_J_1BNFNADOptional: Yes
Call by Reference: Yes
O_CTE_DOCREF - Reference to the NF-e being transported
Data type: BAPI_J_1BCTE_D_DOCREFOptional: Yes
Call by Reference: Yes
O_CTE_RES - Information about resource
Data type: BAPI_J_1BCTE_D_RESOptional: Yes
Call by Reference: Yes
RETURN - Return Parameter
Data type: BAPIRET2Optional: No
Call by Reference: Yes
O_ITEM - Transfer Structure: Nota Fiscal Line Items
Data type: BAPI_CTE_J_1BNFLINOptional: No
Call by Reference: Yes
O_ITEM_ADD - Transfer Structure for Nota Fiscal Item Data - Additions
Data type: BAPI_CTE_J_1BNFLIN_ADDOptional: Yes
Call by Reference: Yes
O_ITEM_TAX - Transfer Structure: Nota Fiscal Tax Per Item
Data type: BAPI_CTE_J_1BNFSTXOptional: No
Call by Reference: Yes
O_HEADER_MSG - Transfer Structure: Nota Fiscal Header Outpug
Data type: BAPI_CTE_J_1BNFFTXOptional: Yes
Call by Reference: Yes
O_REFER_MSG - Transfer Structure: Nota Fiscal Reference to Header Output
Data type: BAPI_CTE_J_1BNFREFOptional: Yes
Call by Reference: Yes
O_OT_PARTNER - Transfer Structure: Notas Fiscal One-Time Accounts
Data type: BAPI_CTE_J_1BNFCPDOptional: Yes
Call by Reference: Yes
O_IMPORT_DI - Nota Fiscal Data for Import Documents
Data type: BAPI_CTE_J_1BNFIMPORT_DIOptional: Yes
Call by Reference: Yes
O_IMPORT_ADI - Assignment of NF Items to Import Documents and Additions
Data type: BAPI_CTE_J_1BNFIMPORT_ADIOptional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for BAPI_CTE_J_1B_NF_CREATFROMDATA 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_ev_docnum | TYPE BAPI_CTE_J_1BNFDOC-DOCNUM, " | |||
| lv_is_header | TYPE BAPI_CTE_J_1BNFDOC, " | |||
| lt_o_partner | TYPE STANDARD TABLE OF BAPI_CTE_J_1BNFNAD, " | |||
| lt_o_cte_docref | TYPE STANDARD TABLE OF BAPI_J_1BCTE_D_DOCREF, " | |||
| lt_o_cte_res | TYPE STANDARD TABLE OF BAPI_J_1BCTE_D_RES, " | |||
| lt_return | TYPE STANDARD TABLE OF BAPIRET2, " | |||
| lt_o_item | TYPE STANDARD TABLE OF BAPI_CTE_J_1BNFLIN, " | |||
| lv_is_header_add | TYPE BAPI_CTE_J_1BNFDOC_ADD, " | |||
| lv_is_nfcheck | TYPE BAPI_CTE_J_1BNFCHECK, " | |||
| lt_o_item_add | TYPE STANDARD TABLE OF BAPI_CTE_J_1BNFLIN_ADD, " | |||
| lt_o_item_tax | TYPE STANDARD TABLE OF BAPI_CTE_J_1BNFSTX, " | |||
| lt_o_header_msg | TYPE STANDARD TABLE OF BAPI_CTE_J_1BNFFTX, " | |||
| lt_o_refer_msg | TYPE STANDARD TABLE OF BAPI_CTE_J_1BNFREF, " | |||
| lt_o_ot_partner | TYPE STANDARD TABLE OF BAPI_CTE_J_1BNFCPD, " | |||
| lt_o_import_di | TYPE STANDARD TABLE OF BAPI_CTE_J_1BNFIMPORT_DI, " | |||
| lt_o_import_adi | TYPE STANDARD TABLE OF BAPI_CTE_J_1BNFIMPORT_ADI. " |
|   CALL FUNCTION 'BAPI_CTE_J_1B_NF_CREATFROMDATA' "Create CT-e Object from data |
| EXPORTING | ||
| IS_HEADER | = lv_is_header | |
| IS_HEADER_ADD | = lv_is_header_add | |
| IS_NFCHECK | = lv_is_nfcheck | |
| IMPORTING | ||
| EV_DOCNUM | = lv_ev_docnum | |
| TABLES | ||
| O_PARTNER | = lt_o_partner | |
| O_CTE_DOCREF | = lt_o_cte_docref | |
| O_CTE_RES | = lt_o_cte_res | |
| RETURN | = lt_return | |
| O_ITEM | = lt_o_item | |
| O_ITEM_ADD | = lt_o_item_add | |
| O_ITEM_TAX | = lt_o_item_tax | |
| O_HEADER_MSG | = lt_o_header_msg | |
| O_REFER_MSG | = lt_o_refer_msg | |
| O_OT_PARTNER | = lt_o_ot_partner | |
| O_IMPORT_DI | = lt_o_import_di | |
| O_IMPORT_ADI | = lt_o_import_adi | |
| . " BAPI_CTE_J_1B_NF_CREATFROMDATA | ||
ABAP code using 7.40 inline data declarations to call FM BAPI_CTE_J_1B_NF_CREATFROMDATA
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 DOCNUM FROM BAPI_CTE_J_1BNFDOC INTO @DATA(ld_ev_docnum). | ||||
Search for further information about these or an SAP related objects