Hallo,
das Feld OLFMNG wird nicht auf der Datenbank gespeichert. Ich habe es programmiertechnisch gelöst, vielleicht hilft Dir das weiter.
DATA: lv_vbeln TYPE vbak-vbeln,
lv_vbelp TYPE vbap-posnr.
DATA: lt_vbap TYPE TABLE OF vbapvb,
ls_vbap TYPE vbapvb,
lt_vbup TYPE TABLE OF vbupvb,
lt_vbep TYPE TABLE OF vbepvb,
ls_vbep type vbepvb,
ls_makt type makt,
lt_vbfa TYPE TABLE OF vbfavb.
clear: gv_nachl, gt_nachl[].
lv_vbeln = IS_DLV_DELNOTE-hd_ref-order_numb.
lv_vbelp = ''.
SELECT * FROM vbap INTO TABLE lt_vbap WHERE vbeln = lv_vbeln.
SELECT * FROM vbup INTO TABLE lt_vbup WHERE vbeln = lv_vbeln.
SELECT * FROM vbfa INTO TABLE lt_vbfa WHERE vbelv = lv_vbeln
ORDER BY PRIMARY KEY.
SORT lt_vbfa BY mandt vbelv posnv vbeln posnn vbtyp_n.
SELECT * FROM vbep INTO TABLE lt_vbep WHERE vbeln = lv_vbeln.
CALL FUNCTION 'RV_SCHEDULE_CHECK_DELIVERIES'
EXPORTING
fbeleg = lv_vbeln
fposnr = lv_vbelp
TABLES
fvbfa = lt_vbfa
fvbup = lt_vbup
fxvbep = lt_vbep
fvbap = lt_vbap
EXCEPTIONS
OTHERS = 3.
loop at lt_vbep into ls_vbep.
if ls_vbep-OLFMNG > 0.
clear gs_nachl.
read table lt_vbap into ls_vbap
with key vbeln = ls_vbep-vbeln
posnr = ls_vbep-posnr.
gs_nachl-matnr = ls_vbap-matnr.
gs_nachl-menge = ls_vbep-olfmng.
gs_nachl-meins = ls_vbep-meins.
endif.
endloop.
if not gt_nachl[] is initial.
gv_nachl = 'X'.
endif.