Q
Problem solve Get help with specific problems with your technologies, process and projects.

How to fix two common SAP ABAP problems

ABAP problems can stop or dump in two common scenarios. This expert tip points out how to circumvent these problems.

We're encountering a frequent problem in ABAP backend dialog programs: If the Dialog- Timeout is reached, the program...

will stop/dump. Now, is there a nice way to control this? I'm currently using a Function Module which tells me the Dialog-Timeout-Time, and I create a Popup-Dialog-Interruption to allow the user to go on, but it would be better to avoid this user-interaction.

We also run into another problem pretty frequently. When all the memory resources of a program are reached, it will dump. How do we know when these resources are reached? I can't find a good solution to allow such a check inside a running ABAP program.

I don't know if there's a way to check the remaining resources. Virtually, the memory is unlimited; when it runs short of memory, this simply means that the allocated disk space is exhausted. Making them much bigger in the SAP Instance Config will cure this.

As for the timeout: I have below a small program that works as a "screensaver" that regularly refreshes the screen automatically. This will do the job for you. I hope that it is clear enough to help you understand the concept.

REPORT zz_screen_saver NO STANDARD PAGE HEADING.

This program displays a list on a screen and refreshes it once a second. The list shows the status of the dispatcher queue: The number of jobs waiting for the different services at the moment. The remote callable function module should look like this:

DATA: BEGIN OF itab OCCURS 5.

INCLUDE STRUCTURE thlines.

DATA: END OF itab.

DATA i TYPE i VALUE 99.

DATA j TYPE i VALUE 99.

* Run the async. function module the first time

START-OF-SELECTION.

SET BLANK LINES ON.

CALL FUNCTION 'SPTA_RFC_PING_AND_WAIT'

STARTING NEW TASK 'WAIT'

PERFORMING when_finished ON END OF TASK

EXPORTING

seconds = 1.

WRITE: ''.

* Run the async. function module and display the freshest data

AT USER-COMMAND.

ADD 3 TO i.

IF i > 70. i = 1. ENDIF.

ADD 1 TO j.

IF j > 6 . j = 1. ENDIF.

 

sy-lsind = 1.

FORMAT COLOR = j.

DO 40 TIMES.

WRITE (132) ' '.

ENDDO.

SKIP TO LINE 15.

ADD 1 TO j.

WRITE AT /i ' ' COLOR = j.

WRITE AT /i ' Hello I''m still running ' COLOR = j.

WRITE AT /i ' ' COLOR = j.

CALL FUNCTION 'SPTA_RFC_PING_AND_WAIT'

STARTING NEW TASK 'INFO'

PERFORMING when_finished ON END OF TASK

EXPORTING

seconds = 1.

* When the async. function module finished, this form will be called

FORM when_finished USING taskname.

RECEIVE RESULTS FROM FUNCTION 'Y_ENQUE_SLEEP'.

* Trigger an event to run the at user-command

SET USER-COMMAND 'BUMM'.

ENDFORM. "when_finished

 

This was last published in October 2008

Dig Deeper on SAP ABAP

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close