Skip to Content

FM to count AL11 entries for a specific date

Hi Everyone,

I am suppose to automate one health check which we do on a daily basis. Description is as below:

Taking an example: i want to count the no of files which we have receive in the below path:

AL11>>SAPIO>>Conversion>> (Read count of files which we have received for yesterday)

I have tried below mentioned function module but it's not helping.

SUBST_GET_FILE_LIST

EPS_GET_DIRECTORY_LISTING

RZL_READ_DIR

Request you to please suggest in step wise as i am new to SAP.

Thank you

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 18, 2015 at 01:20 PM

    Hi Rahul.

    Is it possible to add a timestamp to the files names ? It's the best way to achieve your requirement.

    Because, many Unix systems won't save the date of the creation of the file, but the last modification date. (the folders you can see in AL11 are your server OS folders).

    You can see the attributes of your files using unix commands inside the abap code:

    You can run a unix command using:

    DATA:

    lv_command(50) TYPE c,

    lv_line(150) TYPE c,

    lt_tab LIKE TABLE OF lv_line.

    lv_command = 'ls -l'.

    CALL 'SYSTEM' ID 'COMMAND' FIELD lv_command

    ID 'TAB' FIELD lt_tab.


    lv_commands stores your command line, the lt_table, return the result of the command.

    Also refer to this link: ls command in Linux/Unix | list files/directories

    Hope this information helps you.

    But as I already said, if you can add a timestamp to your files would save you a lot of work.

    Since you can use a simple FM RZL_READ_DIR to get the files and then filter them by their name(timestamp) in your program.

    Regards,

    Thales Schmidt

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 18, 2015 at 01:36 PM

    Thank you Thames,

    However, where do i put the path from where i have to fetch the count of the files for a specific date

    And what should be the write statement.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      In unix command,

      the command would be something like this "ls -l /etc/path/" .

      Please refer to the link I posted.

      For the function module, please search on the forums. There are lots of topics relationed to this subject.

      😉

      Regards,

      Thales Schmidt

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.