SAP Tables

J_1B_NF_DOCUMENT_UPDATE SAP Function module - Nota Fiscal System - Update document




J_1B_NF_DOCUMENT_UPDATEis a standard SAP function module available within R/3 SAPsystems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import/export parameters, exceptions etc as well as any documentation contributions specific to the object. See here to view full function module documentation and code listing, simply by entering the name J_1B_NF_DOCUMENT_UPDATE into the relevant SAP transaction such as SE37 or SE80.

Contribute (Add Comments)
Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name J_1B_NF_DOCUMENT_UPDATE or its description.


Pattern for FM J_1B_NF_DOCUMENT_UPDATE - J 1B NF DOCUMENT UPDATE
Associated Function Group: J1BA
Released Date: Not Released
CALL FUNCTION 'J_1B_NF_DOCUMENT_UPDATE' "Nota Fiscal System - Update document
  EXPORTING
    doc_number =                " j_1bnfdoc-docnum  Nota Fiscal document number
    doc_header =                " j_1bnfdoc     Nota Fiscal document header
  TABLES
    doc_partner =               " j_1bnfnad     Nota Fiscal document partner
    doc_item =                  " j_1bnflin     Nota Fiscal document item
    doc_item_tax =              " j_1bnfstx     Nota Fiscal document item tax
    doc_header_msg =            " j_1bnfftx     Nota Fiscal document header message
    doc_refer_msg =             " j_1bnfref     Nota Fiscal message references
*   doc_ot_partner =            " j_1bnfcpd     Nota Fiscal one-time account data
*   doc_import_di =             " j_1bnfimport_di  Nota Fiscal Data for Import Documents
*   doc_import_adi =            " j_1bnfimport_adi  Nota Fiscal Data for Additions to Import Documents
*   doc_cte_docref =            " j_1bcte_d_docref  Reference to the NF-e being transported
*   doc_cte_res =               " j_1bcte_d_res  Information about resource
*   doc_trans_volumes =         " j_1bnftransvol  Transported Volumes
*   doc_trailer_info =          " j_1bnftrailer  Trailer Information
*   doc_trade_notes =           " j_1bnftradenotes  Trade Notes
*   doc_add_info =              " j_1bnfadd_info  Free Usage Fields for Additional Information
*   doc_ref_proc =              " j_1bnfrefproc  Additional Information: Referenced Processes
*   doc_sugar_suppl =           " j_1bnfsugarsuppl  Daily Supply of Sugarcane
*   doc_sugar_deduc =           " j_1bnfsugardeduc  Taxes and Contributions on Sugarcane
*   doc_vehicle =               " j_1bnfvehicle  Nota Fiscal: Vehicle Details
*   doc_pharmaceut =            " j_1bnfpharmaceut  Nota Fiscal: Pharmaceutical
*   doc_fuel =                  " j_1bnffuel    Nota Fiscal:  Fuel Details
  EXCEPTIONS
    DOCUMENT_NOT_FOUND = 1      "               Nota Fiscal not found in Database
    UPDATE_PROBLEM = 2          "               Some problem during update (SY-SUBRC <> 0)
    DOC_NUMBER_IS_INITIAL = 3   "               Document number not fullfilled
    .  "  J_1B_NF_DOCUMENT_UPDATE

ABAP code example for Function Module J_1B_NF_DOCUMENT_UPDATE


The ABAP code below is a full code listing to execute function module J_1B_NF_DOCUMENT_UPDATE including all data declarations. The code uses the latest in-line data declaration syntax but I have included an abap code snipet at the end to show how declarations would look using the original method of declaring data variables up front. 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).
DATA:
it_doc_partner   TYPE STANDARD TABLE OF J_1BNFNAD,"tables param
wa_doc_partner LIKE LINE OF it_doc_partner  ,
it_doc_item   TYPE STANDARD TABLE OF J_1BNFLIN,"tables param
wa_doc_item LIKE LINE OF it_doc_item  ,
it_doc_item_tax   TYPE STANDARD TABLE OF J_1BNFSTX,"tables param
wa_doc_item_tax LIKE LINE OF it_doc_item_tax  ,
it_doc_header_msg   TYPE STANDARD TABLE OF J_1BNFFTX,"tables param
wa_doc_header_msg LIKE LINE OF it_doc_header_msg  ,
it_doc_refer_msg   TYPE STANDARD TABLE OF J_1BNFREF,"tables param
wa_doc_refer_msg LIKE LINE OF it_doc_refer_msg  ,
it_doc_ot_partner   TYPE STANDARD TABLE OF J_1BNFCPD,"tables param
wa_doc_ot_partner LIKE LINE OF it_doc_ot_partner  ,
it_doc_import_di   TYPE STANDARD TABLE OF J_1BNFIMPORT_DI,"tables param
wa_doc_import_di LIKE LINE OF it_doc_import_di  ,
it_doc_import_adi   TYPE STANDARD TABLE OF J_1BNFIMPORT_ADI,"tables param
wa_doc_import_adi LIKE LINE OF it_doc_import_adi  ,
it_doc_cte_docref   TYPE STANDARD TABLE OF J_1BCTE_D_DOCREF,"tables param
wa_doc_cte_docref LIKE LINE OF it_doc_cte_docref  ,
it_doc_cte_res   TYPE STANDARD TABLE OF J_1BCTE_D_RES,"tables param
wa_doc_cte_res LIKE LINE OF it_doc_cte_res  ,
it_doc_trans_volumes   TYPE STANDARD TABLE OF J_1BNFTRANSVOL,"tables param
wa_doc_trans_volumes LIKE LINE OF it_doc_trans_volumes  ,
it_doc_trailer_info   TYPE STANDARD TABLE OF J_1BNFTRAILER,"tables param
wa_doc_trailer_info LIKE LINE OF it_doc_trailer_info  ,
it_doc_trade_notes   TYPE STANDARD TABLE OF J_1BNFTRADENOTES,"tables param
wa_doc_trade_notes LIKE LINE OF it_doc_trade_notes  ,
it_doc_add_info   TYPE STANDARD TABLE OF J_1BNFADD_INFO,"tables param
wa_doc_add_info LIKE LINE OF it_doc_add_info  ,
it_doc_ref_proc   TYPE STANDARD TABLE OF J_1BNFREFPROC,"tables param
wa_doc_ref_proc LIKE LINE OF it_doc_ref_proc  ,
it_doc_sugar_suppl   TYPE STANDARD TABLE OF J_1BNFSUGARSUPPL,"tables param
wa_doc_sugar_suppl LIKE LINE OF it_doc_sugar_suppl  ,
it_doc_sugar_deduc   TYPE STANDARD TABLE OF J_1BNFSUGARDEDUC,"tables param
wa_doc_sugar_deduc LIKE LINE OF it_doc_sugar_deduc  ,
it_doc_vehicle   TYPE STANDARD TABLE OF J_1BNFVEHICLE,"tables param
wa_doc_vehicle LIKE LINE OF it_doc_vehicle  ,
it_doc_pharmaceut   TYPE STANDARD TABLE OF J_1BNFPHARMACEUT,"tables param
wa_doc_pharmaceut LIKE LINE OF it_doc_pharmaceut  ,
it_doc_fuel   TYPE STANDARD TABLE OF J_1BNFFUEL,"tables param
wa_doc_fuel LIKE LINE OF it_doc_fuel  .


SELECT single DOCNUM
FROM J_1BNFDOC
INTO @DATA(ld_doc_number).

DATA(ld_doc_header) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_doc_partner to it_doc_partner.

"populate fields of struture and append to itab
append wa_doc_item to it_doc_item.

"populate fields of struture and append to itab
append wa_doc_item_tax to it_doc_item_tax.

"populate fields of struture and append to itab
append wa_doc_header_msg to it_doc_header_msg.

"populate fields of struture and append to itab
append wa_doc_refer_msg to it_doc_refer_msg.

"populate fields of struture and append to itab
append wa_doc_ot_partner to it_doc_ot_partner.

"populate fields of struture and append to itab
append wa_doc_import_di to it_doc_import_di.

"populate fields of struture and append to itab
append wa_doc_import_adi to it_doc_import_adi.

"populate fields of struture and append to itab
append wa_doc_cte_docref to it_doc_cte_docref.

"populate fields of struture and append to itab
append wa_doc_cte_res to it_doc_cte_res.

"populate fields of struture and append to itab
append wa_doc_trans_volumes to it_doc_trans_volumes.

"populate fields of struture and append to itab
append wa_doc_trailer_info to it_doc_trailer_info.

"populate fields of struture and append to itab
append wa_doc_trade_notes to it_doc_trade_notes.

"populate fields of struture and append to itab
append wa_doc_add_info to it_doc_add_info.

"populate fields of struture and append to itab
append wa_doc_ref_proc to it_doc_ref_proc.

"populate fields of struture and append to itab
append wa_doc_sugar_suppl to it_doc_sugar_suppl.

"populate fields of struture and append to itab
append wa_doc_sugar_deduc to it_doc_sugar_deduc.

"populate fields of struture and append to itab
append wa_doc_vehicle to it_doc_vehicle.

"populate fields of struture and append to itab
append wa_doc_pharmaceut to it_doc_pharmaceut.

"populate fields of struture and append to itab
append wa_doc_fuel to it_doc_fuel.. CALL FUNCTION 'J_1B_NF_DOCUMENT_UPDATE' EXPORTING doc_number = ld_doc_number doc_header = ld_doc_header TABLES doc_partner = it_doc_partner doc_item = it_doc_item doc_item_tax = it_doc_item_tax doc_header_msg = it_doc_header_msg doc_refer_msg = it_doc_refer_msg * doc_ot_partner = it_doc_ot_partner * doc_import_di = it_doc_import_di * doc_import_adi = it_doc_import_adi * doc_cte_docref = it_doc_cte_docref * doc_cte_res = it_doc_cte_res * doc_trans_volumes = it_doc_trans_volumes * doc_trailer_info = it_doc_trailer_info * doc_trade_notes = it_doc_trade_notes * doc_add_info = it_doc_add_info * doc_ref_proc = it_doc_ref_proc * doc_sugar_suppl = it_doc_sugar_suppl * doc_sugar_deduc = it_doc_sugar_deduc * doc_vehicle = it_doc_vehicle * doc_pharmaceut = it_doc_pharmaceut * doc_fuel = it_doc_fuel EXCEPTIONS DOCUMENT_NOT_FOUND = 1 UPDATE_PROBLEM = 2 DOC_NUMBER_IS_INITIAL = 3 . " J_1B_NF_DOCUMENT_UPDATE
IF SY-SUBRC EQ 0.   "All OK ELSEIF SY-SUBRC EQ 1. "Exception   "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception   "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception   "Add code for exception here ENDIF.

ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.
DATA:

ld_doc_number TYPE J_1BNFDOC-DOCNUM ,
it_doc_partner TYPE STANDARD TABLE OF J_1BNFNAD ,
wa_doc_partner LIKE LINE OF it_doc_partner,
ld_doc_header TYPE J_1BNFDOC ,
it_doc_item TYPE STANDARD TABLE OF J_1BNFLIN ,
wa_doc_item LIKE LINE OF it_doc_item,
it_doc_item_tax TYPE STANDARD TABLE OF J_1BNFSTX ,
wa_doc_item_tax LIKE LINE OF it_doc_item_tax,
it_doc_header_msg TYPE STANDARD TABLE OF J_1BNFFTX ,
wa_doc_header_msg LIKE LINE OF it_doc_header_msg,
it_doc_refer_msg TYPE STANDARD TABLE OF J_1BNFREF ,
wa_doc_refer_msg LIKE LINE OF it_doc_refer_msg,
it_doc_ot_partner TYPE STANDARD TABLE OF J_1BNFCPD ,
wa_doc_ot_partner LIKE LINE OF it_doc_ot_partner,
it_doc_import_di TYPE STANDARD TABLE OF J_1BNFIMPORT_DI ,
wa_doc_import_di LIKE LINE OF it_doc_import_di,
it_doc_import_adi TYPE STANDARD TABLE OF J_1BNFIMPORT_ADI ,
wa_doc_import_adi LIKE LINE OF it_doc_import_adi,
it_doc_cte_docref TYPE STANDARD TABLE OF J_1BCTE_D_DOCREF ,
wa_doc_cte_docref LIKE LINE OF it_doc_cte_docref,
it_doc_cte_res TYPE STANDARD TABLE OF J_1BCTE_D_RES ,
wa_doc_cte_res LIKE LINE OF it_doc_cte_res,
it_doc_trans_volumes TYPE STANDARD TABLE OF J_1BNFTRANSVOL ,
wa_doc_trans_volumes LIKE LINE OF it_doc_trans_volumes,
it_doc_trailer_info TYPE STANDARD TABLE OF J_1BNFTRAILER ,
wa_doc_trailer_info LIKE LINE OF it_doc_trailer_info,
it_doc_trade_notes TYPE STANDARD TABLE OF J_1BNFTRADENOTES ,
wa_doc_trade_notes LIKE LINE OF it_doc_trade_notes,
it_doc_add_info TYPE STANDARD TABLE OF J_1BNFADD_INFO ,
wa_doc_add_info LIKE LINE OF it_doc_add_info,
it_doc_ref_proc TYPE STANDARD TABLE OF J_1BNFREFPROC ,
wa_doc_ref_proc LIKE LINE OF it_doc_ref_proc,
it_doc_sugar_suppl TYPE STANDARD TABLE OF J_1BNFSUGARSUPPL ,
wa_doc_sugar_suppl LIKE LINE OF it_doc_sugar_suppl,
it_doc_sugar_deduc TYPE STANDARD TABLE OF J_1BNFSUGARDEDUC ,
wa_doc_sugar_deduc LIKE LINE OF it_doc_sugar_deduc,
it_doc_vehicle TYPE STANDARD TABLE OF J_1BNFVEHICLE ,
wa_doc_vehicle LIKE LINE OF it_doc_vehicle,
it_doc_pharmaceut TYPE STANDARD TABLE OF J_1BNFPHARMACEUT ,
wa_doc_pharmaceut LIKE LINE OF it_doc_pharmaceut,
it_doc_fuel TYPE STANDARD TABLE OF J_1BNFFUEL ,
wa_doc_fuel LIKE LINE OF it_doc_fuel.


SELECT single DOCNUM
FROM J_1BNFDOC
INTO ld_doc_number.


"populate fields of struture and append to itab
append wa_doc_partner to it_doc_partner.
ld_doc_header = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_doc_item to it_doc_item.

"populate fields of struture and append to itab
append wa_doc_item_tax to it_doc_item_tax.

"populate fields of struture and append to itab
append wa_doc_header_msg to it_doc_header_msg.

"populate fields of struture and append to itab
append wa_doc_refer_msg to it_doc_refer_msg.

"populate fields of struture and append to itab
append wa_doc_ot_partner to it_doc_ot_partner.

"populate fields of struture and append to itab
append wa_doc_import_di to it_doc_import_di.

"populate fields of struture and append to itab
append wa_doc_import_adi to it_doc_import_adi.

"populate fields of struture and append to itab
append wa_doc_cte_docref to it_doc_cte_docref.

"populate fields of struture and append to itab
append wa_doc_cte_res to it_doc_cte_res.

"populate fields of struture and append to itab
append wa_doc_trans_volumes to it_doc_trans_volumes.

"populate fields of struture and append to itab
append wa_doc_trailer_info to it_doc_trailer_info.

"populate fields of struture and append to itab
append wa_doc_trade_notes to it_doc_trade_notes.

"populate fields of struture and append to itab
append wa_doc_add_info to it_doc_add_info.

"populate fields of struture and append to itab
append wa_doc_ref_proc to it_doc_ref_proc.

"populate fields of struture and append to itab
append wa_doc_sugar_suppl to it_doc_sugar_suppl.

"populate fields of struture and append to itab
append wa_doc_sugar_deduc to it_doc_sugar_deduc.

"populate fields of struture and append to itab
append wa_doc_vehicle to it_doc_vehicle.

"populate fields of struture and append to itab
append wa_doc_pharmaceut to it_doc_pharmaceut.

"populate fields of struture and append to itab
append wa_doc_fuel to it_doc_fuel..