2006 Dec 07 8:22 AM
Hallow in my table itab I have employee (sobid employee number and names ex. 80 emp) in my loop(b_itab) I get all he employee that doing the course (their sobid just 3 emp) how can I use b_itab to write to other table (d_itab) to write all the employee that dont doing the course .I need a general solution.
<b>Ex.i have a table with 80 emp and I doing a loop on this table and find 3 employee that doing course how can I do comparison in the 2 table that if the employee not in b_itab(emp doing course) write them in d_itab(oteer table).</b> .if u need more details please let me now.
regards
2006 Dec 07 8:27 AM
loop at itab1.
read table itab2 with key course = itab1-course
if sy-subrc ne 0.
move-corresponding itab2 to it_final.
append it_final
endif.
endloop.
2006 Dec 07 8:27 AM
loop at itab1.
read table itab2 with key course = itab1-course
if sy-subrc ne 0.
move-corresponding itab2 to it_final.
append it_final
endif.
endloop.
2006 Dec 07 8:28 AM
Loop at itab.
Specify the condition here if they are doing the course
if (Condition here)
append itab to b_itab.
else
append itb to d_tab.
endif.
endloop.
The other option will be:
loop at itab.
read table b_itab with key course = itab-course.
if sy-subrc NE 0.
append itab to d_itab.
endif.
endloop.
Can you try these options? If not, please give the structure of the internal table to know exactly you want to do.
Best Regards,
Vibha
*Please mark all the helpful answers
2006 Dec 07 8:30 AM
Hi Antonio ,
in the loop how do you determine if the employee is doing the course or not.
As per my understanding you must be having a condition , if the condition is true the employee is doing the course if not what you can do is append that employee to your other internal table.
Regards
Arun
2006 Dec 07 8:37 AM
Hi,
I don't know whether I understood your question correctly.Check whether this is the output you want.
Loop at itab.
if not itab-sobid is initial."Employee during course
move-corresponding itab to d_itab.
append d_itab.
else."Employee not during course
move-corresponding itab to b_itab.
append b_itab.
endif.
endloop.