2016 May 25 10:45 AM
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.
2016 May 25 10:47 AM
2016 May 25 10:54 AM
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.
2016 May 25 11:00 AM
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.
2016 May 25 11:05 AM
Dear Ashish,
I already have a COMMIT in the main program, from where the routine is called (with a perform of course).
2016 May 25 11:13 AM
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.
2016 May 25 12:19 PM
Could you please close the thread and mark helpful answers. Thanks.