行の1つのコンポーネントが空itab
であるいくつかの行を持つ内部テーブルがあります。内部テーブルの列を確認し、テーブルから取得してから、内部テーブルの列を新しい値に変更しmatnr
たいと思います。これが要約です。palet
matnr
palet
zlldet
matnr
matnr
itab
テーブル:
+-------+-------+-----------+
| palet | matnr | something |
+-------+-------+-----------+
| 1234 | null | abc |
| 1235 | null | saa |
| 1236 | null | ssd |
+-------+-------+-----------+
そこで、テーブルpalet
から列をチェックして、その行の値を見つけます。新しい値は次のようになります。zlldet
matnr
itab
+-------+--------+-----------+
| palet | matnr | something |
+-------+--------+-----------+
| 1234 | 543213 | abc |
| 1235 | 988876 | saa |
| 1236 | 344545 | ssd |
+-------+--------+-----------+
私が試したこと:
LOOP AT itab.
SELECT SINGLE matnr INTO itab-matnr
FROM zlldet WHERE palet = itab-palet.
ENDIF.
ENDLOOP.
2行目の値を変更しようとしています。私はそれが間違っていることを知っています、私はいくつかのMODIFY
ステートメントを使うべきですが、私は方法がわかりません。
編集:
完全なコードは次のとおりです。
REPORT zwps0510 MESSAGE-ID zc LINE-SIZE 255 NO STANDARD PAGE HEADING.
TABLES: zzllog, zzldet, marc, makt.
DATA: BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE zzllog.
DATA: END OF itab.
DATA: adet TYPE p.
*/ paket numaraları
SELECT-OPTIONS: spalet FOR zzllog-palet. "/paket no
SELECT-OPTIONS: spaleta FOR zzllog-paleta. "/paketnoa
SELECT-OPTIONS: spaletb FOR zzllog-paletb. "/paketnob
SELECTION-SCREEN SKIP 1.
*/ paketle ilgili bilgiler
SELECT-OPTIONS: sdispo FOR marc-dispo.
SELECT-OPTIONS: smatnr FOR zzllog-matnr.
SELECT-OPTIONS: sharkod FOR zzllog-harkod. "/logtaki işlem kodu
*SELECT-OPTIONS: stelf1 FOR zzllog-telf1.
SELECT-OPTIONS: starih FOR zzllog-tarih.
SELECT-OPTIONS: susr FOR zzllog-usr.
SELECT-OPTIONS: saufnr FOR zzllog-aufnr.
SELECTION-SCREEN SKIP 1.
*/ depo adres bilgileri
SELECT-OPTIONS: sflgnum FOR zzllog-flgnum. "/kaynak depo no
SELECT-OPTIONS: sflgtyp FOR zzllog-flgtyp. "/kaynak depo tipi
SELECT-OPTIONS: sflgpla FOR zzllog-flgpla. "/kaynak depo numarası
SELECT-OPTIONS: stlgnum FOR zzllog-tlgnum. "/hedef depo no
SELECT-OPTIONS: stlgtyp FOR zzllog-tlgtyp. "/hedef depo tipi
SELECT-OPTIONS: stlgpla FOR zzllog-tlgpla. "/hedef depo numarası
SELECTION-SCREEN SKIP 1.
*/ Çıktıda gelecek kolonların seçimi
SELECTION-SCREEN BEGIN OF BLOCK uc WITH FRAME TITLE text-001.
PARAMETERS : tarih AS CHECKBOX DEFAULT 'X',
saat AS CHECKBOX DEFAULT 'X',
usr AS CHECKBOX DEFAULT 'X',
palet AS CHECKBOX DEFAULT 'X',
paleta AS CHECKBOX DEFAULT 'X',
paletb AS CHECKBOX DEFAULT 'X',
harkod AS CHECKBOX DEFAULT 'X', "/ hareket kodu
matnr AS CHECKBOX DEFAULT 'X',
menge AS CHECKBOX DEFAULT 'X',
sebep AS CHECKBOX DEFAULT 'X', "/ sipariş/red
aufnr AS CHECKBOX DEFAULT 'X', "/sm.siparişi
ref2 AS CHECKBOX DEFAULT 'X',
paufnr AS CHECKBOX DEFAULT 'X', "/enj.siparişi
flgnum AS CHECKBOX DEFAULT 'X', "/from depo...
flgtyp AS CHECKBOX DEFAULT 'X',
flgpla AS CHECKBOX DEFAULT 'X',
tlgnum AS CHECKBOX DEFAULT 'X', "/ to depo...
tlgtyp AS CHECKBOX DEFAULT 'X',
tlgpla AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK uc.
*
TOP-OF-PAGE.
PERFORM baslik.
*
START-OF-SELECTION.
PERFORM prepare_itab.
PERFORM write_itab.
**
FORM prepare_itab.
*/ Paketle ilgili tüm geçmiş hareketler log tablosundan okunur
SELECT * INTO CORRESPONDING FIELDS OF TABLE itab
FROM zzllog WHERE palet IN spalet
AND paleta IN spaleta
AND paletb IN spaletb
AND matnr IN smatnr
AND harkod IN sharkod
AND tarih IN starih
AND flgnum IN sflgnum
AND flgtyp IN sflgtyp
AND flgpla IN sflgpla
AND tlgnum IN stlgnum
AND tlgtyp IN stlgtyp
AND tlgpla IN stlgpla
AND aufnr IN saufnr
AND usr IN susr.
IF sdispo[] IS NOT INITIAL.
LOOP AT itab.
SELECT SINGLE dispo INTO marc-dispo
FROM marc WHERE matnr = itab-matnr
AND werks = '3001'
AND dispo IN sdispo.
IF sy-subrc <> 0.
DELETE itab.
ENDIF.
ENDLOOP.
ENDIF.
DESCRIBE TABLE itab LINES adet.
*/ tüm hareketler tarih ve saate göre sıralanır
SORT itab BY tarih saat.
WRITE:/ 'ADET: ', adet.
ULINE.
ENDFORM.
だから、私がやりたいのは正確です:が含まれている場合sharkod
はD
、zzldet
をチェックする必要がありますmatnr
。