‎2006 Nov 15 4:32 PM
Hellow I wont in field wa_itab_final-status_resom = text-004. to be a defrent text from the text in 003 but it not working all the text in the field is text-003 and in the second select I bring difrent value so the text have to to change accordingly thankes
LOOP AT itab_final INTO wa_itab_final.
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>.
MODIFY itab_final FROM wa_itab_final.
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> APPEND wa_itab_final TO itab_final.
ENDIF.
ENDLOOP.
‎2006 Nov 15 5:19 PM
I did not get your exact requirement but if below is what you want..then check the given solution.
U wish to update the itab_final-status_resom field to be text-003 or text-004 depending on the loop. In the first loop you would set it to 003 and if the employee has registered for the course it should be 004.
If that is the case change the below loop -->
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.
read table itab_final into wa_itab_final with key objid = wa_d_itab-objid.
*wa_itab_final-objid = wa_itab-objid.
wa_itab_final-firstname = wa_itab-firstname.
wa_itab_final-lastname = wa_itab-lastname.
wa_itab_final-status_resom = text-004.
*APPEND wa_itab_final TO itab_final.
MODIFY itab_final from wa_itab_final index sy-tabix.
ENDIF.
ENDLOOP.
‎2006 Nov 15 4:39 PM
Introduce a CLEAR WA_ITAB_FINAL staement between the two LOOP statements and try.
Regards,
Ravi
Note : Please mark all the helpful answers
‎2006 Nov 15 4:53 PM
helloe ravi its not working i thihnk becouse of append and modify
‎2006 Nov 15 5:03 PM
Hello,
If the WA_FINAL-SATUS_RESOM should always TEXT-004, then make the change in the first loop also..
Vasanth
‎2006 Nov 15 5:11 PM
hi vasanthits not i just wont that when the first loop is happens in wa_itab_final-status_resom = <b>text-003</b>.
and when the second loop happen wa_itab_final-status = <b>text-004</b><b></b>
‎2006 Nov 15 4:42 PM
Hello,
After APPEND Statement <b>Clear wa_itab_final</b> in both the loops.
If useful reward.
Vasanth
‎2006 Nov 15 4:52 PM
‎2006 Nov 15 5:07 PM
It is not recommended to use TEXT SYMBOLS in WHERE CLAUSES instead use variables. This may give dumps.
‎2006 Nov 15 5:19 PM
I did not get your exact requirement but if below is what you want..then check the given solution.
U wish to update the itab_final-status_resom field to be text-003 or text-004 depending on the loop. In the first loop you would set it to 003 and if the employee has registered for the course it should be 004.
If that is the case change the below loop -->
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.
read table itab_final into wa_itab_final with key objid = wa_d_itab-objid.
*wa_itab_final-objid = wa_itab-objid.
wa_itab_final-firstname = wa_itab-firstname.
wa_itab_final-lastname = wa_itab-lastname.
wa_itab_final-status_resom = text-004.
*APPEND wa_itab_final TO itab_final.
MODIFY itab_final from wa_itab_final index sy-tabix.
ENDIF.
ENDLOOP.
‎2006 Nov 15 5:22 PM
Hi Antonio,
As u r appending second time u r getting new record into table itab_final.
Please check it by changing Append with Modify.
Regards,
Sanjeev