Esto es solo para agregar la descripción de la OT.
Y finalmente agregamos este código en "Cód.fte.":
FIELD-SYMBOLS:
<fs_head> TYPE zcfcl_es_e070,
<fs_e070> TYPE e070.
DATA:
lt_e070 TYPE TABLE OF e070,
lt_e071 TYPE TABLE OF e071,
lt_e07t TYPE STANDARD TABLE OF e07t,
ls_e07t TYPE e07t,
ls_head TYPE zcfcl_es_e070.
CHECK iv_obj_name IS NOT INITIAL.
REFRESH: lt_e071[], et_detail[], lt_e070, et_head[].
SELECT * FROM e071 INTO TABLE lt_e071
WHERE obj_name EQ iv_obj_name.
IF sy-subrc EQ 0.
SELECT * FROM e071 INTO TABLE et_detail
FOR ALL ENTRIES IN lt_e071
WHERE trkorr EQ lt_e071-trkorr.
IF sy-subrc EQ 0.
SELECT * FROM e070 INTO TABLE lt_e070
FOR ALL ENTRIES IN lt_e071
WHERE trkorr EQ lt_e071-trkorr.
IF sy-subrc EQ 0.
SELECT * FROM e070 INTO CORRESPONDING FIELDS OF TABLE et_head
FOR ALL ENTRIES IN lt_e070
WHERE trkorr EQ lt_e070-strkorr.
IF sy-subrc NE 0.
UNASSIGN: <fs_e070>.
CLEAR: ls_head.
LOOP AT lt_e070 ASSIGNING <fs_e070>.
MOVE-CORRESPONDING <fs_e070> TO ls_head.
APPEND ls_head TO et_head.
CLEAR: ls_head.
ENDLOOP.
ENDIF.
SELECT * FROM e07t INTO TABLE lt_e07t
FOR ALL ENTRIES IN et_head
WHERE trkorr EQ et_head-trkorr
AND langu EQ sy-langu.
IF sy-subrc EQ 0.
UNASSIGN <fs_head>.
LOOP AT et_head ASSIGNING <fs_head>.
CLEAR: ls_e07t.
READ TABLE lt_e07t INTO ls_e07t WITH KEY trkorr = <fs_head>-trkorr.
IF sy-subrc EQ 0.
<fs_head>-as4text = ls_e07t-as4text.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
<fs_head> TYPE zcfcl_es_e070,
<fs_e070> TYPE e070.
DATA:
lt_e070 TYPE TABLE OF e070,
lt_e071 TYPE TABLE OF e071,
lt_e07t TYPE STANDARD TABLE OF e07t,
ls_e07t TYPE e07t,
ls_head TYPE zcfcl_es_e070.
CHECK iv_obj_name IS NOT INITIAL.
REFRESH: lt_e071[], et_detail[], lt_e070, et_head[].
SELECT * FROM e071 INTO TABLE lt_e071
WHERE obj_name EQ iv_obj_name.
IF sy-subrc EQ 0.
SELECT * FROM e071 INTO TABLE et_detail
FOR ALL ENTRIES IN lt_e071
WHERE trkorr EQ lt_e071-trkorr.
IF sy-subrc EQ 0.
SELECT * FROM e070 INTO TABLE lt_e070
FOR ALL ENTRIES IN lt_e071
WHERE trkorr EQ lt_e071-trkorr.
IF sy-subrc EQ 0.
SELECT * FROM e070 INTO CORRESPONDING FIELDS OF TABLE et_head
FOR ALL ENTRIES IN lt_e070
WHERE trkorr EQ lt_e070-strkorr.
IF sy-subrc NE 0.
UNASSIGN: <fs_e070>.
CLEAR: ls_head.
LOOP AT lt_e070 ASSIGNING <fs_e070>.
MOVE-CORRESPONDING <fs_e070> TO ls_head.
APPEND ls_head TO et_head.
CLEAR: ls_head.
ENDLOOP.
ENDIF.
SELECT * FROM e07t INTO TABLE lt_e07t
FOR ALL ENTRIES IN et_head
WHERE trkorr EQ et_head-trkorr
AND langu EQ sy-langu.
IF sy-subrc EQ 0.
UNASSIGN <fs_head>.
LOOP AT et_head ASSIGNING <fs_head>.
CLEAR: ls_e07t.
READ TABLE lt_e07t INTO ls_e07t WITH KEY trkorr = <fs_head>-trkorr.
IF sy-subrc EQ 0.
<fs_head>-as4text = ls_e07t-as4text.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
No hay comentarios:
Publicar un comentario