Академический Документы
Профессиональный Документы
Культура Документы
Roadmap Reference: AP355 – Issue NF regarding Inventory Adjustments for Finished Products
Team: Plan to Deliver
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
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)
- 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)
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.
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
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 “;”
Example:
FERT ; PROPRIO ; Z01 ; 12
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 “;”
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)
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
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
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
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)
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 “;”
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)
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.
TVARVC-NAME = CM.PPM77056_0003
TVARVC-TYPE = “S”
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)
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)
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
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)
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
STOP the JOB processing sending the correspondent cause in the JOB LOG (SPOOL)
PROCESS_TYPE = REPROCESSING
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 BATCHES MODIFIED IN THE OPEN PERIOD AND PREVIOUS PERIOD (IF WMARV-XRUEM = “X”)*
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
------------------------------------------------------------------------------------------------------------------------------------------------
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”)*
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)
*SELECT THE AMOUNT IN LOCAL CURRENCY FOR THE RETRIEVED MATERIAL DOCUMENTS*
Start PPM77056,2
Selecionar o campo de Unidade de Medida Básica (MEINS) na tabela MARA para os materiais (MBEWH-
MATNR).
End PPM76056_2
____________________________________________________________________________________________________________
IF PROCESS_TYPE = INITIAL
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*
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)
_______________________________________________________________________________________
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*
End PPM76056_2
____________________________________________________________________________________________________________
ELSE
ZCMTSD_NFAJT_HD-UPD_USER = SY-USER
ZCMTSD_NFAJT_HD-UPDC_DATE = SY-DATUM
ZCMTSD_NFAJT_HD-UPD_TIME = SY-USEIT
___________________________________________________________________________________________________________
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*
End PPM76056_2
____________________________________________________________________________________________________________
*CREATE RECORD IN ZCMTSD_NFAJT_DOC_MAT TABLE FOR THE PREVIOUS PERIOD (IF WMARV-XRUEM =
“X”)*
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*
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)
End PPM76056_2
________________________________________________________________________________________
Start PPM77056,2
IF
The NCM Group option is selected
MARC-STEUC
ENDIF
End PPM76056_2
________________________________________________________________________________________
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)
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)
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
------------------------------------------------------------------------------------------------------------------------------------------------
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)
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
------------------------------------------------------------------------------------------------------------------------------------------------
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
_________________________________________________________________________________________
Start PPM77056,2
IF
The NCM Group option is selected
MARC-STEUC
ENDIF
End PPM76056_2
________________________________________________________________________________________
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)
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)
The summarized adjustments need to be divided by the total quantity to determine the percentage
The summarized adjustments need to be divided by the total amount to determine the percentage
OVER_LOSSES_MIN_PERC = “”
OVER_LOSSES_MIN_CURR = “”
ELSE
OVER_LOSSES_MIN_PERC = LOSSES
OVER_LOSSES_MIN_CURR = LOSSES * ADJUSTED AMOUNT IN LOCAL CURRENCY
OVER_GAINS_MAX_PERC = “”
OVER_GAINS_MAX_CURR = “”
ELSE
OVER_GAINS_MAX_PERC = GAINS
OVER_GAINS_MAX_CURR = GAINS * ADJUSTED AMOUNT IN LOCAL CURRENCY
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)
IF PROCESS_TYPE = INITIAL
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
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)
IF
ZCMTSD_NFAJT_MONT_CONS-STEUC = MARC-STEUC
ENDIF
End PPM76056_2
____________________________________________________________________________________________________________
END OF EXECUTION
SAP User-Exits
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
End PPM76056_2
________________________________________________________________________________________
______________________________________________________________________________________
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 RATE from J_1BTXIC1 where SHIPFROM = REGIO and SHIPTO = REGIO
BAPI_J_1B_NF_CREATEFROMDATA
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)
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
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
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
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)
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.
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
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)
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.
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.
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)
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)
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
Call FM J_1BNFE_CANCEL_EVENT_SEND
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.
Else if the code = 101 or 102 then update the status to ‘E’.
Select MATNR, ITMNUM, CHARG, BWTAR, MENGE from J_1BNFLIN where DOCNUM = ZCMTSD_NFAJT_HD-
DOCNUM
Create new line based on the line found above, and change the follow fields:
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
BALANCE = J_1BNFLIN-MENGE
RM_COMPANYCODE_FIND
MARV_READ
LAST_DAY_OF_MONTHS
BAPI_GOODSMVT_GETITEMS
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.9. BADI
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)
Menu/Submenu
Routine number
3.1.13. Substitution
N/A
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
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)
Selecting this button the user should fill the period and if is necessary the plant.
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)
2. Data Validation
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)
ZCMTSD_NFAJT_HD
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)
NFAJT_AJT_TOP
NFAJT_PAR_ENT
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)
ZCMTSD_NFAJT_MONT_CONS
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)
NFAJT_NF_CRTD
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
NFAJT_CNF_PRD
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.
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)
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.
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