Skip to Content
0

Ler dados de tabela e selecionar

Jun 29, 2017 at 03:06 PM

29

avatar image

Olá boa tarde tenho um problema, eu sou novo no sap abap e estou com um exercicio, eu nao sei se sou eu que não percebo o ficheiro, gostaria que me ajuda-se.

Problema:

a.Ler a tabela ZMM_GOODSMV_TAG e seleciona as tag’s, tipo de valor e frequências a considerar.

b. Selecionar da tabela zmm_goodsmv_dcs os registos não importados para SAP (imported EQ ''), com data de produção no intervalo de datas selecionado no ecrã de seleção e tag, tipo de valor e frequência na tabela ZMM_GOODSMV_TAG (em passo 1. a.).

eu fiz assim mas não sei:

SELECT * FROM ZMM_GOODSMV_TAG
INTO CORRESPONDING FIELDS OF TABLE p_lt_goodsmv_dcs.
ENDSELECT.
LOOP AT lt_GOODSMV_TAG INTO ls_GOODSMV_TAG.

SELECT * FROM zmm_goodsmv_dcs
INTO CORRESPONDING FIELDS OF TABLE p_lt_goodsmv_dcs
WHERE imported EQ ''
AND PRDDT IN so_PRDDT
AND TAGPC = ZMM_GOODSMV_TAG-TAGPC
AND VALUE_TYPE = ZMM_GOODSMV_TAG-VALUE_TYPE
AND FREQUENCY = ZMM_GOODSMV_TAG-FREQUENCY.

ENDSELECT.

IF sy-subrc NE 0.
MESSAGE i001(zmm).
LEAVE.
ENDIF.

ENDLOOP.

TKS help

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

diego Morgado Jun 29, 2017 at 04:56 PM
0

Eu fiz assim:

FORM read_table TABLES p_lt_goodsmv_dcs STRUCTURE zmm_goodsmv_dcs.

DATA: lt_GOODSMV_TAG TYPE TABLE OF ZMM_GOODSMV_TAG, " PED000000747866- COLOMBO - INTERFACE DCS -> SAP [ROL, MA] 29-06-2017.
ls_GOODSMV_TAG TYPE ZMM_GOODSMV_TAG. "PED000000747866- COLOMBO - INTERFACE DCS -> SAP [ROL, MA] 29-06-2017.

SELECT * FROM ZMM_GOODSMV_TAG
INTO CORRESPONDING FIELDS OF TABLE lt_GOODSMV_TAG.


LOOP AT lt_GOODSMV_TAG INTO ls_GOODSMV_TAG.

SELECT * FROM zmm_goodsmv_dcs
INTO CORRESPONDING FIELDS OF TABLE p_lt_goodsmv_dcs
WHERE imported EQ ''
AND PRDDT IN so_PRDDT
AND TAGPC = ls_GOODSMV_TAG-TAGPC
AND VALUE_TYPE = ls_GOODSMV_TAG-VALUE_TYPE
AND FREQUENCY = ls_GOODSMV_TAG-FREQUENCY.


IF sy-subrc NE 0.
MESSAGE i001(zmm).
LEAVE.
ENDIF.

ENDLOOP.

ENDFORM.

Share
10 |10000 characters needed characters left characters exceeded