Code: Alles auswählen.
LOOP AT lt_docref ASSIGNING <ls_docref>.
MOVE <ls_docref>-INBOUND_REF(12)
TO <ls_docref>-INBOUND_REF_K.
CLEAR: lt_beleg.
SELECT BELZEILE STGRQNT STGRAMT V_ABRMENGE N_ABRMENGE MASSBILL
FROM DBERCHZ1
INTO CORRESPONDING FIELDS OF TABLE lt_beleg
WHERE BELNR = <ls_docref>-INBOUND_REF_K.
IF sy-subrc = 0.
LOOP AT lt_beleg ASSIGNING <ls_beleg>.
CLEAR: lt_data.
<ls_beleg>-MANDT = <ls_docref>-MANDT.
<ls_beleg>-INT_INV_DOC_NO = <ls_docref>-INT_INV_DOC_NO.
<ls_beleg>-INBOUND_REF_TYPE = <ls_docref>-INBOUND_REF_TYPE.
<ls_beleg>-INBOUND_REF_NO = <ls_docref>-INBOUND_REF_NO.
<ls_beleg>-INBOUND_REF = <ls_docref>-INBOUND_REF.
<ls_beleg>-INBOUND_REF_K = <ls_docref>-INBOUND_REF_K.
<ls_beleg>-G_ABRMENGE =
<ls_beleg>-v_abrmenge + <ls_beleg>-n_abrmenge.
MOVE-CORRESPONDING <ls_beleg> TO lt_data.
SELECT NETTOBTR TWAERS INTO (lt_data-NETTOBTR, lt_data-TWAERS)
FROM DBERCHZ3
WHERE BELNR = <ls_beleg>-INBOUND_REF_K
AND BELZEILE = <ls_beleg>-BELZEILE.
ENDSELECT.
SELECT CREATED_ON CHANGED_ON
INTO (lt_data-CREATED_ON, lt_data-CHANGED_ON)
FROM TINV_INV_HEAD
WHERE INT_INV_NO = <ls_docref>-INT_INV_NO.
ENDSELECT.
* additional select because of impossible use equal statement
* between both field symbols I_FS_BELEG and I_FS_DOCREF after clear
* statement
*-----------------------------------------------------------------------
SELECT INT_INV_NO
INTO lt_data-INT_INV_NO
FROM TINV_INV_DOCREF
WHERE INT_INV_DOC_NO = <ls_docref>-INT_INV_DOC_NO.
ENDSELECT.
* end of additionsal select
*-----------------------------------------------------------------------
APPEND lt_data TO E_T_DATA.
ENDLOOP.
ENDIF.
ENDLOOP.
Code: Alles auswählen.
LOOP AT lt_docref ASSIGNING <ls_docref>.
Code: Alles auswählen.
LOOP AT lt_docref ASSIGNING <ls_docref>.
MOVE <ls_docref>-INBOUND_REF(12)
TO <ls_docref>-INBOUND_REF_K.
Code: Alles auswählen.
MOVE <ls_docref>-INBOUND_REF(12)
TO <ls_docref>-INBOUND_REF_K.
Code: Alles auswählen.
SELECT BELZEILE STGRQNT STGRAMT V_ABRMENGE N_ABRMENGE MASSBILL
FROM DBERCHZ1
FOR ALL ENTRIES IN lt_docref
INTO CORRESPONDING FIELDS OF TABLE lt_beleg
WHERE BELNR = lt_docref-INBOUND_REF_K(12).