Skip to Content
0
Former Member
Nov 16, 2006 at 07:54 AM

loop append and modify problem

14 Views

HELLOW I HAVE A PROBLEM WITH MY ITS LITLE PROBLEM BUT I DON’T SCUSSES TO FIND IT I JUST WONT TO PUT IN FIELD wa_itab_final-status_resom = text-003.

IN THE FIRST LOOP AND IN THE SECOND SELECT I WONT 2 PUT TEXT 004 JUST DIFFERENT TEXT WHEN THE LOOP IS HAPPENES AND I DON’T SUCSSES I HAVE JUST TEXT-003 WHY?????

LOOP AT itab INTO wa_itab.

READ TABLE c_itab INTO wa_c_itab WITH KEY employee_num = wa_itab-objid.

IF sy-subrc = 0.

wa_itab_final-objid = wa_itab-objid.

wa_itab_final-firstname = wa_itab-firstname.

wa_itab_final-lastname = wa_itab-lastname.

MOVE wa_c_itab-begda TO wa_itab_final-begda.

MOVE wa_c_itab-endda TO wa_itab_final-endda.

MOVE wa_c_itab-priox TO wa_itab_final-priox.

MOVE wa_c_itab-istat TO wa_itab_final-istat.

SELECT SINGLE stext

FROM hrp1000

INTO wa_itab_final-stext

WHERE objid = wa_c_itab-objid.

<b>wa_itab_final-status_resom = text-003.</b>

APPEND wa_itab_final TO itab_final.

CLEAR wa_itab_final.

ENDIF.

ENDLOOP.

LOOP AT itab INTO wa_itab.

READ TABLE d_itab INTO wa_d_itab WITH KEY employee_num_reg = wa_itab-objid.

IF sy-subrc = 0.

wa_itab_final-objid = wa_itab-objid.

wa_itab_final-firstname = wa_itab-firstname.

wa_itab_final-lastname = wa_itab-lastname.

<b> wa_itab_final-status_resom = text-004.</b>

MODIFY itab_final FROM wa_itab_final INDEX sy-tabix.

CLEAR wa_itab_final.

ENDIF.

ENDLOOP.

*--


check the status of employee--


LOOP AT itab_final INTO wa_itab_final.

IF wa_itab_final-istat = 2.

wa_itab_final-employee_status = text-001.

ELSE.

wa_itab_final-employee_status = text-002.

ENDIF.

MODIFY itab_final FROM wa_itab_final.

CLEAR wa_itab_final.

ENDLOOP.

ENDFUNCTION.