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

WRITE statement keeps outputting data from previous runs

Former Member
0 Likes
1,223

Dear developers,

can you please help me with the following hopefully very simple problem. I wrote a simple ABAP report, which uses the WRITE statement to output data. The trouble: the report seems to output not just the data from this particular run, but from all the other previous runs as well, so the list keeps growing every time I start the report. Should I have flushed the bigger somehow?

Thank you!

Alexander.

Dear developers,

can you please help me with the following hopefully very simple problem. I wrote a simple ABAP report, which uses the WRITE statement to output data. The trouble: the report seems to output not just the data from this particular run, but from all the other previous runs as well, so the list keeps growing every time I start the report. Should I have flushed the bigger somehow?

Thank you!

Alexander.

6 REPLIES 6
Read only

Ashg1402
Contributor
0 Likes
1,192

Hi,

Can you post your code.?

Read only

Former Member
0 Likes
1,192

Dear Ashish,

yes, hear is the code.

FORM change_status USING lv_objnr.

   WRITE: /'Order', lv_objnr.

   CALL FUNCTION 'STATUS_CHANGE_EXTERN'
     EXPORTING
       check_only          = p_test
       objnr               = lv_objnr
       user_status         = 'E0003'
       set_chgkz           = 'X'
     EXCEPTIONS
       object_not_found    = 1
       status_inconsistent = 2
       status_not_allowed  = 3
       OTHERS              = 4.
   IF sy-subrc = 0.
    WRITE: /'Status changed successfully.'.
   ENDIF.

ENDFORM.


This form is being called from with the main program.

Read only

0 Likes
1,192

Hi,

As it is a form , it will work only when the perform is triggered. And inside this do a commit after the FM to work.

As you are saying that its printing from past runs, then I am not sure why as I don't see any problem in here.

Put a commit statement and run again , and see what happens.

Read only

Former Member
0 Likes
1,192

Dear Ashish,

I already have a COMMIT in the main program, from where the routine is called (with a perform of course).

Read only

Former Member
0 Likes
1,192

Dear Ashish,

I found the error and it was elsewhere. I was mistaken: the routine doesn't really print data from the past runs, the errror is a different one.

Thank you anyway fro your hints!

Alexander.

Read only

0 Likes
1,192

Could you please close the thread and mark helpful answers. Thanks.