Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Command Interface Report

Former Member
0 Likes
353

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

1 ACCEPTED SOLUTION
Read only

Lakshmant1
Active Contributor
0 Likes
316

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

1 REPLY 1
Read only

Lakshmant1
Active Contributor
0 Likes
317

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