You are on page 1of 53

Document type

AP355 – Functional Design Extension


PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 1 (53)

J_1BAJ Document Control:

Roadmap Reference: AP355 – Issue NF regarding Inventory Adjustments for Finished Products
Team: Plan to Deliver

Created by Tiago Marques Creation date 30/06/2016


tiago_marques@infosys.com
Review # Date Revised by Revised section
1.0 30/06/2016 Tiago Marques Draf
1.0 10/07/2016 Thiago Tavares Completed
2.0 25/07/2017 Kely Ramos PPM77056.02

Relationships:
Process Realizar o Controle Operacional das plantas de Beneficiamento e Expedição
Subprocess Realizar o controle operacional da expedição
Controlar a rotina das plantas de beneficiamento
Related Documents (BP 310) BP310 Controlar Rotina de Produção da Usina de Beneficiamento
Monitoramento e Controle de Operações de Mina BP310
BP310 Controlar Produção, Consumo de Matérias-Primas e Estoque
BP310 Realizar Controle Operacional de Portos
BP310 Realizar Apuração de Inventário

1
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 2 (53)

Summary

1. Header......................................................................................................................................................... 3
2. Detailed Functional Description................................................................................................................... 4
2.1. Reason and Purpose of the Business................................................................................................. 4
2.2. Needs Description............................................................................................................................... 4
2.2.1. Current Functionality................................................................................................................... 4
2.2.2. Desired Funcionality.................................................................................................................... 4
2.3. Main Information Flow......................................................................................................................... 5
2.4. Access Authorization........................................................................................................................... 5
2.5. Errors log and handling....................................................................................................................... 5
2.6. Execution Planning............................................................................................................................. 5
3. Technical Considerations............................................................................................................................. 6
3.1. Solution Detailing................................................................................................................................ 6
3.1.1. SAP User-Exits........................................................................................................................... 9
3.1.2. Function Exits............................................................................................................................. 9
3.1.3. Field Exits................................................................................................................................... 9
3.1.4. Menu Exits.................................................................................................................................. 9
3.1.5. Screen Exits................................................................................................................................ 9
3.1.6. Search Help Exits........................................................................................................................ 9
3.1.7. Search Help assignment........................................................................................................... 10
3.1.8. BADI.......................................................................................................................................... 10
3.1.9. Custom Transaction.................................................................................................................. 10
3.1.10. Requirement routine.................................................................................................................. 10
3.1.11. Business Transaction event (If any…).......................................................................................10
3.1.12. Substitution............................................................................................................................... 10
3.2. Improvements................................................................................................................................... 11
3.2.1. Validation................................................................................................................................... 11
3.2.2. Log............................................................................................................................................ 11
3.3. Screen Layout................................................................................................................................... 11
3.3.1. Input Parameters for Selection Screen......................................................................................11
1. Data Source Consideration............................................................................................................... 11
2. Data Validation.................................................................................................................................. 12
3.4. Solution Logical Flow........................................................................................................................ 12
3.5. Additional Considerations................................................................................................................. 12
3.5.1. Custom Tables.......................................................................................................................... 12
4. Test Requirements..................................................................................................................................... 13
5. Reference Documents............................................................................................................................... 14
6. Questions and Problems........................................................................................................................... 15
7. Translation Table....................................................................................................................................... 15

2
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 3 (53)

1. Header

Team: MM, PP, FI, CO Creation Date 30/06/2016


Components of the
SAP System:
Process Lead Gilson Santana – Phone (31) 3306-8976
gilson.santana@vale.com
Title AP355 – Issue NF regarding Inventory Adjustments for Finished Products
Brief Description Functional Specification for a enhancement that will identify the inventory
adjustments and material movements in the current and previous period and issue
NF if applicable
Priority High/Mandatory Medium/Recommended Low/Optional
Gap Global Local
Extension
Specification
Exit Abap On-Line
Program Type:
Java Others [Report]

Exit Type (Applicable only for Exits)

User Table BADI Field Others

Nº Estimated of
Users:
Complexity Very High High Medium Low

3
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 4 (53)

2. Detailed Functional Description

2.1. Reason and Purpose of the Business

This requirement is necessary to create NF regarding the Inventory Adjustments process


automatically. It’s applicable just for Topographical Adjustments.

2.2. Needs Description

This enhancement will be composed by:


A) Consolidation Program - triggered in Background (JOB) will look for inventory adjustments in
the current period and in the previous periods when the back posting is allowed
B) Inventory Adjustment Cockpit
B.1) User will be able to maintain dates regarding the Topographical measurements
B.2) User will be able to trigger the NF creation
B.3) User will be able to view the Historic Data

2.2.1. Current Functionality


Nowadays Notas Fiscais are not created for the gains and losses.

2.2.2. Desired Funcionality

To fulfil the Process requirement this FD will be split in three Process

 Program to consolidate the Inventory Adjustments performed in the Open Periods

 Cockpit considering the following functionalities:

- Enter period for Topographical Analysis

- Visualize closed and open Inventory Process

- Trigger the NF issuing for the data consolidated in the first program

4
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 5 (53)

2.3. Main Information Flow


1. Run the program to identify the Inventory Adjustments.

2. Get the relevant Batches.

3. Select the Inventory Adjustments in the period.

4. IF the Topographic Measurement is not defined, create just the records regarding Inventory Adjustment and
Finish the process

ELSE create the records regarding Inventory Adjustment and the relevant movements in the period.

2.4. Access Authorization

2.5. Errors log and handling

2.6. Execution Planning

5
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 6 (53)

3. Technical Considerations

3.1. Solution Detailing

3.1.1. CONSOLIDATION PROGRAM

The following TVARVC variable will be considered for this development

TVARVC-NAME (OLD) TVARVC-TYPE TVARVC-NAME (AFTER NAMING CONVENTION)


NFAJT_TPMAT_SPLIT_TPMOV S CM.PPM77056_0001
NFAJT_MAT_SPLIT_TPMOV S CM.PPM77056_0002
NFAJT_PLANT_GRP S CM.PPM77056_0003
NFAJT_EVAL_CNTR_NF P CM.PPM77056_0004
NFAJT_TPMOV_BASIS_PLANTTYP S CM.PPM77056_0005
NFAJT_TPMOV_BASIS_PLANT S CM.PPM77056_0006
NFAJT_MAT_PLANT_%VAR P CM.PPM77056_0007

* SPLIT SELECTION OPTION - CM.PPM77056_0001*

The values inside the Selection Option CM.PPM77056_0001 need to be separated in the following structure
based in the TVARVC-LOW and separated by “;”

MATERIAL TYPE ; VALUATION TYPE ; MOVEMENT TYPE ; REASON CODE

Example:
FERT ; PROPRIO ; Z01 ; 12

* SPLIT SELECTION OPTION - CM.PPM77056_0002*

The values inside the Selection Option CM.PPM77056_0002 need to be separated in the following structure
based in the TVARVC-LOW and separated by “;”

MATERIAL ; VALUATION TYPE ; MOVEMENT TYPE ; REASON CODE

Example
55500396 ; PROPRIO ; Z01 ; 12

6
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 7 (53)

*SPLIT SELECTION OPTION - CM.PPM77056_0003*

The values inside the Selection Option CM.PPM77056_0003 need to be separated in the following structure
based in the TVARVC-LOW and TVARVC-HIGH.

TVARVC-LOW TVARVC-HIGH
PLANT PLANT GROUP

Example
PLANT PLANT GROUP
1070 USINAS MFE SUDESTE

*SPLIT PARAMETER - CM.PPM77056_0004*

The values inside the Selection Option CM.PPM77056_0004 need to be separated in the following structure
based in the TVARVC-LOW and separated by “;”

Example
Y/N

*SPLIT SELECTION OPTION - CM.PPM77056_0005*

The values inside the Parameter CM.PPM77056_0005 need to be separated in the following structure based
in the “;”.

The values inside the Selection Option CM.PPM77056_0005 need to be separated in the following structure
based in the TVARVC-LOW and TVARVC-HIGH.

TVARVC-LOW TVARVC-HIGH
PLANT TYPE MOVEMENT TYPES

Example
TVARVC-LOW TVARVC-HIGH
MPL 101;102

*SPLIT PARAMETER - CM.PPM77056_0006*

The values inside the Parameter CM.PPM77056_0006 need to be separated in the following structure based
in the “;”.

TVARVC-LOW TVARVC-HIGH
PLANT MOVEMENT TYPES

Example
TVARVC-LOW TVARVC-HIGH
1070 101;102;Y75;Y76

7
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 8 (53)

*SPLIT PARAMETER - CM.PPM77056_0007*

The values inside the Selection Option CM.PPM77056_0007 need to be separated in the following structure
based in the TVARVC-LOW and separated by “;”

MATERIAL ; PLANT ; MONTH ; % OF LOSSES ; % OF GAINS

Example:
55500396 ; 1070 ; 01 ; -3 ; +5
------------------------------------------------------------------------------------------------------------------------------------------------

8
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 9 (53)

*CHECK IF THE PLANT FROM SELECTION SCREEN IS VALID*

SELECT T001W WHERE


WERKS = S_PLANT

If at least one record is Found

CONTINUE

ELSE

RAISE PLANT_NOT_FOUND.

*CHECK IF THE PLANT FROM SELECTION SCREEN IS RELEVANT FOR THE PROCESS*

Check if S_PLANT is in the Selection Option in TVARVC table, the development must consider just the Plants
that are inside these retrieved values.

Select TVARVC table using:

 TVARVC-NAME = CM.PPM77056_0003
 TVARVC-TYPE = “S”

Retrieving TVARVC-LOW and TVARVC-HIGH

IF at least one plant from S_PLANT is in TVARVC-LOW AND IF all the retrieved TVARVC-HIGH have the same content

CONTINUE

ELSE

STOP the JOB processing sending the correspondent cause in the JOB LOG (SPOOL)

------------------------------------------------------------------------------------------------------------------------------------------------

*CHECK THE COMPANY CODE FROM SELECTED PLANTS AND CHECK THE OPEN PERIODS*

Use the Plants retrieved in the previous step as INPUT in MARV-WERKS parameter in MARV_READ.

9
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 10 (53)

Company Code WMARV-BUKRS


Year Current Period WMARV-LFGJA
Current Period WMARV-LFMON
Allow Posting to Previous Period (Backposting) WMARV-XRUEM
Fiscal year of previous period WMARV-VMGJA
Month of previous period WMARV-VMMON

*CHECK THE PLANT TYPE *

Use the Plants retrieved in the previous step as INPUT in ZOVTSD_PLANT_TYP-WERKS and retrieve
ZOVTSD_PLANT_TYP-PLANT_TYP.

10
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 11 (53)

*SELECT RELEVANT MATERIALS*

Use the CM.PPM77056_0001- MATERIAL TYPE as key in MARA- MARA-MTART and retrieve MARA-MATNR.
Add the other records from CM.PPM77056_0002- MATERIAL.
Delete duplicates and select in MARC-MATNR using Plants Validated from Selection Screen

*SELECT RELEVANT MOVEMENT TYPES*

Retrieve the CM.PPM77056_0001- MOVEMENT TYPE and ADD the exceptions from CM.PPM77056_0002-
MOVEMENT TYPE

11
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 12 (53)

*CHECK IF THE PROCESS IS THE FIRST EXECUTION*

SELECT ZCMTSD_NFAJT_HD

ZCMTSD_NFAJT_HD-MONTH = WMARV-LFMON
ZCMTSD_NFAJT_HD-YEAR = WMARV-LFMON
ZCMTSD_NFAJT_HD-PLANT = CM.PPM77056_0003-LOW
ZCMTSD_NFAJT_HD-STATUS = “C” or “I” or “F” or “E”

IF no record is found

PROCESS_TYPE = INITIAL

ELSEIF ZCMTSD_NFAJT_HD-STATUS = “I” or “F”

STOP the JOB processing sending the correspondent cause in the JOB LOG (SPOOL)

ELSEIF ZCMTSD_NFAJT_HD-STATUS = “C”

PROCESS_TYPE = REPROCESSING

ELSEIF ZCMTSD_NFAJT_HD-STATUS = “E”

PROCESS_TYPE = INITIAL

------------------------------------------------------------------------------------------------------------------------------------------------

12
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 13 (53)

*CHECK FIRST AND LAST DAY FOR THE OPEN PERIOD AND PREVIOUS PERIOD (JUST IF WMARV-XRUEM =
“X”)

Use a date in the Periods to identify the periods and select the Inventory Adjustments

------------------------------------------------------------------------------------------------------------------------------------------------

13
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 14 (53)

*SELECT BATCHES CREATED IN THE OPEN PERIOD AND PREVIOUS PERIOD (IF WMARV-XRUEM = “X”)*

Select MCHB-CHARG using:


 Material codes obtained in *SELECT RELEVANT MATERIALS* in MCHB-MATNR
 Validated Plants from S_PLANT in MCHB-WERKS
 First and Last day of the period in MCHB-ERSDA

------------------------------------------------------------------------------------------------------------------------------------------------

*SELECT BATCHES MODIFIED IN THE OPEN PERIOD AND PREVIOUS PERIOD (IF WMARV-XRUEM = “X”)*

Select MCHB-CHARG using:


 Material codes obtained in *SELECT RELEVANT MATERIALS* in MCHB-MATNR
 Validated Plants from S_PLANT in MCHB-WERKS
 First and Last day of the periods in MCHB-LAEDA

IF afer these searches no record is selected, STOP the JOB and SAVE the correspondent cause in the JOB LOG
(SPOOL)

14
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 15 (53)

ELSE CONTINUE

------------------------------------------------------------------------------------------------------------------------------------------------

*SELECT THE INVENTORY ADJUSTMENTS IN THE OPEN PERIOD*

Use the BAPI_GOODSMVT_GETITEMS informing

MATERIAL_RA MCHB-MATNR
PLANT_RA MCHB-WERKS
BATCH_RA MCHB-CHARG
MOVE_TYPE_RA Movement Types retrieved from *SELECT RELEVANT MOVEMENT TYPES*
PSTNG_DATE_RA First and Last day from the Open Period

15
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 16 (53)

*SELECT THE INVENTORY ADJUSTMENTS IN THE PREVIOUS PERIOD (IF WMARV-XRUEM = “X”)*

Use the BAPI_GOODSMVT_GETITEMS informing

MATERIAL_RA MCHB-MATNR
PLANT_RA MCHB-WERKS
BATCH_RA MCHB-CHARG
MOVE_TYPE_RA Movement Types retrieved from *SELECT RELEVANT MOVEMENT TYPES*
PSTNG_DATE_RA First and Last day from Previous Period (IF WMARV-XRUEM = “X”*)

Start PPM77056,2

Deverá verificar se todos os materiais e plantas tiveram movimentação. Para isso percorrer o resultado da
seleção da tabela MCHB e verificar se para o Material e Centro existem registros correspondentes na tabela
GOODSMVT_ITEMS. Se não houver, selecionar as informações de estoque do período anterior na tabela
MBEWH (LBKUM, VERPR e PEINH) para o tipo de avaliação (BWTAR) na constante CM.PPM77056_0002-
VALUATION TYPE.

End PPM76056_2

IF no record is selected, STOP the JOB and SAVE the correspondent cause in the JOB LOG (SPOOL)

ELSE CONTINUE

------------------------------------------------------------------------------------------------------------------------------------------------

16
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 17 (53)

*DELETE MOVEMENT TYPE AND REASON CODE NOT RELEVANT*

Use GOODSMVT_ITEMS-MATERIAL and GOODSMVT_ITEMS-VAL_TYPE to check if there is some record in


CM.PPM77056_0002-MATERIAL and CM.PPM77056_0002-VALUATION TYPE
For the selected records retrieve CM.PPM77056_0002-MOVEMENT TYPE and CM.PPM77056_0002-
REASON CODE and keep in GOODSMVT_ITEMS just the records from CM.PPM77056_0002.

*SELECT THE AMOUNT IN LOCAL CURRENCY FOR THE RETRIEVED MATERIAL DOCUMENTS*

For the remaining records in GOODSMVT_ITEMS select the amount in MSEG-DMBTR

Start PPM77056,2

Selecionar o campo de Unidade de Medida Básica (MEINS) na tabela MARA para os materiais (MBEWH-
MATNR).

Utilizar os campos GOODSMVT_ITEMS-MATERIAL e GOODSMVT_ITEMS-PLANT ou MBEWH-MATNR e


MBEWH-WERKS para acessar a tabela MARC e buscar o campo NCM (MARC-STEUC).

End PPM76056_2
____________________________________________________________________________________________________________

IF PROCESS_TYPE = INITIAL

*CREATE RECORD IN ZCMTSD_NFAJT_HD TABLE FOR THE OPEN PERIOD*

ZCMTSD_NFAJT_HD-MONTH = WMARV-LFMON
ZCMTSD_NFAJT_HD-YEAR = WMARV- LFGJA
ZCMTSD_NFAJT_HD-PLANT = NFAJT_PLANT_GRP-LOW
ZCMTSD_NFAJT_HD-PLANT_GROUP = NFAJT_PLANT_GRP-HIGH
ZCMTSD_NFAJT_HD-PRC_USER = SY-USER
ZCMTSD_NFAJT_HD-PRC_DATE = SY-DATUM
ZCMTSD_NFAJT_HD-PRC_TIME = SY-USEIT
ZCMTSD_NFAJT_HD-STATUS = “C”

*CREATE RECORD IN ZCMTSD_NFAJT_DOC_MAT TABLE FOR THE FOR THE OPEN PERIOD*

ZCMTSD_NFAJT_DOC_MAT -MONTH = WMARV-LFMON


ZCMTSD_NFAJT_DOC_MAT -YEAR = WMARV- LFGJA
ZCMTSD_NFAJT_DOC_MAT -PLANT_GROUP = NFAJT_PLANT_GRP-HIGH
ZCMTSD_NFAJT_DOC_MAT -MBLNR = GOODSMVT_ITEMS-MAT_DOC
ZCMTSD_NFAJT_DOC_MAT -DOC_YEAR = GOODSMVT_ITEMS-DOC_YEAR
ZCMTSD_NFAJT_DOC_MAT -MATDOC_ITM = GOODSMVT_ITEMS-MATDOC_ITM
ZCMTSD_NFAJT_DOC_MAT -MATERIAL = GOODSMVT_ITEMS-MATERIAL
ZCMTSD_NFAJT_DOC_MAT -PLANT = GOODSMVT_ITEMS-PLANT
ZCMTSD_NFAJT_DOC_MAT -STGE_LOC = GOODSMVT_ITEMS-STGE_LOC
ZCMTSD_NFAJT_DOC_MAT -BATCH = GOODSMVT_ITEMS-BATCH
ZCMTSD_NFAJT_DOC_MAT -MOVE_TYPE = GOODSMVT_ITEMS-MOVE_TYPE
ZCMTSD_NFAJT_DOC_MAT -VAL_TYPE = GOODSMVT_ITEMS-VAL_TYPE
ZCMTSD_NFAJT_DOC_MAT -ENTRY_QNT = GOODSMVT_ITEMS-ENTRY_QNT
ZCMTSD_NFAJT_DOC_MAT -ENTRY_UOM = GOODSMVT_ITEMS-ENTRY_UOM
ZCMTSD_NFAJT_DOC_MAT -PROCESSED = “N”

17
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 18 (53)

ZCMTSD_NFAJT_DOC_MAT -AMOUNT = MSEG-DMBTR

_______________________________________________________________________________________

Start PPM77056,2

IF
The NCM Group option is selected

ZCMTSD_NFAJT_DOC_MAT-STEUC = MARC-STEUC
ENDIF

*CREATE RECORD IN ZCMTSD_NFAJT_DOC_MAT TABLE FOR THE FOR THE OPEN PERIOD WITHOUT MOVEMENTS*

ZCMTSD_NFAJT_DOC_MAT -MONTH = WMARV-LFMON


ZCMTSD_NFAJT_DOC_MAT -YEAR = WMARV- LFGJA
ZCMTSD_NFAJT_DOC_MAT -PLANT_GROUP = NFAJT_PLANT_GRP-HIGH
ZCMTSD_NFAJT_DOC_MAT -MATERIAL = MBEWH-MATNR
ZCMTSD_NFAJT_DOC_MAT -PLANT = MBEWH-PLANT
ZCMTSD_NFAJT_DOC_MAT -VAL_TYPE = MBEWH-BWTAR
ZCMTSD_NFAJT_DOC_MAT -ENTRY_QNT = MBEWH-LBKUM
ZCMTSD_NFAJT_DOC_MAT -ENTRY_UOM = MARA-MEINS
ZCMTSD_NFAJT_DOC_MAT -PROCESSED = “N”
ZCMTSD_NFAJT_DOC_MAT -AMOUNT = (MBEWH-VERPR / MBEWH-PEINH)

End PPM76056_2
____________________________________________________________________________________________________________

ELSE

*UPDATE RECORD IN ZCMTSD_NFAJT_HD TABLE FOR THE OPEN PERIOD*

ZCMTSD_NFAJT_HD-UPD_USER = SY-USER
ZCMTSD_NFAJT_HD-UPDC_DATE = SY-DATUM
ZCMTSD_NFAJT_HD-UPD_TIME = SY-USEIT

*ADD RECORDS NOT PRESENT IN THE PREVIOUS EXECUTION IN ZCMTSD_NFAJT_DOC_MAT TABLE*

ZCMTSD_NFAJT_DOC_MAT -MONTH = WMARV-LFMON


ZCMTSD_NFAJT_DOC_MAT -YEAR = WMARV- LFGJA
ZCMTSD_NFAJT_DOC_MAT -PLANT_GROUP = NFAJT_PLANT_GRP-HIGH
ZCMTSD_NFAJT_DOC_MAT -MBLNR = GOODSMVT_ITEMS-MAT_DOC
ZCMTSD_NFAJT_DOC_MAT -DOC_YEAR = GOODSMVT_ITEMS-DOC_YEAR
ZCMTSD_NFAJT_DOC_MAT -MATDOC_ITM = GOODSMVT_ITEMS-MATDOC_ITM
ZCMTSD_NFAJT_DOC_MAT -MATERIAL = GOODSMVT_ITEMS-MATERIAL
ZCMTSD_NFAJT_DOC_MAT -PLANT = GOODSMVT_ITEMS-PLANT
ZCMTSD_NFAJT_DOC_MAT -STGE_LOC = GOODSMVT_ITEMS-STGE_LOC
ZCMTSD_NFAJT_DOC_MAT -BATCH = GOODSMVT_ITEMS-BATCH
ZCMTSD_NFAJT_DOC_MAT -MOVE_TYPE = GOODSMVT_ITEMS-MOVE_TYPE
ZCMTSD_NFAJT_DOC_MAT -VAL_TYPE = GOODSMVT_ITEMS-VAL_TYPE
ZCMTSD_NFAJT_DOC_MAT -ENTRY_QNT = GOODSMVT_ITEMS-ENTRY_QNT
ZCMTSD_NFAJT_DOC_MAT -ENTRY_UOM = GOODSMVT_ITEMS-ENTRY_UOM
ZCMTSD_NFAJT_DOC_MAT -PROCESSED = “N”
ZCMTSD_NFAJT_DOC_MAT -AMOUNT = MSEG-DMBTR

___________________________________________________________________________________________________________

18
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 19 (53)

Start PPM77056,2

IF
The NCM Group option is selected

ZCMTSD_NFAJT_DOC_MAT-STEUC = MARC-STEUC
ENDIF

*CREATE RECORD IN ZCMTSD_NFAJT_DOC_MAT TABLE FOR THE FOR THE OPEN PERIOD WITHOUT MOVEMENTS*

ZCMTSD_NFAJT_DOC_MAT -MONTH = WMARV-LFMON


ZCMTSD_NFAJT_DOC_MAT -YEAR = WMARV- LFGJA
ZCMTSD_NFAJT_DOC_MAT -PLANT_GROUP = NFAJT_PLANT_GRP-HIGH
ZCMTSD_NFAJT_DOC_MAT -MATERIAL = MBEWH-MATNR
ZCMTSD_NFAJT_DOC_MAT -PLANT = MBEWH-PLANT
ZCMTSD_NFAJT_DOC_MAT -VAL_TYPE = MBEWH-BWTAR
ZCMTSD_NFAJT_DOC_MAT -ENTRY_QNT = MBEWH-LBKUM
ZCMTSD_NFAJT_DOC_MAT -ENTRY_UOM = MARA-MEINS
ZCMTSD_NFAJT_DOC_MAT -PROCESSED = “N”
ZCMTSD_NFAJT_DOC_MAT -AMOUNT = (MBEWH-VERPR / MBEWH-PEINH)

End PPM76056_2
____________________________________________________________________________________________________________

*CREATE RECORD IN ZCMTSD_NFAJT_DOC_MAT TABLE FOR THE PREVIOUS PERIOD (IF WMARV-XRUEM =
“X”)*

ZCMTSD_NFAJT_DOC_MAT -MONTH = WMARV-VMMON


ZCMTSD_NFAJT_DOC_MAT -YEAR = WMARV- VMGJA
ZCMTSD_NFAJT_DOC_MAT -PLANT_GROUP = NFAJT_PLANT_GRP-HIGH
ZCMTSD_NFAJT_DOC_MAT -MBLNR = GOODSMVT_ITEMS-MAT_DOC
ZCMTSD_NFAJT_DOC_MAT -DOC_YEAR = GOODSMVT_ITEMS-DOC_YEAR
ZCMTSD_NFAJT_DOC_MAT -MATDOC_ITM = GOODSMVT_ITEMS-MATDOC_ITM
ZCMTSD_NFAJT_DOC_MAT -MATERIAL = GOODSMVT_ITEMS-MATERIAL
ZCMTSD_NFAJT_DOC_MAT -PLANT = GOODSMVT_ITEMS-PLANT
ZCMTSD_NFAJT_DOC_MAT -STGE_LOC = GOODSMVT_ITEMS-STGE_LOC
ZCMTSD_NFAJT_DOC_MAT -BATCH = GOODSMVT_ITEMS-BATCH
ZCMTSD_NFAJT_DOC_MAT -MOVE_TYPE = GOODSMVT_ITEMS-MOVE_TYPE
ZCMTSD_NFAJT_DOC_MAT -VAL_TYPE = GOODSMVT_ITEMS-VAL_TYPE
ZCMTSD_NFAJT_DOC_MAT -ENTRY_QNT = GOODSMVT_ITEMS-ENTRY_QNT
ZCMTSD_NFAJT_DOC_MAT -ENTRY_UOM = GOODSMVT_ITEMS-ENTRY_UOM
ZCMTSD_NFAJT_DOC_MAT -PROCESSED = “N”
ZCMTSD_NFAJT_DOC_MAT -AMOUNT = MSEG-DMBTR

IF
The NCM Group option is selected

ZCMTSD_NFAJT_DOC_MAT-STEUC = MARC-STEUC
ENDIF

*CREATE RECORD IN ZCMTSD_NFAJT_DOC_MAT TABLE FOR THE FOR THE OPEN PERIOD WITHOUT MOVEMENTS*

ZCMTSD_NFAJT_DOC_MAT -MONTH = WMARV-LFMON


ZCMTSD_NFAJT_DOC_MAT -YEAR = WMARV- LFGJA
ZCMTSD_NFAJT_DOC_MAT -PLANT_GROUP = NFAJT_PLANT_GRP-HIGH
ZCMTSD_NFAJT_DOC_MAT -MATERIAL = MBEWH-MATNR
ZCMTSD_NFAJT_DOC_MAT -PLANT = MBEWH-PLANT

19
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 20 (53)

ZCMTSD_NFAJT_DOC_MAT -VAL_TYPE = MBEWH-BWTAR


ZCMTSD_NFAJT_DOC_MAT -ENTRY_QNT = MBEWH-LBKUM
ZCMTSD_NFAJT_DOC_MAT -ENTRY_UOM = MARA-MEINS
ZCMTSD_NFAJT_DOC_MAT -PROCESSED = “N”
ZCMTSD_NFAJT_DOC_MAT -AMOUNT = (MBEWH-VERPR / MBEWH-PEINH)

End PPM76056_2

*GROUP RECORDS WITH SAME MATERIAL / PLANT / VALUATION TYPE *

Group records with same:


 GOODSMVT_ITEMS-MATERIAL
 GOODSMVT_ITEMS-PLANT
 GOODSMVT_ITEMS-VALUATION_TYPE

________________________________________________________________________________________
Start PPM77056,2

IF
The NCM Group option is selected

MARC-STEUC
ENDIF

End PPM76056_2
________________________________________________________________________________________

*SUM THE QUANTITY AND AMOUNT IN LOCAL CURRENCY (ADJUSTMENTS)*

It’s necessary to get the sum for all the combination obtained in the previous step

ADJUSTED QUANTITY

Sum GOODSMVT_ITEMS-ENTRY_QNT where MSEG-SHKZG is EQUAL to “S” (Z01 and Z03) and Subtract
GOODSMVT_ITEMS-ENTRY_QNT where MSEG-SHKZG is EQUAL to “H” (Z02 and Z04)

ADJUSTED AMOUNT IN LOCAL CURRENCY

Sum MSEG-DMBTR where MSEG-SHKZG is EQUAL to “S” (Z01 and Z03) and Subtract GOODSMVT_ITEMS-
ENTRY_QNT where MSEG-SHKZG is EQUAL to “H” (Z02 and Z04)

*CHECK IF TOPOGRAPHIC MEASUREMENT IS ALREADY DEFINED FOR THE PLANTS*

Use Plant as key in ZOVTPP_VIRT_PLNT-VIRTUALPLANT and retrieve the correspondent Physical Plant in
ZOVTPP_VIRT_PLN-PHYSICALPLANT

Use the retrieved PHYSICALPLANT in Table ZCMTSD_NFAJT_AJT_TOPOG-WERKS, in case of the data is already
done, it’s necessary to select the historical movements in the period defined in the table.

20
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 21 (53)

IF NO RECORD IS SELECTED STOP the JOB processing and save the correspondent cause in the JOB LOG (SPOOL)

ELSE CONTINUE

------------------------------------------------------------------------------------------------------------------------------------------------

*SELECT RELEVANT BATCHES CREATED IN THE TOPOGRAPHIC MEASUREMENT PERIOD*

Select MCHB-CHARG using:

 ZCMTSD_NFAJT_DOC_MAT -MATERIAL in MCHB-MATNR


 ZCMTSD_NFAJT_DOC_MAT -PLANT in MCHB-WERKS
 ZCMTSD_NFAJT_AJT_TOPOG -INITIAL_DATE and ZCMTSD_NFAJT_AJT_TOPOG -FINAL_DATE in MCHB-ERSDA

21
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 22 (53)

* SELECT RELEVANT BATCHES MODIFIED IN THE TOPOGRAPHIC MEASUREMENT PERIOD*

Select MCHB-CHARG using:

 ZCMTSD_NFAJT_DOC_MAT -MATERIAL in MCHB-MATNR


 ZCMTSD_NFAJT_DOC_MAT -PLANT in MCHB-WERKS
 ZCMTSD_NFAJT_AJT_TOPOG -INITIAL_DATE and ZCMTSD_NFAJT_AJT_TOPOG -FINAL_DATE in MCHB- LAEDA

*SELECT THE MOVEMENTS WITHIN THE DATES OF TOPOGRAPHIC MEASUREMENT *

MATERIAL_RA MCHB-MATNR (FROM TOPOGRAPHIC MEASUREMENT)


PLANT_RA MCHB-WERKS (FROM TOPOGRAPHIC MEASUREMENT)
BATCH_RA MCHB-CHARG (FROM TOPOGRAPHIC MEASUREMENT)
MOVE_TYPE_RA Use PLANT TYPE as key in CM.PPM77056_0005-LOW and retrieve
the Movement Types from the CM.PPM77056_0005- HIGH
PSTNG_DATE_RA ZCMTSD_NFAJT_AJT_TOPOG-INITIAL_DATE and ZCMTSD_NFAJT_AJT_TOPOG
-FINAL_DATE

22
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 23 (53)

IF NO RECORD IS SELECTED STOP the JOB processing and save the correspondent cause in the JOB LOG (SPOOL)

ELSE CONTINUE

------------------------------------------------------------------------------------------------------------------------------------------------

*FILTER MOVEMENT TYPE SPECIFIC BY PLANT *

Using the retrieved the records from GOODSMVT_ITEMS-PLANT check if there is some specific selection for this Plant:

Use PLANT as key in CM.PPM77056_0006-LOW and retrieve the Movement Types from the
CM.PPM77056_0006- HIGH, delete all the records different from this parameter .

Start PPM77056,2

Use the GOODSMVT_ITEMS-MATERIAL and GOODSMVT_ITEMS-PLANT fields to access the MARC table and
search the NCM field (MARC-STEUC)

End PPM76056_2
_________________________________________________________________________________________

*GROUP RECORDS WITH SAME MATERIAL / PLANT / VALUATION TYPE *

Group records with same:


 GOODSMVT_ITEMS-MATERIAL
 GOODSMVT_ITEMS-PLANT
 GOODSMVT_ITEMS-VALUATION_TYPE

Start PPM77056,2

IF
The NCM Group option is selected

MARC-STEUC
ENDIF

End PPM76056_2
________________________________________________________________________________________

*SUM THE QUANTITY AND AMOUNT IN LOCAL CURRENCY (MATERIAL MOVEMENTS)*

It’s necessary to get the sum for all the combination obtained in the previous step

TOTAL QUANTITY
Sum GOODSMVT_ITEMS-ENTRY_QNT where MSEG-SHKZG is EQUAL to “S” (Z01 and Z03) and Subtract
GOODSMVT_ITEMS-ENTRY_QNT where MSEG-SHKZG is EQUAL to “H” (Z02 and Z04)

TOTAL AMOUNT IN LOCAL CURRENCY

23
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 24 (53)

Sum MSEG-DMBTR where MSEG-SHKZG is EQUAL to “S” (Z01 and Z03) and Subtract GOODSMVT_ITEMS-
ENTRY_QNT where MSEG-SHKZG is EQUAL to “H” (Z02 and Z04)

*DETERMINE PERCENTAGE FOR ADJUSTED QUANTITY *

The summarized adjustments need to be divided by the total quantity to determine the percentage

% QUANTITY ADJUSTMENTS = (ADJUSTED QUANTITY / TOTAL QUANTITY) * 100.

*DETERMINE PERCENTAGE FOR ADJUSTED AMOUNT *

The summarized adjustments need to be divided by the total amount to determine the percentage

% AMOUNT ADJUSTMENTS = (ADJUSTED AMOUNT IN LOCAL CURRENCY / TOTAL AMOUNT IN LOCAL


CURRENCY) * 100.

*CHECK DEVIATION (LOWER LIMIT)*

LOSSES = % QUANTITY ADJUSTMENTS - NFAJT_MAT_SPLIT_TPMOV_%VAR-% OF LOSSES

IF % QUANTITY ADJUSTMENTS <= NFAJT_MAT_SPLIT_TPMOV_%VAR-% OF LOSSES

OVER_LOSSES_MIN_PERC = “”
OVER_LOSSES_MIN_CURR = “”

ELSE

OVER_LOSSES_MIN_PERC = LOSSES
OVER_LOSSES_MIN_CURR = LOSSES * ADJUSTED AMOUNT IN LOCAL CURRENCY

*CHECK DEVIATION (UPPER LIMIT)*

GAINS = % QUANTITY ADJUSTMENTS - NFAJT_MAT_SPLIT_TPMOV_%VAR-% OF GAINS

IF % QUANTITY ADJUSTMENTS <= NFAJT_MAT_SPLIT_TPMOV_%VAR-% OF GAINS

OVER_GAINS_MAX_PERC = “”
OVER_GAINS_MAX_CURR = “”

ELSE

OVER_GAINS_MAX_PERC = GAINS
OVER_GAINS_MAX_CURR = GAINS * ADJUSTED AMOUNT IN LOCAL CURRENCY

*CHECK TRANSFER ORIGIN*

Select ZCMTSD_CONTROLNF

24
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 25 (53)

ZCMTSD_CONTROLNF-MATNR = GROUPED GOODSMVT_ITEMS-MATERIAL


ZCMTSD_CONTROLNF-WERKS_DEST = GROUPED GOODSMVT_ITEMS-PLANT
ZCMTSD_CONTROLNF-VALUATION = GROUPED GOODSMVT_ITEMS-VALUATION_TYPE
ZCMTSD_CONTROLNF-TYPE = TBD

Retrieve ZCMTSD_CONTROLNF-WERKS_SUP for the most recent date in ZCMTSD_CONTROLNF-DATE_NF.

IF PROCESS_TYPE = INITIAL

*CREATE RECORD IN ZCMTSD_NFAJT_MONT_CONS TABLE FOR THE OPEN PERIOD*

ZCMTSD_NFAJT_MONT_CONS-MONTH = WMARV-LFMON
ZCMTSD_NFAJT_MONT_CONS-YEAR = WMARV- LFGJA
ZCMTSD_NFAJT_MONT_CONS-PLANT_GROUP = NFAJT_PLANT_GRP-HIGH
ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT = GROUPED GOODSMVT_ITEMS-PLANT
ZCMTSD_NFAJT_MONT_CONS-ORIGIN_PLANT = ZCMTSD_CONTROLNF-WERKS_SUP
ZCMTSD_NFAJT_MONT_CONS-MATNR = GROUPED GOODSMVT_ITEMS-MATERIAL
ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE = GROUPED GOODSMVT_ITEMS-VALUATION_TYPE
ZCMTSD_NFAJT_MONT_CONS-NF_TYPE
ZCMTSD_NFAJT_MONT_CONS-TOTAL_QUANTITY = TOTAL QUANTITY
ZCMTSD_NFAJT_MONT_CONS-TOTAL_AMOUNT = TOTAL AMOUNT IN LOCAL CURRENCY
ZCMTSD_NFAJT_MONT_CONS-OVER_LOSSES_MIN_PERC = OVER_LOSSES_MIN_PERC
ZCMTSD_NFAJT_MONT_CONS-OVER_LOSSES_MIN_CURR = OVER_LOSSES_MIN_CURR
ZCMTSD_NFAJT_MONT_CONS-OVER_GAINS_MAX_PERC = OVER_GAINS_MAX_PERC
ZCMTSD_NFAJT_MONT_CONS-OVER_GAINS_MAX_CURR = OVER_GAINS_MAX_CURR

________________________________________________________________________________________________________
Start PPM77056,2

ZCMTSD_NFAJT_MONT_CONS-ADJUST = ADJUSTED QUANTITY


ZCMTSD_NFAJT_MONT_CONS – MOVIMENT = TOTAL QUANTITY
ZCMTSD_NFAJT_MONT_CONS-VARIATION = % QUANTITY ADJUSTMENTS

IF

ZCMTSD_NFAJT_MONT_CONS-STEUC = MARC-STEUC
ENDIF

End PPM76056_2
____________________________________________________________________________________
ELSE
*DELETE PREVIOUS DATA AND CREATE RECORD IN ZCMTSD_NFAJT_MONT_CONS TABLE FOR THE
OPEN PERIOD*

ZCMTSD_NFAJT_MONT_CONS-MONTH = WMARV-LFMON
ZCMTSD_NFAJT_MONT_CONS-YEAR = WMARV- LFGJA
ZCMTSD_NFAJT_MONT_CONS-PLANT_GROUP = NFAJT_PLANT_GRP-HIGH

25
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 26 (53)

ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT = GROUPED GOODSMVT_ITEMS-PLANT


ZCMTSD_NFAJT_MONT_CONS-ORIGIN_PLANT = ZCMTSD_CONTROLNF-WERKS_SUP
ZCMTSD_NFAJT_MONT_CONS-MATNR = GROUPED GOODSMVT_ITEMS-MATERIAL
ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE = GROUPED GOODSMVT_ITEMS-VALUATION_TYPE
ZCMTSD_NFAJT_MONT_CONS-NF_TYPE
ZCMTSD_NFAJT_MONT_CONS-TOTAL_QUANTITY = TOTAL QUANTITY
ZCMTSD_NFAJT_MONT_CONS-TOTAL_AMOUNT = TOTAL AMOUNT IN LOCAL CURRENCY
ZCMTSD_NFAJT_MONT_CONS-OVER_LOSSES_MIN_PERC = OVER_LOSSES_MIN_PERC
ZCMTSD_NFAJT_MONT_CONS-OVER_LOSSES_MIN_CURR = OVER_LOSSES_MIN_CURR
ZCMTSD_NFAJT_MONT_CONS-OVER_GAINS_MAX_PERC = OVER_GAINS_MAX_PERC
ZCMTSD_NFAJT_MONT_CONS-OVER_GAINS_MAX_CURR = OVER_GAINS_MAX_CURR
__________________________________________________________________________________________________________
Start PPM77056,2

ZCMTSD_NFAJT_MONT_CONS-ADJUST = ADJUSTED QUANTITY


ZCMTSD_NFAJT_MONT_CONS – MOVIMENT = TOTAL QUANTITY
ZCMTSD_NFAJT_MONT_CONS-VARIATION = % QUANTITY ADJUSTMENTS

IF

ZCMTSD_NFAJT_MONT_CONS-STEUC = MARC-STEUC
ENDIF

End PPM76056_2
____________________________________________________________________________________________________________

Save the success execution in JOB LOG (SPOOL)

END OF EXECUTION
SAP User-Exits

3.1.2. Issue Nota fiscal

O usuário vai ter a tela abaixo com todas as consolidações feitas e a possibilidade de emitir a nota fiscal por
planta e material.

26
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 27 (53)

Start PPM77056,2

ZCMTSD_NFAJT_MONT_CONS-ADJUST = ADJUSTED QUANTITY


ZCMTSD_NFAJT_MONT_CONS – MOVIMENT = TOTAL QUANTITY
ZCMTSD_NFAJT_MONT_CONS-VARIATION = % QUANTITY ADJUSTMENTS

Include NCM as Column (ZCMTSD_NFAJT_MONT_CONS-STEUC))

End PPM76056_2
________________________________________________________________________________________

To display the data on this layout:

Select from ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT, ZCMTSD_NFAJT_MONT_CONS-ORIGIN_PLANT,


ZCMTSD_NFAJT_MONT_CONS-MATNR, ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE, ZCMTSD_NFAJT_MONT_CONS-
NF_TYPE, ZCMTSD_NFAJT_MONT_CONS-TOTAL_QUANTITY, ZCMTSD_NFAJT_MONT_CONS-TOTAL_AMOUNT,
ZCMTSD_NFAJT_MONT_CONS-OVER_LOSSES_MIN_PERC, ZCMTSD_NFAJT_MONT_CONS-OVER_LOSSES_MIN_CURR,
ZCMTSD_NFAJT_MONT_CONS-OVER_GAINS_MAX_PERC, ZCMTSD_NFAJT_MONT_CONS-OVER_GAINS_MAX_CURR from
table ZCMTSD_NFAJT_MONT_CONS,

______________________________________________________________________________________
Start PPM77056,2

Add to selection:

ZCMTSD_NFAJT_MONT_CONS-ADJUST

27
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 28 (53)

ZCMTSD_NFAJT_MONT_CONS – MOVIMENT
ZCMTSD_NFAJT_MONT_CONS-VARIATION
ZCMTSD_NFAJT_MONT_CONS-STEUC
End PPM76056_2
__________________________________________________________________________________________________________
With those vales we will paste on the columns respective:
Planta Ajuste
Planta NF
Material
Tipo Avaliação
Tipo NF
Ton. Total
Valor Total
Quantity Loss
Ton. Abaixo % Min.
Valor. Abaixo % Min
Quantity Gains
Ton Acima % Min
Valor Acima % Min.
Ajuste
Movimentação
Variação
NCM

O usuário pode selecionar a linha e então clicar no botão emitir Notas Fiscais.

With the line select then the user will click on Emitir Notas fiscais button.

If the user select the line with NF TYPe = NA, then when he click on Emitir Notas Fiscais buttons, we should
bring a message Nota fiscal not necessary (EN) / Sem necessidade de criar Nota Fiscal.

Else

If NFTYPE is M

Select single sort by DATE_NF(highest), REF_DOC_NUMB from ZCMTSD_CONTROLNF where Type= ‘D’ or ‘T’,
MATNR = ZCMTSD_NFAJT_MONT_CONS-MATNR, WERKS_DEST= ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT,
VALUATION= ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE
STEUC = ZCMTSD_NFAJT_MONT_CONS-STEUC

Select the field REF_DOC_NUMB

Select REGIO from T001W where WERKS = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT

Select RATE from J_1BTXIC1 where SHIPFROM = REGIO and SHIPTO = REGIO

BAPI_J_1B_NF_CREATEFROMDATA

Fields that should be filled manually -

Header:

28
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 29 (53)

MANDT = 500
NFTYPE = N6
DOCTYP = 1
DIRECT = 2
DOCDAT = sydatum
PSTDAT = sydatum
CREDAT = sydatum
CRETIM =time of system
CRENAM = the user that is executing the program
FORM = NF55
MODEL = 55
SERIES = 2
FATURA = X
MANUAL = X
FOLLOW = X
WAERK = BRL
BUKRS = Select BUKRS on J_1BT001WV where WERKS = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT.
BRANCH = Select J_1BBRANCH on J_1BT001WV where WERKS = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT.
PARVW = BR
PARID = 10010044
PARTYP = B
BRGEW = total of quantity for all material based on plant and valuation type EXCEEDING_QUANTITY_loss*1000
NTGEW = total of quantity for all material based on plant and valuation type EXCEEDING_QUANTITY_loss*1000
GEWEI = KG
VSTEL = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT
NFE = X
MODFRETE = 9

OBJ_PARTNER:
MANDT = 500
PARVW = WE
PARID = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT
PARTYP = C

Obj_Item:
Loop for every material on the consolidated table
MANDT = 500
ITMNUM = 000001 *add 1 every item
MATNR = ZCMTSD_NFAJT_MONT_CONS-MATNR
BWKEY = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT
BWTAR = ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE
CHARG(LOTE) = Loss’month’’year’
MATKL (GROUP) = Run FM J_1B_MATERIAL_READ; Inform : MATNR = ZCMTSD_NFAJT_MONT_CONS-MATNR,
VAL_AREA = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT ,VAL_TYPE = ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE,
I_WERKS = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT Return: MATERIAL_RECORD-MATKL
MAKTX(DESCRIÇÃO) = Run FM J_1B_MATERIAL_READ; Inform : MATNR = ZCMTSD_NFAJT_MONT_CONS-MATNR,
VAL_AREA = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT ,VAL_TYPE = ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE,
I_WERKS = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT Return: MATERIAL_RECORD-MAKTX
NBM (NCM) = Run FM J_1B_MATERIAL_READ; Inform : MATNR = ZCMTSD_NFAJT_MONT_CONS-MATNR, VAL_AREA =
ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT ,VAL_TYPE = ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE, I_WERKS =
ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT Return: NBM
MATORG(Origin) = Run FM J_1B_MATERIAL_READ; Inform: MATNR = ZCMTSD_NFAJT_MONT_CONS-MATNR, VAL_AREA
= ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT ,VAL_TYPE = ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE, I_WERKS =
ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT Return: VALUATION_RECORD-MTORG
TAXSIT = 51
TAXSI2 = 00054
OWNPRO (produção)= Run FM J_1B_MATERIAL_READ; Inform : MATNR = ZCMTSD_NFAJT_MONT_CONS-MATNR,
VAL_AREA = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT ,VAL_TYPE = ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE,
I_WERKS = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT Return: VALUATION_RECORD- OWNPR

29
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 30 (53)

MATUSE (Usage) = Run FM J_1B_MATERIAL_READ; Inform : MATNR = ZCMTSD_NFAJT_MONT_CONS-MATNR,


VAL_AREA = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT ,VAL_TYPE = ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE,
I_WERKS = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT Return: VALUATION_RECORD- MTUSE
MENGE = EXCEEDING_QUANTITY_loss
MEINS = TO
NETPR = OVER_LOSSES_MIN_CURR / EXCEEDING_QUANTITY_GAIN
NETWR = OVER_LOSSES_MIN_CURR
TAXLW1 = IC0
TAXLW2 = IP2
ITMTYP = 2
WERKS = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT
CFOP_10 = 5927/AA
TAXLW4 = C08
TAXSI4 =
TAXLW5 = P08
TAXSI5 =

OBJ_HEADER_MSG:
MAN = 500
SE = 01
LI = 01
MESSAGE = AJUSTE DE ESTOQUE EM FUNÇÃO DE PERDA

OBJ_ITEM_TAX:
Loop for every item:
MANDT = 500
ITMNUM = 000001 *adding plus 1 every item.
TAXTYP = ICM3 / IPI0
BASE = OVER_loss _MAX_CURR / (1-(Rate/100))
RATE = RATE from J_1BTXIC1
TAXVAL = BASE * (Rate/100)
EXCBAS = BASE, when TAXTYP == IPI0 (only this filled should be filled when TAXTYP is IPI0)

Else

Go on on the table ZCMTSD_CONTROLNF and check if there is balance.

Select Balance, DATE_NF and REF_DOC_NUMB from ZCMTSD_CONTROLNF where Type=Nf Type , MATNR =
ZCMTSD_NFAJT_MONT_CONS-MATNR, WERKS_SUP = ZCMTSD_NFAJT_MONT_CONS-ORIGIN_PLANT, WERKS_DEST=
ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT, VALUATION= ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE, STEUC =
ZCMTSD_NFAJT_MONT_CONS-STEUC and CANCEL<>X

If ZCMTSD_NFAJT_MON-NF TYPE is D or T and CM.PPM77056_0004 = Y

Sum all balance found group by WERKS_DEST, material and valuation

Variable = balance_control_nf

Select CLABS, CUMLM, CINSM, CEINM, CSPEM, CRETM, Batch on MCHB where the MATNR =
ZCMTSD_NFAJT_MONT_CONS-MATNR and WERKS = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT

Sum CLABS0, CUMLM, CINSM, CEINM, CSPEM ,CRETM = sum_mchb

Remove sum_mchb =0

Select BWTAR on MCHA where CHARG = Batch and MATNR = ZCMTSD_NFAJT_MONT_CONS-MATNR and WERKS =
ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT

30
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 31 (53)

Group by bwtar, MATNR, WERKS and STEUC

If the sum_mchb <= balance_control_nf

Show the message: Balance on current accounting (EN) / Saldo na tabela de conta corrente(PT).

Modify the field STATUS = F of select lines (plant, period, material, e valuation) from the table ZCMTSD_NFAJT_HD

Modify all the field PROCESSED = ‘Y’ for all records associated with the consolidated amount.

Else

Sort the field DATE_NF to highest to the smallest, and take the highest line.

Select the field REF_DOC_NUMB

Call the BAPI_J_1B_NF_GETDETAIL use the ref_doc_numb as reference

What fields should be deleted to send to the next bapi

OBJ_HEADER:

DOCDAT
PSTDAT
CREDAT
CRETIM
CRENAM

Obj_Item:

RefKey
Menge(quantity) =
NETPR
NETWR

Then with the results we will create new Nota fiscal on the BAPI:
BAPI_J_1B_NF_CREATEFROMDATA

Fields that should be filled manually -

Header:
DOCDAT = sydatum
PSTDAT = sydatum
CREDAT = sydatum
CRETIM =time of system
CRENAM = the user that is executing the program.
BRGNEW = Total of quantity for all items*1000
NTGNEW = Total of quantity for all items *1000

Obj_Item:
Loop for every material we bring form consolidated table
ITNUM= 00001 *increase for every item
MATNR =
MAKTX =
MATKL (GROUP) = Run FM J_1B_MATERIAL_READ; Inform : MATNR = ZCMTSD_NFAJT_MONT_CONS-MATNR,
VAL_AREA = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT ,VAL_TYPE = ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE,
I_WERKS = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT Return: MATERIAL_RECORD-MATKL

31
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 32 (53)

MAKTX(DESCRIÇÃO) = Run FM J_1B_MATERIAL_READ; Inform : MATNR = ZCMTSD_NFAJT_MONT_CONS-MATNR,


VAL_AREA = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT ,VAL_TYPE = ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE,
I_WERKS = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT Return: MATERIAL_RECORD-MAKTX
NBM (NCM) = Run FM J_1B_MATERIAL_READ; Inform : MATNR = ZCMTSD_NFAJT_MONT_CONS-MATNR, VAL_AREA =
ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT ,VAL_TYPE = ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE, I_WERKS =
ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT Return: NBM
MATORG(Origin) = Run FM J_1B_MATERIAL_READ; Inform: MATNR = ZCMTSD_NFAJT_MONT_CONS-MATNR, VAL_AREA
= ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT ,VAL_TYPE = ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE, I_WERKS =
ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT Return: VALUATION_RECORD-MTORG
OWNPRO (produção)= Run FM J_1B_MATERIAL_READ; Inform : MATNR = ZCMTSD_NFAJT_MONT_CONS-MATNR,
VAL_AREA = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT ,VAL_TYPE = ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE,
I_WERKS = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT Return: VALUATION_RECORD- OWNPR
MATUSE (Usage) = Run FM J_1B_MATERIAL_READ; Inform : MATNR = ZCMTSD_NFAJT_MONT_CONS-MATNR,
VAL_AREA = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT ,VAL_TYPE = ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE,
I_WERKS = ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT Return: VALUATION_RECORD- MTUSE
Menge(quantity) = EXCEEDING_QUANTITY_GAIN
NETPR (unit price) = OVER_GAINS_MAX_CURR / EXCEEDING_QUANTITY_GAIN
NETWR (total price) = OVER_GAINS_MAX_CURR

OBJ_ITEM_TAX:
Loop for item.
ITNUM= 00001 *increase for every item
Item 1 – ECXBAS (total price) = NETWR
Item 2 – OTHBAS (total price) = NETWR

Else

Select Balance, DATE_NF and REF_DOC_NUMB from ZCMTSD_CONTROLNF where Type=Nf Type , MATNR =
ZCMTSD_NFAJT_MONT_CONS-MATNR, WERKS_SUP = ZCMTSD_NFAJT_MONT_CONS-ORIGIN_PLANT, WERKS_DEST=
ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT, VALUATION= ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE, STEUC =
ZCMTSD_NFAJT_MONT_CONS-STEUC and CANCEL<>X

Sort the field DATE_NF to highest to the smallest, and take the highest line.

Select the field REF_DOC_NUMB

Same else above.

Afer creation of nota fiscal completed. We need to add the nota fiscal on control_nf table.

Using the same line that we search on control_nf to take the nota fiscal as reference.

Create one line as reference

For Screen 5 we will check the status for each data, if is consolidated, Issue NFe, and NFe authorized.

32
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 33 (53)

For this ALV we need the following fields:

Month / Mês = month Period

Year / Ano = Year Period

Plant Group / Grupo de plantas = Group Plant (table HD)

User / Usuário = User that process NFe(table HD)

Date of execution / Data da Execução = Data of creation Nfe (table HD)

Time of execution / Horário da Execução = Time of creation Nfe (table HD)

Process Status / Status Proc. = It will bring the status (Table HD)

Initial Date measu. / Data inicial Medi = It will bring the initial date of the measurement
(ZCMTSD_NF_TOPOG)
Final Date measu. / Data Final Medi = It will bring the final date of the measurement( ZCMTSD_NF_TOPOG)

Adjust Plant / Plant de Ajuste = Adjust plant (Table HD or Consolidated Table)

NF Plant / Planta NF = Nf Plant (consolidated table)

Material / Material = material (Consolidated table)

Valuation Type / Tipo de Avaliação = Valution Type (consolidated table)

NCM = NCM (consolidated table)

Nota fiscal = Nota fiscal (Table HD)

33
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 34 (53)

For the button ‘Reverse Execution / Estornar execução’ It will execute the FM
J_1BNFE_CANCEL_EVENT_SEND / or batch_input

Just can execute this BAPI if the Status is F

If Status = ‘F’ then

Call FM J_1BNFE_CANCEL_EVENT_SEND

With the parameters:

Select * from J_1BNFE_ACTIVE where DOCNUM = DOC Num (TableHD)

IV_ACCESS_KEY:
REGIO = REGIO
NFYEAR = NFYEAR
NFMONTH = NFMONTH
STCD1 = STCD1
MODEL = MODEL
SERIE = SERIE
NFNUM9 = NFNUM9
DOCNUM9 = DOCNUM9
CDV = CDV

IS_ACTTAB:
MANDT = 500
DOCNUM = DOCNUM
DOCSTA
SCSSTA
CONTING
CANCEL
CODE
REGIO
NFYEAR
NFMONTH
STCD1
MODEL
SERIE
NFNUM9
DOCNUM9
CDV
AUTHCOD

34
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 35 (53)

CREDAT
ACTION_DATE
ACTION_TIME
ACTION_USER
BUKRS
BRANCH
VSTEL
PARID

IV_EVENT_GROUP = 0001
IV_REASON = Estorno no período atual
IV_AUTHCODE = AUTHCOD (J_1BNFE_ACTIVE)

Else

Message = ‘Nota Fiscal cannot be canceled.’ / ‘Nota fiscal não pode ser cancelada’

Button ‘Origin Documents’ / ‘Documentos de Origem’ should bring the new ALV with the material documents
associated (table material documents)

Button Refresh should update the Status of the table HD. Then it will should check the status of Doc Num on
the table J_1BNFE_ACTIVE.

If the CODE = 100 then update the status to ‘F’

Else if the code = 101 or 102 then update the status to ‘E’.

If the code is 100 whe should update control_nf table.

Select NFNUM, PSTDAT from J_1BNFDOC where DOCNUM = ZCMTSD_NFAJT_HD-DOCNUM

Select MATNR, ITMNUM, CHARG, BWTAR, MENGE from J_1BNFLIN where DOCNUM = ZCMTSD_NFAJT_HD-
DOCNUM

Select * from ZCMTSD_CONTROLNF where MATNR = ZCMTSD_NFAJT_MONT_CONS-MATNR, WERKS_DEST=


ZCMTSD_NFAJT_MONT_CONS-ADJUST_PLANT, VALUATION= ZCMTSD_NFAJT_MONT_CONS-VALUATION_TYPE , STEUC =
ZCMTSD_NFAJT_MONT_CONS-STEUC and LOTNUM = J_1BNFLIN-CHARG.

Create new line based on the line found above, and change the follow fields:

REFERENCE_NF = J_1BNFDOC- NFNUM

REF_DOC_NUMB = ZCMTSD_NFAJT_HD-DOCNUM

35
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 36 (53)

ITEM_REF_DOC = J_1BNFLIN-ITMNUM (Can find many lines, because differente materials. So if we found more
than one line on J_1BNFLIN, we need to add the lines.)

MATNR = J_1BNFLIN-MATNR

QUANTITY_NF = J_1BNFLIN-MENGE

DATE_NF = J_1BNFDOC- PSTDAT

BALANCE = J_1BNFLIN-MENGE

Enhancement Main Program Includes Form Routines

3.1.3. Function Exits

Main Program Logical


Enhancement Function Module Name Includes
trigger Point

RM_COMPANYCODE_FIND

MARV_READ

LAST_DAY_OF_MONTHS

BAPI_GOODSMVT_GETITEMS

3.1.4. Field Exits

Main Function Screen Conditions


Screen
Enhancement Program Module Field Exit Id Field for
Number
Name Name Name execution

36
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 37 (53)

3.1.5. Menu Exits

Enhancement Menu/Path Function/Transaction Code

3.1.6. Screen Exits

Screen Program Name & Sub-Screen


Enhancement Main Program Name
Number Number

3.1.7. Search Help Exits

Field Field Description Import / Key Data Type Length Default


Name Export Element (CHAR, Value
Field
NUMC)
(I/E)
(Y/N)

3.1.8. Search Help assignment

Standard Search Collective Search Help Elementary Search Help


Help

3.1.9. BADI

BADI Name Methods Comments

37
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 38 (53)

3.1.10. Custom Transaction


A Transaction need to be create to be an Inventory Adjustment Cockpit.

Screen Title: Inventory Adjustment Cockpit

3.1.11. Requirement routine

Menu/Submenu

Routine number

Business logic required

3.1.12. Business Transaction event (If any…)


N/A

3.1.13. Substitution
N/A

Validation Fields required for Point of Table used Business Rules


Description validation Validation in validation

Substituted Field Derived from Field Table used in Substitution Business Rules

3.2. Improvements

3.2.1. Validation

In the Program Selection Screen validate if the plants inside S_PLANTS are valid.

3.2.2. Log

38
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 39 (53)

Assure that all changes apply in this transaction will cover English and Portugues Language

3.3. Screen Layout

JOB

Start PPM77056.2

*
Creating the Redio Button parameter for grouping by material and another for NCM grouping, the grouping
by material will be selected by defult.

End PPM76056_2
________________________________________________________________________________________

COCKPIT

39
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 40 (53)

Radio button – Atualizar datas de medição

Selecting this button the user should fill the period and if is necessary the plant.

When execute it, the cockipit go to screen 1.

If the user select the second radio button the cockpit should go to the screen 2.

Screen 1

40
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 41 (53)

The first column the system should bring the plants select on table topography and bring the
name of the plant from T001W the period that user select and if there is any date, this should
bring as well.
If exist some date from the previous period, the initial date of the currect period should be the
final date plus 1 and be filled on initial date. If does not exist, all the fields date should be blank.

Screen 2

41
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 42 (53)

This screen should bring the table of ‘consolidated amounts’, where the associated line on
ZCMTSD_NFAJT_HD has the field STATUS = ‘C’. The criteria to check the lines will be the details
from previous screen, as plant, period.

When the user select the line and click on the second button – Origin Documents(EN)/
Documento de Origem(PT), should go to screen 3.

When the user select the line plus click on the third button button – Input parameters(EN)/
Parametros de entrada(PT), should go to screen 4.

Screen 3

42
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 43 (53)

This screen will bring the documents based the line that user select on previous screen.

Screen 4

Screen5

43
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 44 (53)

44
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 45 (53)

3.3.1. Input Parameters for Selection Screen


1. Data Source Consideration

Field name / Table Field Name Comments / Calculations / Field


Description Manipulations
File Path Local file for upload

2. Data Validation

Table Field Name Validation Rule

3.4. Solution Logical Flow

3.5. Additional Considerations

3.5.1. Custom Tables

Tabela #01: Cockpit Emissão NF Ajuste – Dados de Execução


Finalidade: Armazenar os dados relevantes para cada execução da rotina de emissão de NFs para ajuste de
inventário para fins de auditoria posterior.
Retenção de Dados: 5 anos.

45
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 46 (53)

Volume de Registros/Mês: ~15 registros

ZCMTSD_NFAJT_HD

KEY Nome Campo Tipo Mandatório Descrição

MONTH Y Mês Período CHAR(4) S Mês do Período contábil


Contábil referente à execução.

YEAR Y Ano Período CHAR(2) S Ano do Período contábil


Contábil referente à execução.

PLANT Y Plant CHAR (4) S Centro

PLANT_GROUP N Grupo Plantas CHAR(40) S Agrupamento de plantas que


define a granularidade da
execução (Ex.: Usinas e
Entrepostos Mfe Sistema Sul)

PRC_USER N Usuário CHAR(12) S Usuário responsável pela


Execução última atualização

PRC_DATE N Data Execução DATS(8) S Data da última execução

PRC_TIME N Hora Execução TIMS(6) S Hora da última execução.

STATUS N Status CHAR(1) S Indica o status de


Processamento processamento.
C=consolidado
I=iniciado
F=finalizado
E=estornado

REV_USER N Usuário Estorno CHAR(12) N Usuário que estornou a


execução

REV_DATE N Data Estorno DATS(8) N Data em que a execução foi


estornada

REV_TIME N Hora Estorno TIMS(6) N Hora em que a execução foi


estornada

46
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 47 (53)

Tabela #02: Cockpit Emissão NF Ajuste – Períodos de Medição de Estoque


Finalidade: Armazenar as datas de início e fim de vigência de uma determinada medição de estoque para fins
de cálculo dos movimentos do período.
Retenção de Dados: 5 anos.
Volume de Registros/Mês: ~125 registros

NFAJT_AJT_TOP

Nome Campo Tipo Mandatório Descrição

Mês Período CHAR(4) S Mês do Período contábil referente à execução.


Contábil

Ano Período CHAR(2) S Ano do Período contábil referente à execução.


Contábil

Grupo Plantas CHAR(40) S Agrupamento de plantas que define a granularidade da


execução (Ex.: Usinas e Entrepostos Mfe Sistema Sul)

Planta CHAR(4) S Código da planta referente à medição

Data Inicio DATS(8) S Data de início da medição, referente à última medição


realizada para a planta.

Data Fim DATS(8) S Data de fim da medição, refere-se à data de corte da


medição do período contábil avaliado.

Tabela #03: Cockpit Emissão NF Ajuste – Parâmetros de Entrada


Finalidade: Armazenar os parâmetros de entrada utilizados para uma determinada execução do programa.
Retenção de Dados: 5 anos.
Volume de Registros/Mês: ~300 registros

NFAJT_PAR_ENT

Nome Campo Tipo Mandatório Descrição

Mês Período CHAR(4) S Mês do Período contábil referente à execução.


Contábil

Ano Período CHAR(2) S Ano do Período contábil referente à execução.


Contábil

Grupo Plantas CHAR(40) S Agrupamento de plantas que define a granularidade da


execução (Ex.: Usinas e Entrepostos Mfe Sistema Sul)

Variável CHAR(30) S Nome da variável de entrada

Valor Seleção De CHAR(45) S Valor de seleção de

Valor Seleção Ate CHAR(45) N Valor de seleção Até

47
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 48 (53)

Tabela #04: Cockpit Emissão NF Ajuste – Montantes Consolidados


Finalidade: Armazenar os montantes consolidados que deram origem a uma determinada execução do
programa.
Retenção de Dados: 5 anos.
Volume de Registros/Mês: ~300 registros

ZCMTSD_NFAJT_MONT_CONS

Nome Técnico Nome Tipo Mandatório Descrição


Campo

MONTH Mês Período CHAR(4) S Mês do Período contábil referente à


Contábil execução.

YEAR Ano Período CHAR(2) S Ano do Período contábil referente à


Contábil execução.

PLANT_GROUP Grupo CHAR(40) S Agrupamento de plantas que define


Plantas a granularidade da execução (Ex.:
Usinas e Entrepostos Mfe Sistema
Sul)

ADJUST_PLANT Planta CHAR(4) S Refere-se à planta onde foram


Ajuste lançados os movimentos de ajuste
identificados.

ORIGIN_PLANT Planta NF CHAR(4) S Trata-se da planta que será


referenciada na nota fiscal (ex.:
Planta de origem da remessa
complementar).

MATNR Material CHAR(18) S Número do material SAP.

VALUATION_TYPE Tipo CHAR(10) S Tipo de Avaliação do material no


Avaliação SAP.

NF_TYPE Tipo NF CHAR(25) S Tipo de nota fiscal que será emitido


(Complemento de Remessa;
Complemento de transferência,
Perda de Material ou Sem Emissão
Automatizada).

TOTAL_QUANTITY Ton. Total QUAN(13) S Volume total identificado no


período.

TOTAL_CURRENCY Valor Total CURR(13) S Valor Financeiro total contabilizado


no período.

OVER_LOSSES_MIN_PERC Ton. Acima QUAN(13) S Volume total na unidade de medida


% Min do material que excedeu o %
mínimo de variação parametrizado
para emissão de nota fiscal
(conforme detalhado na sessão
2.1.4).

OVER_LOSSES_MIN_CURR Valor Acima CURR(13) S Valor financeiro referente à parcela

48
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 49 (53)

% Min que excedeu o % mínimo de


variação para emissão de nota fiscal

OVER_GAINS_MAX_PERC Ton. Acima QUAN(13) S Volume total na unidade de medida


% Min do material que excedeu o %
mínimo de variação parametrizado
para emissão de nota fiscal
(conforme detalhado na sessão
2.1.4).

OVER_GAINS_MAX_CURR Valor Acima CURR(13) S Valor financeiro referente à parcela


% Min que excedeu o % mínimo de
variação para emissão de nota fiscal

,STEUC NCM N NCM do material

Tabela #05: Cockpit Emissão NF Ajuste – Documentos de Origem


Finalidade: Armazenar os documentos de material que originaram os montantes consolidados para uma
determinada execução do programa, com o status de processamento dos mesmos, de forma a evitar que um
mesmo movimento de ajuste tenha mais de uma emissão de Nota fiscal.
Retenção de Dados: 5 anos.
Volume de Registros/Mês: ~15 mil registros
ZCMTSD_NFAJT_DOC_MAT

Nome Campo Tipo Mandatório Descrição

Mês Período CHAR(4) S Mês do Período contábil referente à execução.


Contábil

Ano Período CHAR(2) S Ano do Período contábil referente à execução.


Contábil

Grupo Plantas CHAR(40) S Agrupamento de plantas que define a granularidade da


execução (Ex.: Usinas e Entrepostos Mfe Sistema Sul)

Número do CHAR(10) S Número do documento de material de origem


Documento

Processado CHAR(1) S Indica se o documento de material foi processado com


sucesso (Valores Possíveis: Y/N).

STEUC N NCM do material

Tabela #06: Cockpit Emissão NF Ajuste – Documentos Gerados


Finalidade: Armazenar os Documentos Fiscais gerados no processamento de uma determinada execução do
programa.
Retenção de Dados: 5 anos.
Volume de Registros/Mês: ~100 registros

NFAJT_NF_CRTD

Nome Campo Tipo Mandatório Descrição

Mês Período CHAR(4) S Mês do Período contábil referente à execução.

49
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 50 (53)

Contábil

Ano Período CHAR(2) S Ano do Período contábil referente à execução.


Contábil

Grupo Plantas CHAR(40) S Agrupamento de plantas que define a granularidade da


execução (Ex.: Usinas e Entrepostos Mfe Sistema Sul)

Categoria NF CHAR(2) S Categoria de nota fiscal gerada

Tipo de CHAR(1) S Tipo de Documento


Documento

Número do NUMC(10) S Número interno SAP para a Nota Fiscal Gerada


Documento

Tabela #07: Movimentos de Produção – Bloco K


Finalidade: Armazenar para fins de report no SPED fiscal (Bloco K) os volumes de produção das plantas de
origem proveniente de ajustes de inventário positivos consolidados no período.
Retenção de Dados: 5 anos.
Volume de Registros/Mês: ~400 registros

NFAJT_CNF_PRD

Nome Campo Tipo Mandatório Descrição

Mês Período Contábil CHAR(4) S Mês do Período contábil referente à execução.

Ano Período Contábil CHAR(2) S Ano do Período contábil referente à execução.

Grupo Plantas CHAR(40) S Agrupamento de plantas que define a granularidade da


execução (Ex.: Usinas e Entrepostos Mfe Sistema Sul)

Data Registro DATS(8) S Data em que o registro foi gravado na tabela

Hora Registro TIMS(6) S Hora em que o registro foi gravado na tabela

Usuário CHAR(12) S Usuário que disparou a execução

Data Lançamento DATS(8) S Data referente ao último dia do exercício contábil


referente à execução.

Tipo Movimento CHAR(3) S Tipo de Movimento referente à produção (101-Apt.


Positivo / 102-Estorno)

Material CHAR(18) S Código do material

Centro CHAR(4) S Centro em que está registrado o movimento de


produção

Cód.débito/crédito CHAR(1) S Mostra em que coluna da conta (D = Débito, C =


Crédito) é executada a atualização da movimentação
no período.

Moeda CUKY(5) S Chave da moeda na qual os montantes são


administrados no sistema.

Montante em MI CURR(13) S Montante do item de documento na moeda interna da

50
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 51 (53)

empresa.

Tipo de avaliação CHAR(10) S Tipo de Avaliação do material

Quantidade QUAN(13) S Quantidade movimentada

Unid.medida básica UNIT(3) S Unidade de medida básica do material

Área contab. custos CHAR(4) S Área de contabilidade de custos relevante para o


movimento

Exercício NUMC(4) S Exercício contábil referente ao movimento

Empresa CHAR(4) S Chave que identifica a empresa referente ao


movimento

Table Name
Short text
Size category
Table maintenance allowed
Data class
Buffering
Table maintenance

generation
Authorization Group
Field Name Data Element Domain Type Length Check Key Field Foreign Description

Table- Key

Field

Comments

4. Test Requirements

51
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 52 (53)

# Unit Tests Tests Data Expected Results


1 Run program to identify the relevant Inventory Adjustments inside the
Inventory Adjustments. Open Period need to be identified
Back posting not allowed and
Topographical Adjustments dates not
inputted in the System
2 Run program to identify the relevant Inventory Adjustments inside the
Inventory Adjustments. Open Period and in the previous
Back posting allowed and period need to be identified.
Topographical Adjustments dates not
inputted in the System
3 Run program to identify the relevant Inventory Adjustments inside the
Inventory Adjustments. Open Period need to be identified.
Back posting not allowed and
Topographical Adjustments dates Material Documents inside the Open
inputted in the System Period need to be identified.
4 Run program to identify the relevant Inventory Adjustments inside the
Inventory Adjustments. Open Period and in the previous
Back posting allowed and period need to be identified.
Topographical Adjustments dates
inputted in the System Material Documents inside the Open
Period and in the previous period
need to be identified.
5
6

Normal Functionality - test cases that ensure the report functions as it should.

ID Description

Exception - special logic or exceptions (e.g. report shold exclude certain specific condition)

Error Handling - functionality in case of errors (e.g. Error Message or Error Log )

52
V2012-08-10
Document type
AP355 – Functional Design Extension
PPM #77056 – Issue NF regarding Inventory Version Page
Adjustments for Finished Products 5.0 53 (53)

5. Reference Documents
Refer to the following for an output samples for Window mapping, Label Description and Field mapping.

6. Questions and Problems

Issue Issue Date Issue Description Issue Resolution Resolved


# Raised By & Date
owner

List of Questions and Problems


Description Responsible Resolution Date

7. Translation Table

Reference Description of use (in Description of use Description of use Text Notes
Language1) (in Language2) (in Language3) module
Name

53
V2012-08-10

You might also like