‎2014 Aug 06 9:19 PM
Here the issue is,
In the below code line, it will check authority check for correct field,
but there is only 2 fields. So it will check the correct field easily.
LOOP AT i_values WHERE field <> 'ACTVT' AND von = '*'.
My issue is that, ho we check the correct record in a internal table which have 6 records in it.
and below is my code which i used for check the correct records in the internal table.
here in this code, i used a variable so it will collect the correct records but only for last records.
So If any one know how we check the correct field among all these records.
Then please let me.
And when i used exit in place of variable then it will check the condition
and cursor is jump out in a loop when the condition is true.
So the remaning records were uncheck and it will exit.
LOOP AT i_values.
IF i_values-field <> i_authobj-name+5(20) AND i_values-von = '*'.
CONTINUE.
ELSE.
* l_check = i_values-field.
EXIT.
ENDIF.
ENDLOOP.
<subject edited by moderator>
Message was edited by: Manish Kumar
‎2014 Aug 06 10:38 PM
Instead of exit, populate the correct entries in another internal table and use it after the loop.
In this new internal table you will have all the successful records. Hope this is what you are looking for..
Thanks
‎2014 Aug 06 10:42 PM
Hi,
The best way to collect the correct records is, whenever the correct records comes in the loop, append that record in another temporary table and use it.
1) Declare one more internal table i_values_temp.
2) Inside loop, for the correct record append that record in this temporary table.
LOOP AT i_values.
IF i_values-field <> i_authobj-name+5(20) AND i_values-von = '*'.
CONTINUE.
ELSE.
Append i_values to i_values_temp.
ENDIF.
ENDLOOP
3) At the end of loop, you will find all the correct records in the table i_values_temp.
And now if you want to use table i_values only with only correct records, then move all the records from i_values_temp to i_values table.
Let me know if you need more help.
Regards,
Mandeep.