Professional Documents
Culture Documents
Implement Decouple RFC
Implement Decouple RFC
Problem
During the implementation / go live from certain customers problems in the communication
between the involved IT systems are discovered. Major parts are:
Numbering gaps
Update Task delay
Locked documents when update in ERP is triggered via RFC from messaging system
Validation in GRC xNFe
NF-e at Sefaz but not posted in ERP
A solution to get rid of this problems is to decouple the RFC call from the data base update.
The solution for the decouple provides 3 possible ways to number and send the NF-e to
SEFAZ.
1. via the monitor report
2. a mix of 1 and 3 where the numbering is done in the monitor report and the sending in
the batch report.
3. via a periodically scheduled batch report. The time interval for scheduling the job
must be decided based on the data volume.
For high data volume solution 1 may lead to performance problems because the data base
update must be completed before the data are send. For such situation solution 2 should be
preferred.
The indicator for the decision is inserted in the output determination tables (se description
below).
Create the new functions in the sequence as described with transaction SE37
1. J_1B_NFE_OUT_OK_NORFC
Function Group: J_1B_NFE
Short text: Processed when NFE is OK -> calls update functions but not the RFC
Tab Attributes
Mark Normal Function Module
Tab Import
Parameter Typing Associated Type Default Value Optional Pass Value
I_REFTYP TYPE J_1BREFTYP SPACE X
I_VBELN TYPE VBELN_VF X
Tab Changing
Parameter Typing Associated Type Default Value Optional Pass Value
CS_HEADER TYPE J_1BNFDOC
CS_ACTTAB TYPE J_1BNFE_ACTIVE
Tab Tables
Parameter Typing Associated Type Default Value Optional Pass Value
IT_NFLIN LIKE J_1BNFLIN
IT_NFNAD LIKE J_1BNFNAD
IT_NFSTX LIKE J_1BNFSTX
IT_NFFTX LIKE J_1BNFFTX
IT_NFREF LIKE J_1BNFREF
IT_NFCPD LIKE J_1BNFCPD X
IT_VBFA LIKE VBFAVB X
Tab Exception
Exception Short Text
WRONG_NUMBER_RANGE Error by numbering
RFC_FAILURE Error when RFC is called
2. J_1B_NFE_SET_NUMBER
Function Group: J_1B_NFE
Short text: Processed NF-e: Determine NF-e number and send a NF-e
Tab Attributes
Mark Normal Function Module
Tab Import
Parameter Typing Associated Type Default Value Optional Pass Value
IV_DOCNUM TYPE J_1BDOCNUM
IV_BATCH TYPE FLAG SPACE
Tab Export
Parameter Typing Associated Type Pass Value
ES_ACTIVE_MOD TYPE J_1BNFE_ACTIVE
CS_ACTTAB TYPE J_1BNFE_ACTIVE
Tab Exception
Exception Short Text
NUMBERING_NOT_POSSIBLE Numbering not possible
LOCK_ERROR_NFDOC Nf header is locked
LOCK_ERROR_ACTIVE NF-e Active is locked
ALREADY_NUMBERED NF-e is already numbered
3. J_1B_NFE_RFCBATCH_DELETE
Function Group: J_1B_NFE
Short text: Delete table entries J_1BNFERFCBATCH
Tab Attributes
Mark Update Module and Start immed.
Tab Import
Parameter Typing Associated Type Default Value Optional Pass Value
I_DOCNUM TYPE J_1BDOCNUM X
Domain J_1BNFERFCCALL
Short text: Control for NF-e Numbering and RFC call to messaging system
Package: J1BA
Type: CHAR
No. of Characters: 1
Value Range:
Space – Numbering, RFC call and data base update in the same LUW
1 Numbering & RFC is triggered via the Monitor Report( J1BNFE)
2 Numbering in Monitor Report - RFC via batch report
3 Numbering and RFC are triggered in the batch report J_1BRFCBATCH
Documentation:
Definition
The field controls how the NF-e numbering and the RFC call for creation of the XML file
is executed from ERP backend.
Use
Before the availability of the field the numbering and RFC call was in the same LUW as
the data base update of the NF-e. Thiss functionality is kept with the default setting
"SPACE".
Example
Possible values
SPACE - is the default. Numbering, RFC call and data base update in the same LUW
1 - Numbering and RFC are triggered from the Monitor Report (Transaction J1BNFE)
2 - Numbering in Monitor Report - RFC via batch report
3 - Numbering and RFC call are triggered in the batch report
Technical settings:
Data Class: APPL1
Size Category: 3
Buffering not allowed
Change DDIC
Use transaction SE11
Domain J_1BNFE_ACTION_REQUIRED
In the Tab Value Range Add new values
Value Short description:
9 Set NF-e number and send to SEFAZ
0 Set NF-e number and send to SEFAZ via Batch report
A Numbering is done in batch - no manual action required
B Send to SEFAZ via Batch report - no manual action required
In all tables add new field CALLRFC at the end of the field list.
Data element is J_1BNFERFCCALL
View J_1BB2V
In the TAB View Fields push the button Table fields, double-click on J_1BB2, and mark the
field:
CALLRFC
Change the maintenance screen for the view with transaction SE54. Insert view name
J_1BB2V. Mark Generated Objects and push CHANGE. Double click on screen 281. Select
LAYOUT.
Choose Dictionary/program fields window (F6). Insert J_1BB2V as table name.
For field J_1BB2V-CALLRFC mark short text (length 10).
Select field J_1BB2V-CALLRFC and insert it into frame NF-e behind Numbering Conting..
Set Do not convert in the shown popup
Insert in the flow logic in the PAI the yellow marked line:
FIELD J_1BB2V-BUKRS .
FIELD J_1BB2V-BRANCH .
FIELD J_1BB2V-FORM .
FIELD J_1BB2V-SUBOBJ .
FIELD J_1BB2V-TOTLIH .
FIELD J_1BB2V-TOTLIL .
FIELD J_1BB2V-FATURA .
FIELD J_1BB2V-SERIES .
FIELD J_1BB2V-SUBSER .
FIELD J_1BB2V-NUMBERRANGE .
FIELD J_1BB2V-FIELDNAME .
FIELD J_1BB2V-PRNTER .
FIELD J_1BB2V-PRNTERCONT .
FIELD J_1BB2V-LASSERPRINTER.
FIELD J_1BB2V-NFENRNR.
FIELD J_1BB2V-CALLRFC.
View J_1BB2DYNAMICV
In the TAB View Fields push the button Table fields, double-click on J_1BB2DYNAMICV, and
mark the field:
CALLRFC
Change the maintenance screen for the view with transaction SE54. Insert view name
J_1BB2DYNAMICV Mark Generated Objects and push CHANGE. Double click on screen
283. Select LAYOUT.
Choose Dictionary/program fields window (F6). Insert J_1BB2DYNAMICV V as table name.
Insert in the flow logic in the PAI the yellow marked line:
FIELD j_1bb2dynamicv-series .
FIELD j_1bb2dynamicv-subser .
FIELD j_1bb2dynamicv-prnter .
FIELD j_1bb2dynamicv-prntercont .
FIELD j_1bb2dynamicv-nfenrnr.
FIELD J_1BB2dynamicV-LASSERPRINTER.
FIELD J_1BB2dynamicV-CALLRFC.
IMG: Cross-Application Components -> General Application Functions -> Nota fiscal ->
Output -> Assign Numbering and Printing Parameters
The setting can be done in General Printing Parameters and/or Key-Specific Printing
Parameters