Creating a sales order, posting an invoice in MIRO or generating a Nota Fiscal, you may get an error like:
8B115 - It is not possible to determine the CFOP automatically8B569 - CFOP not found for item XYZ in sales order XYZ
It means SAP couldn’t determine the CFOP (Código Fiscal de Operações e Prestações) because configuration entries are missing.

These errors usually come from incomplete or missing entries in the CFOP determination tables:
- J_1BAON: incoming goods and returns
- J_1BAPN: outgoing goods and returns
How to find what’s missing
If you can’t tell which combination causes the error, debug the CFOP determination by setting a breakpoint in the function for the direction (incoming or outgoing).
1. Outgoing (sales, deliveries, returns)
Outgoing operations use function J_1B_NF_CFOP_2_DETERMINATION.
- Go to transaction SE37.
- Enter function J_1B_NF_CFOP_2_DETERMINATION.
- Set a breakpoint at the line
READ TABLE it_bapn INTO wbapn WITH KEY ...:
..
* The concept with generic read was abandoned. Only the exact version
* is used!
* do 2 times.
***** select with all parameters
READ TABLE it_bapn INTO wbapn WITH KEY
direct = cfop_parameters-direct
dstcat = cfop_parameters-dstcat
indus3 = cfop_parameters-indus3
itmtyp = cfop_parameters-itmtyp
spcsto = cfop_parameters-spcsto
ownpro = cfop_parameters-ownpro
matuse = cfop_parameters-matuse
indus1 = cfop_parameters-indus1
origin = space
version = i_version.
...
- Run your process (for example, create the sales order or billing document).
- At the breakpoint, check structure cfop_parameters and note these fields:
| Field | Description |
|---|---|
| direct | Movement direction (5 = outgoing) |
| dstcat | Customer CFOP category |
| indus3 | NF item special case (e.g., ST/ISS) |
| itmtyp | NF item type |
| spcsto | Produced in-house indicator |
| ownpro | Own production flag |
| matuse | Material usage |
| indus1 | Material CFOP category |
| i_version | CFOP version |
These values are the exact keys you need to maintain in table J_1BAPN for the CFOP to be found.
2. Incoming (purchases, subcontracting, returns)
Incoming operations use function J_1B_NF_CFOP_1_DETERMINATION.
- Go to transaction SE37.
- Enter function J_1B_NF_CFOP_1_DETERMINATION.
- Set a breakpoint at the line
PERFORM read_cfop USING cfop_parameters-direct ...:
...
*-------------------------------------------------------
*---> Read CFOP with version of the region
*-------------------------------------------------------
*--- access with all key fields
PERFORM read_cfop USING cfop_parameters-direct
cfop_parameters-dstcat
cfop_parameters-indus3
cfop_parameters-itmtyp
cfop_parameters-spcsto
cfop_parameters-matuse
cfop_parameters-indus2
lv_version
CHANGING cfop.
...
- Run your incoming process (for example, MIRO or MIGO).
- At the breakpoint, check structure cfop_parameters and note these fields:
| Field | Description |
|---|---|
| direct | Movement direction (1–3 = incoming) |
| dstcat | Vendor CFOP category |
| indus3 | NF item special case |
| itmtyp | NF item type |
| spcsto | Produced in-house indicator |
| matuse | Material usage |
| indus2 | Material CFOP category |
These are the values to maintain in table J_1BAON to complete the CFOP configuration.
Note: this reflects SAP’s behavior at the time of publication. Legal and system updates may change the process.


Leave a Reply