Application Development 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: 

LOAD-OF-PROGRAM IS EXECUTED AT EVERY PBO

jordi_escodaruiz
Active Participant
0 Kudos

Dear All:

I'm working with a ECC6 system, which was upgraded from a 4.6C.

Concerning to LOAD-OF-PROGRAM: When an ABAP program is loaded in an internal session, the runtime environment triggers the LOAD-OF-PROGRAM event, and the corresponding event block is executed.

This means that LOAD-OF-PROGRAM should be executed only once.

But I have different behaviour. In my system is executed at every PBO.

I have this test code:

REPORT  ztest .

PARAMETERS: p_gjahr TYPE gjahr.

LOAD-OF-PROGRAM.
  BREAK-POINT.

START-OF-SELECTION.
  WRITE:/ 'Hello'.

When I run this program, the break-point is triggered. This is correct.

After that, I press F8, to skip the break-point, and F8 to launch the report.

The system shows 'Hello'.

But when I press back, the break-point located in load-of-program is triggered again, which is incorrect.

Has someone faced the same problem?

Thanks in advance.

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

When I run this program, the break-point is triggered. This is correct.

After that, I press F8, to skip the break-point, and F8 to launch the report.

The system shows 'Hello'.

But when I press back, the break-point located in load-of-program is triggered again, which is incorrect.

No, which is not Incorrect. It is correct. Even if you try to put the INITIALIZATION event and put a break-point system will go it both the time as it went in the LOAD-OF-PROGRAM.

That means when you come back from the List to selection screen, system will load the program using the LOAD-OF-PROGRAM and that's why all your global data is being cleared everytime your run the program from the selection screen.

Regards,

Naimesh Patel

3 REPLIES 3

naimesh_patel
Active Contributor
0 Kudos

When I run this program, the break-point is triggered. This is correct.

After that, I press F8, to skip the break-point, and F8 to launch the report.

The system shows 'Hello'.

But when I press back, the break-point located in load-of-program is triggered again, which is incorrect.

No, which is not Incorrect. It is correct. Even if you try to put the INITIALIZATION event and put a break-point system will go it both the time as it went in the LOAD-OF-PROGRAM.

That means when you come back from the List to selection screen, system will load the program using the LOAD-OF-PROGRAM and that's why all your global data is being cleared everytime your run the program from the selection screen.

Regards,

Naimesh Patel

Former Member
0 Kudos

Hi

I've tired this program and it's the same behavior in both release: 4.6C and 6.00

PARAMETERS: P1 TYPE T001-BUKRS DEFAULT '1000'.

INITIALIZATION.
  BREAK-POINT.

LOAD-OF-PROGRAM.

  BREAK-POINT.

START-OF-SELECTION.

  WRITE P1.

Both events INITIALIZATION and LOAD-OF-PROGRAM are triggered again after backing from abap list: I suppose the event LOAD-OF-PROGRAM is triggered again because the report is set in an internal mode again

Max

jordi_escodaruiz
Active Participant
0 Kudos

I close the Thread.

While in modul pool LOAD-OF-PROGRAM is executed only once, when the program is loaded, in a report LOAD-OF-PROGRAM is executed at every PBO, i.e. every time the selection screen is displayed.