Fonction SAP BAPI_J_1B_NF_CREATEFROMDATA - Nota Fiscal System - Create Object from data

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
NFCHECK BAPI_J_1BNFCHECK u 50 X Check control for Business Object BUS2143 - Nota Fiscal
OBJ_HEADER BAPI_J_1BNFDOC u 541 Kopf Nota Fiscal
OBJ_HEADER_ADD BAPI_J_1BNFDOC_ADD u 22 X Übergabestruktur Kopfdaten Nota Fiscal - Ergänzung

Paramètre Reférence Type Long. Description
E_DOCNUM BAPI_J_1BNFDOC-DOCNUM N 10 Document number

Paramètre Reférence Long. Facultatif Description
OBJ_HEADER_MSG BAPI_J_1BNFFTX 90 X Kopfnachricht Nota Fiscal
OBJ_ITEM BAPI_J_1BNFLIN 449 Einzelposten Nota Fiscal
OBJ_ITEM_ADD BAPI_J_1BNFLIN_ADD 144 X Übergabestruktur Einzelposten Nota Fiscal - Ergänzung
OBJ_ITEM_TAX BAPI_J_1BNFSTX 133 Nota Fiscal Steuer pro Position
OBJ_OT_PARTNER BAPI_J_1BNFCPD 404 X Nota Fiscal CpD-Konten
OBJ_PARTNER BAPI_J_1BNFNAD 27 X Nota Fiscal Partner
OBJ_REFER_MSG BAPI_J_1BNFREF 21 X Nota Fiscal Verweis auf Kopfnachricht
RETURN BAPIRET2 548 Returnparameter

Functionality
You can use this method to create a nota fiscal document.
You can only create one nota fiscal document each time you call up themethod.
If you want to post an authorized electronic nota fiscal (NF-e), be surethat:

  • You have received a response from the government for the NF-e. You
  • cannot post an NF-e with document status "Waiting for Response".
    • You have entered the document status on the interface. Since you cannot
    • change the NF-e once posted, if the response from the government iseither "Rejected" or "Denied", select the "Cancelled" checkbox on theinterface so that the process step is set by the system as "Complete".
      • You have not assigned a form to the NF-e.

      • You have entered the complete access key on the interface.
      • Notes
        The system executes several checks before your nota fiscal is posted:

        • Only a warning:

        • 1. Check specific item types - processed when entering NF manual (1)
          2. Check NF form exists for business place and company code
          3. Check if NF model exists
          4. Check if currency is BRL
          • A real error to avoid inconsistencies on the nota fiscal database:

          • 5. Check if NF type exists
            6. Check if company code exists
            7. Check if company code and business place exits
            8. Check if partner exits
            9. Check if the itemtyp for all items
            10. If the matnr is filled: check if matnr is available in MARA
            11. If the plant is filled: check if plant is available in T001W
            12. If the plant is filled: check that material number is not initial
            13. Check that material group is not initial
            14. Check if unit of measure is available in T006
            15. Check if NBM code is available in T023
            16. Check that business place or company code is not initial (2)
            17. Check NF Type (NFTYPE), doc.typ (DOCTYP), direct (DIRECT) not in (3)
            18. Check part. funct. (PARVW), name (PARID), type (PARTYP) not in (4)
            19. Check that posting date and document date not initial (5)
            20. Check that currency (WAERK) not inital (6)
            21. Check that at least one item of the NF exists (7)
            22. Check that material usage is not initial (8)
            23. Check that CFOP is not initial (9)
            24. Check that doc. ref. at specific itemtypes are not initial (10)
            25. Check 1st digit CFOP: equal for all items and correct related to thepartners state (11)
            26. Check 1st digit CFOP for direction (12)
            27. Check that ICMS/IPI tax law/tax sit. & mat. origin are notinitial (13)
            28. Check that NBM is not initial (14)
            29. Check that at least one tax line of the NF exists (15)
            30. Check that NF form fits to legal requirements (16)
            31. Check if document type exits
            32. Check if direction exists
            33. Check if manual-flag is only initial for maintained refkey
            34. Check Valuation Type
            35. Check if plants exist
            36. Check if valuation areas exist
            37. Check if tax types exist
            38. Check that period not closed (for NF doctyp ='5' (cancel))
            39. Check that no negative taxes are posted
            • The following checks are executed when the NF-e flag is set in the
            • header:
              40. Check if the NF-e number is filled
              41. Check if the protocol number is filled
              42. Check if the XML-version is filled
              43. Check if the NF-e status code is filled

              Description
              This parameter implements the key field of the business object with thesame name.

              Description
              Before the creation of a nota fiscal a number of checks (actually morethan 35 checks, e.g. consistency checks, avoidance of duplicate keys ondatabase). Some of the checks can be skipped for special purposes.
              Be aware, that the usage of this check string should be a very rareexeption.

              Example

              NFCHECK = 'XX X XXX XXXXXXXXXX.....' will perform all checks, exceptchecks number 3, 5 and 9)

              Default
              When the checkstring is initial, all checks are performed.

              Description
              This structure contains the header data of the nota fiscal documentthat is to be created.
              For more information on the individual parameter fields, see the dataelement documentation in the ABAP Dictionary.

              Description
              This table contains the header message for the nota fiscal documentthat is to be created.
              For more information on the individual parameter fields, see the dataelement documentation in the ABAP Dictionary.

              Description
              This table contains the item data for the nota fiscal document that isto be created.
              For more information on the individual parameter fields, see the dataelement documentation in the ABAP Dictionary.

              Description
              This table contains the tax data related to each item for the notafiscal document that is to be created.
              For more information on the individual parameter fields, see the dataelement documentation in the ABAP Dictionary.

              Description
              This table contains the one time customer information for the notafiscal document that is to be created.
              For more information on the individual parameter fields, see the dataelement documentation in the ABAP Dictionary.

              Description
              This table contains the partner data for the nota fiscal document thatis to be created.
              For more information on the individual parameter fields, see the dataelement documentation in the ABAP Dictionary.

              Description
              This table contains the assignment of the message to each item for thenota fiscal document that is to be created.
              For more information on the individual parameter fields, see the dataelement documentation in the ABAP Dictionary.

              Description
              This table contains the return codes from the method call. If errorsoccured during this method, the "Return" table is filled.

1438295Brazil SPED NF-e: Layout 2.0, Technical Guide ver 4.0.1
1049946NF-e: Adaption of Nota Fiscal Bapis
994303Error 8B 499 during nota fiscal creation via BAPI
515092BAPI for NF creation