Hello,
I would need your councils.
I can read a logical file on my server(logical example of name: NAMEFILE) with function FILE_GET_NAME.
But I would like to be able to read a file with a counter i.e.
the first time: to read NAMEFILE001;
the second time read NAMEFILE002;
the third time read NAMEFILER003...
How made you that?
With function FILENAME_EXIT _?
But, where do I put the variable = counter? In a table...?
Thank you in advance of your answer
Servane
Hello Servane,
What I understood from your description is that you want to call the Function FILE_GET_NAME multiple number of times. Is that correct? If yes, then look at the following code :
DATA : W_LOGICAL_FILENAME TYPE FILEINTERN, W_FILENUMBER(3) TYPE N. DO 10 TIMES. MOVE SY-INDEX TO W_FILENUMBER. CONCATENATE 'TESTFILE' W_FILENUMBER INTO W_LOGICAL_FILENAME. CALL FUNCTION 'FILE_GET_NAME' EXPORTING LOGICAL_FILENAME = W_LOGICAL_FILENAME IMPORTING FILE_NAME = FILE FILE_FORMAT = FORMAT. ENDDO.
Does that answer your question ? If yes, then please close the thread. Otherwise, get back with the problem.
Add a comment