If you’re creating a Sales Order, posting an Invoice in MIRO, or generating a Nota Fiscal and receive an error like:

  • 8B115 - It is not possible to determine the CFOP automatically
  • 8B569 - CFOP not found for item XYZ in sales order XYZ

…this means SAP couldn’t determine the appropriate CFOP (Código Fiscal de Operações e Prestações) because required configuration entries are missing.

FEAT_MISSING.png

These errors are typically caused by incomplete or missing entries in the following CFOP determination tables:

  • J_1BAON – For incoming goods and returns
  • J_1BAPN – For outgoing goods and returns

If you still can’t figure out what is the missing entry, you can put a breakpoint to the following functions according to the direction (Incoming/Outgoing).

How to Identify What’s Missing

If you’re not sure which combination is causing the error, you can debug the CFOP determination logic by setting breakpoints in the related SAP functions. Here’s how:


🔍 1. Outgoing Transactions (Sales, Deliveries, Returns)

For outgoing operations, the system uses function J_1B_NF_CFOP_2_DETERMINATION.

Steps:

  1. Go to transaction SE37.
  2. Enter the function name: J_1B_NF_CFOP_2_DETERMINATION.
  3. 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.

  4. Execute your process (e.g., create sales order, billing).
  5. At the breakpoint, check the structure cfop_parameters and capture the values of the following 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 Transactions (Purchases, Subcontracting, Returns)

For incoming operations, the system uses function J_1B_NF_CFOP_1_DETERMINATION.

Steps:

  1. Go to transaction SE37.
  2. Enter the function name: J_1B_NF_CFOP_1_DETERMINATION.
  3. 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.

  4. Execute your incoming process (e.g., MIRO, MIGO).
  5. At the breakpoint, check the structure cfop_parameters and note the values of 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 you’ll need to maintain in table J_1BAON to complete the CFOP assignment configuration.

📌 Note: This information is valid as of the date of publication and reflects SAP’s behavior at the time. Legal and system updates may affect this process in the future.

Image

Copyright Notice: © Leo Anderson and SAPBR.COM (SAP Brazil) WordPress Blog, 2013.
Reproduction or use of this material without the express written permission of the blog’s author and/or owner is strictly prohibited. You are welcome to share brief excerpts or link to content, provided that full credit is given to Leo Anderson and SAPBR.COM, along with a clear and direct link to the original post.