2007 May 03 11:53 AM
Hello,
We are using program RSEOUT00 for writing IDOC to a file using function modules we have developed our self.
We have a problem with that when we run the program it often ends with a dump, SYSTEM_IMOD_TO_LARGE. We have been looking for notes in OSS, and there is a change of a parameter in the system that can be done, but it is not recomended. I have instead change the writing of the file so it is possible to run the program several times. My problem now is that I can't debug the function module we have created. I am in program LEDI7U16 and the program code looks like this:
CALL FUNCTION EDIPOF-FUNCTION
IN BACKGROUND TASK
TABLES
I_EDIDC = I_EDIDC.
I wan't to debug the EDIPOF-FUNCTION (our own function) or have program RSEOUT00 to finish when the function called is complete.
Ann-Sofie
2007 May 03 2:19 PM
In 4.6c I did this by creating a function module and a table (zsm50_debug). In the table are just two fields: User name (key), and a flag (yes/no).
That can be used to debug any background program/FM/method.
The function module:
FUNCTION zsm50_debug.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" REFERENCE(Z_DEBUG_USER) LIKE SY-UNAME
*"----------------------------------------------------------------------
DATA: z_exit,
z_debug.
CLEAR: z_debug.
DATA: starttime TYPE t,
currenttime TYPE t,
time_passed TYPE i.
starttime = sy-uzeit.
* Check if debugging is switched on
SELECT SINGLE debug FROM zsm50_debug
INTO z_debug
WHERE uname = z_debug_user.
* Debugging is switched on:
IF z_debug = 'X'.
* Not an endless loop, but it will continue after approx. 1 minute...
* Plenty of time to go to SM50 to debug the program and continue!
DO.
* Change the value of z_exit to 'X' to exit the loop an stay in
* debug mode.
IF z_exit = 'X'.
EXIT.
ENDIF.
* To prevent an endless loop (if the user forgot that debugging was
* switched on in ZSM50_DEBUG, time is measured to allow the program
* to continue after 2 minutes
GET TIME FIELD currenttime.
time_passed = currenttime - starttime.
IF time_passed > 120.
WRITE: / '!!!==========================================!!!'.
WRITE: / '!!!DEBUGGING STILL SWITCHED ON IN ZSM50_DEBUG!!!'.
WRITE: / '!!! Program was delayed by two minutes !!!'.
WRITE: / '!!!==========================================!!!'.
EXIT.
ENDIF.
ENDDO.
ENDIF.
ENDFUNCTION.This FM reads the table and checks if the flag is switched on. If so, it loops for two minutes. After that, it continues regardless. If not flagged, it continues immediately.
This way, you can debug any program that is running in the background.
In every method I program I add this FM right in the beginning. With authorization for SM50, I can then debug the program (in production it may be difficult to get the correct server, if there are more).
2007 May 04 9:21 AM
Thanks for the function module, Edwin. It works very well. I have been able to debug the background task.
Now I can see that my problem is actually in the standard program RSEOUT00. I have a problem creating a job with this program in more than one step.
First I want to run program RWDBBMAN with one selection and next step RSEOUT00 to create file from the IDocs created and then next step is RWDBBMAN with more selections and after that RSEOUT00. The problem is that RSEOUT00 is finished when it starts the function module we have created, that actually creates the file. I would like to RSEOUT00 to not finish untill the writing of the file is complete and than the next step with RWDBBMAN start.
Any good ideas?
Ann-Sofie