Skip to Content
author's profile photo Former Member
Former Member

Command Interface Report

Hi Experts

I have one requirement to proceed for the following below by the managment.

need to create a u201Creportu201D to be executed in batch mode which will delete Command interface records from SAP.

There are two tables from which the data needs to be deleted:

1. ZINT_DATA

2. ZINT_MSGS

ZINT_DATA contains the actual data records from Command together with information about this data, e.g. processing status, date to which the data refers etc.

ZINT_MSGS contains messages which have been generated during the SAP processing of the data records.

Criteria for selecting records to be deleted are as follows:

1. ZINT_DATA

u2022 ZINT_DATA.CREATED_ON <= (Today u2013 30 Days)

u2022 ZINT_DATA.STATUS = u2018OKu2019

2. ZINT_MSGS

u2022 ZINT_MSGS.CREATED_ON <= (Today u2013 30 Days)

The report should log the number of records deleted from each table at End Of Run.

I would be thankful if anyone comment on how to create this report.

Regards

Piroz

Edited by: Piroz Eslam on Sep 19, 2008 8:36 AM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2008 at 06:18 AM

    Hi Piroz,

    Try this code,

    TABLES: zint_data,

    zint_msgs.

    DATA: it_zint_data TYPE TABLE OF zint_data ,

    it_zint_msgs TYPE TABLE OF zint_msgs.

    DATA: v_date TYPE sy-datum,

    v_lines type sy-index.

    START-OF-SELECTION.

    v_date = sy-datum - 30.

    SELECT * FROM zint_data INTO TABLE it_zint_data WHERE CREATED_ON <= v_date and status = 'OK'.

    if not it_zint_data[] is initial.

    clear v_lines.

    describe table it_zint_data lines v_lines.

    delete zint_data from table it_zint_data.

    write:/ 'No of entries deleted from table ZINT_DATA :' , v_lines.

    endif.

    SELECT * FROM zint_msgs INTO TABLE it_zint_msgs WHERE CREATED_ON <= v_date.

    if not it_zint_msgs[] is initial.

    clear v_lines.

    describe table it_zint_msgs lines v_lines.

    delete zint_msgs from table it_zint_msgs.

    write:/ 'No of entries deleted from table ZINT_MSGS :' , v_lines.

    endif.

    Hope this helps

    Thanks

    Lakshman

    Add a comment
    10|10000 characters needed characters exceeded

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.