Can someone explain me the logic on the step 4 ( in step 3 it is mentioned as $counter < $list_size) in the SAP Note : 1825911
I tried implementing this SAP Note and seems it is not entering into While loop.
I am bit confused with this logic
Add a script in the while loop as follows. It extracts a single file each time from $file_list using simple string functions. It prints the current file in process and remaining file list at the end.
$counter = $counter + 1;
print(‘While Loop Counter = ’ || $counter ); #print(’ comma index = ’ || index($file_list , ‘,’, 1));
if($counter = $list_size)
$file_name= $file_list_temp;
else
$file_name = substr($file_list_temp , 1, index($file_list, ‘,’,1)-1);
$file_list_temp = substr($file_list_temp, index($file_list,’,’,1)+1, length($file_list_temp)-index($file_list,’,’,1));
print(‘Current file in process is ’ || $file_name);
print(’ Remaining file list is = '|| $file_list_temp);
It is a lot easier to have the wait_for_file function only return one file.
Then you just loop until the file name is null. You dont have to mess with indexes or run the risk of blowing out the file list variable. If you need the file count and a counter, you can get the count in a separate call and easily setup a counter to just read off the file number its on.
you process the file, move it, then go back to the top of the loop and select the next file.