You are on page 1of 1

*Na rotina inicial

*$*$ begin of 2nd part global - insert your code only below this line *
... "insert your code here
*Criao da estrutura
TYPES fs_matrnd type /BIC/ADS_MATVL00.
*Criao da tabela interna
DATA: it_matrnd type hashed table of fs_matrnd WITH UNIQUE KEY
/BIC/Z_COUNTRY /BIC/ZMATERIAL.
*$*$ begin of routine - insert your code only below this line *-*
... "insert your code here
*Efetua a deleo de registros com o pas US
*DELETE SOURCE_PACKAGE WHERE /bic/Z_COUNTRY = 'US'.
CLEAR: it_matrnd[].
IF SOURCE_PACKAGE[] is not initial.
* Select * into corresponding fields of table it_matrnd[] from
SELECT * into corresponding fields of table it_matrnd[]
from /BIC/ADS_MATVL00
FOR ALL ENTRIES IN SOURCE_PACKAGE
WHERE /BIC/Z_COUNTRY = SOURCE_PACKAGE-/BIC/Z_COUNTRY
AND /BIC/ZMATERIAL = SOURCE_PACKAGE-/BIC/ZMATERIAL.
ENDIF.
*Na transformation (colocar o cdigo)
*Arrastar os campos necessrios
DATA: ls_matrnd TYPE fs_matrnd.
READ TABLE it_matrnd INTO ls_matrnd WITH KEY
/BIC/Z_COUNTRY = SOURCE_FIELDS-/BIC/Z_COUNTRY
/BIC/ZMATERIAL = SOURCE_FIELDS-/BIC/ZMATERIAL.
IF sy-subrc EQ 0.
RESULT = ls_matrnd-/BIC/ZVRNDMATR.
ENDIF.

You might also like