Code: Alles auswählen.
select single eqktu into pt_equipmt-eqktu from eqkt
where matnr eq pt_equipmt-matnr
and spras eq sy-langu.
Code: Alles auswählen.
loop at pt_equipmt.
select single eqktu into pt_equipmt-equipment from eqkt
where matnr eq pt_equipmt-equipment_nr
and spras eq sy-langu.
modify pt_equipment.
endloop.
Code: Alles auswählen.
LOOP AT mytab ASSIGNING <fs>.
SELECT SINGLE eqktu
INTO <fs>-eqktu
FROM EQKT
WHERE equnr = <fs>-equnr AND
spras = sy-langu. "Oder 'DE' oder 'EN' oder ...
IF sy-subrc <> 0.
SELECT eqktu
INTO <fs>-eqktu
FROM EQKT
UP TO 1 ROWS
WHERE equnr = <fs>-equnr.
ENDSELECT.
ENDIF.
ENDLOOP.
Code: Alles auswählen.
LOOP AT pt_equipmt INTO ps_equipmt.
CLEAR ls_equipment.
ls_equipment-planauftrag = p_auftrag.
ls_equipment-fertigungsauftrag = f_auftrag.
ls_equipment-material = material.
ls_equipment-werk = ps_equipmt-werk.
ls_equipment-equipment_nr = ps_equipmt-equipment_nr.
ls_equipment-equipment = ps_equipmt-equipment.
IF NOT ps_equipmt-werk IS INITIAL.
ls_equipment-verfuegbarkeit = 'X'.
ENDIF.
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
APPEND ls_equipment TO it_equipment.
ENDLOOP.
Code: Alles auswählen.
DELETE ADJACENT DUPLICATES FROM pt_equipmt.
LOOP AT pt_equipmt INTO ps_equipmt.
CLEAR ls_equipment.
ls_equipment-planauftrag = p_auftrag.
ls_equipment-fertigungsauftrag = f_auftrag.
ls_equipment-material = material.
ls_equipment-werk = ps_equipmt-werk.
ls_equipment-equipment_nr = ps_equipmt-equipment_nr.
*********************************************************************************************
select single eqktu into ls_equipment-equipment from eqkt
where matnr eq ps_equipmt-equipment_nr
and spras eq sy-langu.
*oder was auch immer du für eine Spras haben willst. :-)
*********************************************************************************************
IF NOT ps_equipmt-werk IS INITIAL.
ls_equipment-verfuegbarkeit = 'X'.
ENDIF.
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
APPEND ls_equipment TO it_equipment.
ENDLOOP.