Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 22

Functional Specification

Segment O and N
BR Brasil

Date: 07.05.2018 pag 1 de 20


Index

1 Requirement....................................................................................................................3

2 Payment Methods strucutres......................................................................................4


2.1 Segment “O” Structure – Concessionaria...................................................................................4

2.2 Segment “N” Structure.....................................................................................................................6


2.2.1 Segment “N” – detail DARF...........................................................................................................6
2.2.2 Segment “N” – detail GPS.............................................................................................................9
2.2.3 Segment “N” – detail ICMS.........................................................................................................11
2.2.4 Segment “N” – detail FGTS.........................................................................................................13

3 Detailed Functional Requirements..........................................................................15


3.1 Segment “O” Functional Specification – Concessionaria....................................................15

3.2 Segment “O” and “N” upload program j_1bbr20....................................................................20

Date: 07.05.2018 pag 2 de 20


1 Requirement
The DME structure for Payment Methods Concessionária and Tax Payment will be copied as template
from Boleto Segment J. The template structure is defined in the include RFFORIY2 from report
RFFOBR_U.
DME structures for Itau and Febraban
file header j_1bdmexh1
lot header j_1bdmexh2
details, segment J j_1bdmexj
lot trailer j_1bdmext2
file trailer j_1bdmext1

Date: 07.05.2018 pag 3 de 20


2 Payment Methods strucutres

2.1 Segment “O” Structure – Concessionaria

The DME file is created when payment method and barcode field met the following requirements:

If REGUH-UBNKL(3) = 341
Payment method = “O” (Field: REGUH-RZAWE)
Invoice Barcode = starts with “8” (Field: RF05L-BRCDE (1) = 8 (BRCDE = REGUP-ESRNR & REGUP-
ESRRE & REGUP-DMBTR)

The DME Concessionária structures are going to be created according following specifications:

 File header

Same structure as j_1bdmexh1

 Lot header

Same structure as J_1bdmexh2 with changes in following field:

H207 (DME position 014 to 016) = '030' *fixo.

 Segment O

Same structure as j_1bdmexj with changes in following fields:

Segment_O Layout Entries from J_1BDMEXJ

Field Name Bank Description Position Segment_O fields Component Lenght Structure Description
Código Banco na first three digits for house bank
Compensação key, e.g. '341' for Itau
Código do Banco 001 003 =J01 J01 3
Lot control (for header '0000',
for trailer '9999')
Código do Lote Lote de Serviço 004 007 =J02 J02 4
Registro Detalhe de record type, e.g. '0' for the
Lote header
Tipo de Registro 008 008 =J03 J03 1
Número do Nº Sequencial Registro
Registro no Lote
009 013 =J04 J04 5 record number
Código Segmento Reg.
Detalhe
Segmento 014 014 Fixed = “O” J05 1 Segment type
Tipo de
Movimento
Tipo de Movimento 015 017 =J06 J06 3 Tipo de movimento
BRCDE = REGUP-ESRNR & REGUP-
ESRRE & REGUP-DMBTR
código de barras código de barras 018 065 Defined in Column F
Nome da
concessionária
concessionária 066 095 =J12 J12 30 Partner name
DATA DO VENCIMENTO
(NOMINAL)
DATA VENCTO 096 103 =J13 J13 8 Due date, format DDMMYYYY

Date: 07.05.2018 pag 4 de 20


Fixed value Defined in Column
F
moeda tipo de moeda 104 106 REA
quantidade Fixed value Defined in Column
moeda F
quantidade de moeda 107 121 “000000000000000”
VALOR previsto do
pagamento
valor a pagar 122 136 =J14 J14 15 Nominal value
DATA
PAGAMENTO
DATA DO PAGAMENTO 137 144 =J17 J17 8 Value date, format DDMMYYYY
VALOR de efetivação
DO PAGAMENTO
VALOR PAGo 145 159 “zeros” J18 15 Amount in Reais “zeros”
complemento de
registro
brancos 160 174 =J19 J19 15 Fines, always “Blanks”
nº docto ATRIBUÍDo
PELa empresa
seu número 175 194 =J20 J20 20 Seu Numero
complemento de
registro
brancos 195 215 =J21 J21 13 13 blanks
número atribuído pelo
banco
NOSSO Número 216 230 “Blanks” J22 15 Nosso Numero “Blanks”
CÓDIGO DE
OCORRÊNCIAS P/
Return code, blank when
RETORNO
sending “Blanks”

 Lot trailer

Same structure as j_1bdmext2

 File trailer
Same structure as j_1bdmext1 with changes in following Field:

j_1bdmext1-t107(6) = ' ' *6 positions = blank. (DME Position 30 to 35)

Date: 07.05.2018 pag 5 de 20


2.2 Segment “N” Structure

The DME file is created when payment method and barcode field met the following requirements:

If REGUH-UBNKL(3) = 341
Payment method = “N” (Field: REGUH-RZAWE)

The DME structures are going to be created according following specifications:

DARF
GPS
ICMS
FGTS

The above templates uses the following Invoice document fields to complement the DME creation:

XBLNR: Tax payment code (Código de pagamento)


BKTXT: Additional Infomation (Informações complementares)
ZUONR: Reference (Referência) – CNPJ of payer
KIDNO: Other entitites amount (Valor de outras entidades)

The additional tables:

Table ZTB00024:
Table to store interest GL account (687000).
Table to store fine GL account (750900).

Table ZTB00022:
Content for field XBLNR of DARF template details
Content for field XBLNR of GPS template details

2.2.1 Segment “N” – detail DARF

DME Structures - file header, lot header, segment N, lot trailer and file trailer:

 File header

Same structure as j_1bdmexh1

 Lot header

Date: 07.05.2018 pag 6 de 20


Same structure as J_1bdmexh2 with changes in following field:

H205 (DME position 010 to 011) = '22' *fixo.


H206 (DME position 012 to 013) = '16' *fixo.

 Segment N

Same structure as j_1bdmexj with changes in following fields:

Segment_N Layout Entries from J_1BDMEXJ

Bank
Field Name Description Position Conteúdo Component Lenght Structure Description
Código Banco
Código do Banco na 001 003 =J01 J01 3 first three digits for house bank
Compensação key, e.g. '341' for Itau
Lot control (for header '0000', for
Código do Lote Lote de Serviço 004 007 =J02 J02 4 trailer '9999')

Registro Ctg.de registro, p.ex. '0' para


Tipo de Registro Detalhe de Lote 008 008 3 J03 1 cabeçalho

Nº Sequencial
Número do Registro no 009 013 =J04 J04 5 record number
Registro Lote

Código
Segmento Segmento Reg. 014 014 N J05 1 Tipo de segment
Detalhe

Tipo de Tipo de
Movimento Movimento 015 017 =J06 J06 3 Tipo de movimento
dados de
dados do tributo identificação do 018 195 Details (*)
tributo

nº docto
ATRIBUÍDo PELa
seu número empresa 196 215 =J21 J21 13 13 blanks

número
NOSSO Número atribuído pelo 216 230 =J22 J22 15 Nosso Numero
banco

CÓDIGO DE
OCORRÊNCIAS OCORRÊNCIAS 231 240 =J23 J23 10 Return code, blank when sending
P/ RETORNO

*Details (DARF)
Position in DME file:

 018 to 019 = 02 (Darf)


 020 to 023 = informação da (REGUP-XBLNR)

Date: 07.05.2018 pag 7 de 20


Entries available for REGUP-XBLNR = 0422, 0473, 0561, 0588, 1150, 1708, 2089, 2172, 2362,
2372, 2484, 3208, 3280, 3426, 5706, 5856, 5939, 5952, 5960, 5979, 5987, 6256, 6912, 8045, 8109
and 8741 (Stored in table Z_FI_CONTAS_DARF)

 024 to 024 = 2 (fixed)


 025 to 038 = Field from Structure (CNPJ contribuinte) J_1BDMEXH1- H106
 039 to 046 = Calculation Period (Período de apuração) BKPF-BLDAT
 047 to 063 = Refence from assignment field REGUP-ZUONR
 064 to 077 = Net Amount (Valor do Principal) REGUP-WRBTR
 078 to 091 = Fine amount (Valor da Multa) – Amount posted in accounts from table
Z_FI_CONTAS_MULTA (fields like HKONT)
 092 to 105 = interest amount (Valor dos juros) – Amount posted in accounts from table
Z_FI_CONTAS_JUROS (fields like HKONT)
 106 to 119 = Total amount – Sum of 3 previous fields (Net Amount + Fine Amount +
Interest amount)
 120 to 127 = Net due date (Data de Vencimento) – E_FAEDT from FM:
NET_DUE_DATE_GET (Import I_ZFBDT, I_ZBD1T, I_ZBD2T, I_ZBD3T)
 128 to 135 = Payment date (Data do pagamento) – BSAK-AUGDT
 136 to 165 = Blank
 166 to 195 = Company Code (Nome do Contribuinte) – T001-BUTXT

 Lot trailer

Same structure as j_1bdmext2 with changes in following Fields:

 024 to 037 = Sum of all records of Net Amount (Valor do Principal 064 to 077).
 038 to 051 = Sum values from all documents with content populated in field BSEG-KIDNO.
 052 to 065 = Sum all values in GL account in tables Z_FI_CONTAS_JUROS and
Z_FI_CONTAS_MULTA.
 066 to 079 = Sum of values of REGUP-WRBTR from all BELNR
 080 to 240 = Blank

 File trailer
Same structure as j_1bdmext1 with changes in following Field:

j_1bdmext1-t107(6) = ' ' *6 positions = blank. (DME Position 30 to 35)

Date: 07.05.2018 pag 8 de 20


2.2.2 Segment “N” – detail GPS

DME Structures - file header, lot header, segment N, lot trailer and file trailer:

 File header

Same structure as j_1bdmexh1

 Lot header

Same structure as J_1bdmexh2 with changes in following field:

H205 (DME position 010 to 011) = '22' *fixo.


H206 (DME position 012 to 013) = '17' *fixo.

 Segment N

Same structure as j_1bdmexj defined in topic: 2.2.1 Segment “N” DARF.


The details section from position 018 to 195 are described as follows:

*Details (GPS)

 018 to 019 = ‘01’ (GPS)


 020 to 023 = REGUP-XBLNR

Entries available for REGUP-XBLNR = 1406, 2100, 2119, 2208, 2216, 2631 and 2909 (Stored in
table Z_FI_CONTAS_INSS).

 024 to 029 = mês e ano REGUP-BLDAT


 030 to 043 = If position 020-023 (XBLNR) is 2631, this field is REGUP-ZUONR, else if it’s
the J_1BDMEXH1- H106 (CNPJ contribuinte).
 044 to 057 = INSS Tax Amount REGUP-WRBTR minus amount in REGUP-KIDNO and
BSEG-WRBTR from accounts in tables: Z_FI_CONTAS_JUROS e
Z_FI_CONTAS_MULTA.
 058 to 071 = Other entitites amount REGUP-KIDNO
 072 to 085 = Evaluated Amount is the BSEG-WRBTR of GL accounts in table
Z_FI_CONTAS_JUROS.
 086 to 099 = Amount REGUP-WRBTR
 100 to 107 = Payment date (Data do pagamento) – BSAK-AUGDT
 108 to 115 = Blank
 116 to 165 = Enter information from field BKPF-BKTXT selected from BELNR
 166 to 195 = Name of Payer. If position 020-023 (XBLNR) is 2631, get REGUP-ZUONR
and select LFA1-NAME1 with ZUONR=STCD1. Else if it’s the J_1BDMEXH1- H106
(CNPJ contribuinte)

Date: 07.05.2018 pag 9 de 20


 166 to 195 = Company Code (Nome do Contribuinte) – T001-BUTXT

 Lot trailer

Same structure as j_1bdmext2 with changes in following Fields:

 024 to 037 = Sum of all records of Net Amount (Valor do Principal 044 to 057). If REGUP-
XBLNR is INSS (2100, 2119, 2208, 2216, 1406 or 2631) this amount must be deducted of
REGUP-KIDNO amount sum.
 038 to 051 = Sum values from all documents with content populated in field BSEG-KIDNO.
 052 to 065 = Sum all values in GL account in tables Z_FI_CONTAS_JUROS and
Z_FI_CONTAS_MULTA.
 066 to 079 = Sum of all field 086 to 099 = Amount REGUP-WRBTR
 080 to 240 = Blank

 File trailer
Same structure as j_1bdmext1 with changes in following Field:

j_1bdmext1-t107(6) = ' ' *6 positions = blank. (DME Position 30 to 35)

Date: 07.05.2018 pag 10 de 20


2.2.3 Segment “N” – detail ICMS

DME Structures - file header, lot header, segment N, lot trailer and file trailer:

 File header

Same structure as j_1bdmexh1

 Lot header

Same structure as J_1bdmexh2 with changes in following field:

H205 (DME position 010 to 011) = '22' *fixo.


H206 (DME position 012 to 013) = '22' *fixo.

 Segment N

Same structure as j_1bdmexj defined in topic: 2.2.1 Segment “N” DARF.


The details section from position 018 to 195 are described as follows:

*Details (ICMS)

 018 to 019 = ‘05’ (ICMS)


 020 to 023 = REGUP-XBLNR

Entries available for REGUP-XBLNR = 1200, 0462 and 1929 (Stored in table Z_FI_CONTAS_INSS).

 024 to 024 = 1 (fixed)


 025 to 038 = Field from Structure (CNPJ contribuinte) J_1BDMEXH1- H106
 039 to 050 = State Tax Number (Inscrição Estadual) J_1BBRANCH-STATE_INSC)
 051 to 063 = Número divida Ativa REGUP-ZUONR
 064 to 069 = Month and year in format MMYYYY from REGUP-BLDAT
 070 to 082 = Installment number (Número parcela/notificação) from BKPF-BXTXT
 083 to 096 = ICMS Tax Amount REGUP-WRBTR minus amount BSEG-WRBTR from
accounts in tables: Z_FI_CONTAS_JUROS e Z_FI_CONTAS_MULTA
 097 to 110 = interest amount (Valor dos juros) – Amount posted in accounts from table
Z_FI_CONTAS_JUROS (fields like HKONT)
 111 to 124 = Fine amount (Valor da Multa) – Amount posted in accounts from table
Z_FI_CONTAS_MULTA (fields like HKONT)
 125 to 138 = Payment Amount REGUP-WRBTR
 139 to 146 = Net due date (Data de Vencimento) – E_FAEDT from FM:
NET_DUE_DATE_GET (Import I_ZFBDT, I_ZBD1T, I_ZBD2T, I_ZBD3T)
 147 to 154 = Payment date (Data do pagamento) – BSAK-AUGDT
 155 to 165 = Blank

Date: 07.05.2018 pag 11 de 20


 166 to 195 = Company Code (Nome do Contribuinte) – T001-BUTXT
 196 to 215 = Payment Document number REGUP-VBLNR
 216 to 240 = Blank

 Lot trailer

Same structure as j_1bdmext2 with changes in following Fields:

 024 to 037 = Sum of all records of Net Amount (Valor do Principal 044 to 057). If REGUP-
XBLNR is INSS (2100, 2119, 2208, 2216, 1406 or 2631) this amount must be deducted of
REGUP-KIDNO amount sum.
 038 to 051 = Sum values from all documents with content populated in field BSEG-KIDNO.
 052 to 065 = Sum all values in GL account in tables Z_FI_CONTAS_JUROS and
Z_FI_CONTAS_MULTA.
 066 to 079 = Sum of all field 125 to 138 = Amount REGUP-WRBTR
 080 to 240 = Blank

 File trailer
Same structure as j_1bdmext1 with changes in following Field:

j_1bdmext1-t107(6) = ' ' *6 positions = blank. (DME Position 30 to 35)

Date: 07.05.2018 pag 12 de 20


2.2.4 Segment “N” – detail FGTS

DME Structures - file header, lot header, segment N, lot trailer and file trailer:

 File header

Same structure as j_1bdmexh1

 Lot header

Same structure as J_1bdmexh2 with changes in following field:

H205 (DME position 010 to 011) = '22' *fixo.


H206 (DME position 012 to 013) = '35' *fixo.

 Segment N

Same structure as j_1bdmexj defined in topic: 2.2.1 Segment “N” DARF.


The details section from position 018 to 195 are described as follows:

*Details (FGTS)

 018 to 019 = ‘11’ (FGTS-GEFIP)


 020 to 023 = REGUP-XBLNR

Entries available for REGUP-XBLNR = 150, 115 and 155 (Stored in table Z_FI_CONTAS_FGTS).

 024 to 024 = 1 (fixed)


 025 to 038 = Field from Structure (CNPJ contribuinte) J_1BDMEXH1- H106
 039 to 086 = BarCode (RF05L-BRCDE) enter 44 positions
 087 to 102 = FGTS identification REGUP-ZUONR
 103 to 111 = Lacre da conectividade BKPF-BKTXT(9) (9 frist positions)
 112 to 113 = Lacre da conectividade BKPF-BKTXT (2 last positions)
 114 to 143 = Company Code (Nome do Contribuinte) – T001-BUTXT
 144 to 151 = Payment date (Data do pagamento) – BSAK-AUGDT
 152 to 165 = Payment Amount REGUP-WRBTR
 166 to 195 = Blank
 196 to 215 = Payment Document number REGUP-VBLNR
 216 to 240 = Blank

 Lot trailer

Date: 07.05.2018 pag 13 de 20


Same structure as j_1bdmext2 with changes in following Fields:

 024 to 037 = Sum of all records of Net Amount (Valor do Principal 044 to 057). If REGUP-
XBLNR is INSS (2100, 2119, 2208, 2216, 1406 or 2631) this amount must be deducted of
REGUP-KIDNO amount sum.
 038 to 051 = Sum values from all documents with content populated in field BSEG-KIDNO.
 052 to 065 = Sum all values in GL account in tables Z_FI_CONTAS_JUROS and
Z_FI_CONTAS_MULTA.
 066 to 079 = Sum of all field 125 to 138 = Amount REGUP-WRBTR
 080 to 240 = Blank

 File trailer
Same structure as j_1bdmext1 with changes in following Field:

j_1bdmext1-t107(6) = ' ' *6 positions = blank. (DME Position 30 to 35)

Date: 07.05.2018 pag 14 de 20


3 Detailed Functional Requirements

3.1 Segment “O” Functional Specification – Concessionaria

The payment method O Barcode starts with 8 and has 48 positions lengh. The field validation of
message 8B799, function module CONVERT_TO_BARCODE must be disable. The field have to free
for data entering.

Barcode function module:

CONVERT_BARCODE
Populate BSEG fields: ESRNR ESRRE

CONVERT_TO_BARCODE
Barcode numbering checking

ESRNR ISR Number


ESRRE ISR Reference Number
DMBTR Amount in LC

BARCODE = REGUP-ESRNR & REGUP-ESRRE & REGUP-DMBTR

Barcode template: 84660000007291510291100036152351009125121001

Date: 07.05.2018 pag 15 de 20


Badi updating: BOLETO_BARCODE_BR

In case barcode is written in 48 positions we have to convert into 44 to be written in DME file.
The conversion rule from 48 to 44 position is to remove the positions: 12, 24, 36 and 48:

Exemple:

Barcode 48 positions:

83630000017 8 05090053106 7 09216332900 3 20001537013 9

8 3 Digit
6 3 0 0 0 0 0 1 7 8 0 5 0 9 0 0 5 3 1 0 6 7 0 9 2 1 6 3 3 2 9 0 0 3 2 0 0 0 1 5 3 7 0 1 3 9

Position 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4
0 1 3 4 5 6 7 8 9 0 1 2 3 5 6 7 8 9 0 1 2 3 4 5 7 8 9 0 1 2 3 4 5 6 7
1 2 3 4 5 6 7 8 9 12 24 36 48

Result of barcode 44 positions:

83630000017050900531060921633290020001537013

Table BSEG for barcode storage:

ESRNR( ESRNR
4) DMBTR (11) + 4 (4) ESRRE (25)
8 3 6 3 0 0 0 0 0 1 7 0 5 0 9 0 0 5 3 1 0 6 0 9 2 1 6 3 3 2 9 0 0 2 0 0 0 1 5 3 7 0 1 3
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4
1 2 3 4 5 6 7 8 9

ESRNR: 83630053
ESRRE: 1060921633290020001537013
DMBTR: 00000170509 (Campo da BSEG tem 13 posições 0000000170509. Eliminar dois zeros à
esquerda para escrever o código de barras)

Technical Details as example:

1. Copia implementação BAPI BOLETO_BARCODE_BR para ZBOLETO_BARCODE_BR.

Date: 07.05.2018 pag 16 de 20


Date: 07.05.2018 pag 17 de 20
Date: 07.05.2018 pag 18 de 20
2. Ativar nova implementação

3. Modifcar métodos IF_EX_BOLETO_BARCODE~REVERT. Insira o cõdigo abaixo na linha 67.

FIELD-SYMBOLS: <fs_ZLSCH> TYPE ANY.

ASSIGN ('(SAPMF05L)BSEG-ZLSCH') TO <fs_ZLSCH>.

IF <fs_ZLSCH> IS ASSIGNED.

IF <fs_ZLSCH> eq 'A' and


STRLEN( LV_BARCODE_CHAR ) EQ 47.

CONCATENATE LV_BARCODE_CHAR(11)
LV_BARCODE_CHAR+12(11)
LV_BARCODE_CHAR+24(11)
LV_BARCODE_CHAR+36(11)
into LV_BARCODE_CHAR.

ENDIF.
ENDIF.

4. Slution Test :

Enter FBL1N for company code 1820. Double click to select an item.

Date: 07.05.2018 pag 19 de 20


Date: 07.05.2018 pag 20 de 20
If the barcode is inserted with 48 positions then the numbering must be converted to 44 automatically:
83630000017050900531060921633290020001537013

Date: 07.05.2018 pag 21 de 20


After this point the standard automatic payment program must be run. Then we have DME fie creation.

3.2 Segment “O” and “N” upload program j_1bbr20

The report j_1bbr20 must be enhanced to upload file for Brazil in transaction FF.5 by report
RFEBKA00.

The below code must be updated for Segment ‘J’ and ‘O’ and ‘N’.

When ‘O’ the program will perform same logic as ‘J’.


When ‘N’ the program will perform same logic as ‘J’ and items_p_j-j18 = ‘zeros’

Date: 07.05.2018 pag 20 de 20

You might also like