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: 

Pbo is calling when triggering PAI

Former Member
0 Kudos

Hi All,

Will anybody let me know why the PBO is calling again when triggering the PAI.

what might be the reason, what might have done wrong by me.

please anybody le met know,

I am struggling with this problem from long ;;;

9 REPLIES 9

Former Member
0 Kudos

Hi,

Based on user inputs it will trigger the PBO.

Consider this Example.

We have two Screens.

First trigger the PBO of First Screen and get the input's from user.

Then it triggers the PAI of the First Screen. In PAI it have the Command like Call screen2.

So It again triggers the PBO of the Second Screen.

Thanks,

Reward If Helpful.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Understand that the PBO and PAI are part of the screen flow, so after round trip will do the PBO and PAI. So say you have a call screen in your program, it will fire the PBO, the screen will be displayed, and the user will do some interaction and press some FCODE, the PAI of that screen will then be fired. If the FCODE is not being handled in the PAI(or not redirecting to another screen), then the PBO of the current screen will be fired again, and the same screen displayed again, because this is all part of the "Round Trip" between the dynpro and the application. Make sense?

Regards,

Rich Heilman

0 Kudos

Hi Rich Heilman

In my case as i am handling the FCODE in PAI also,

It is again triggering the PBO of that screen.

whats happening is it is clearing the workarea which is handled in PBO.

let me know;

0 Kudos

Hi all ,

Here the sample code whereas it is clearing after every PAI.

so it is clearing the workarea before printing on the screen.

Will you pls anyone analyse and let me knw how to handle this situation.

Its urgent..

tables mara.

data: gs_makt type makt , okcode type syucomm.

data: gv_matnr type matnr, gv_makt type maktx.

start-of-selection.

end-of-selection.

call screen 100.

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


module STATUS_0100 output.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

clear gs_makt.

select matnr from mara into gv_matnr up to 1 rows. endselect.

endmodule. " STATUS_0100 OUTPUT

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


module USER_COMMAND_0100 input.

case okcode.

when 'GETT'.

select single * from makt into gs_makt where matnr = gv_matnr.

when'CANCEL'.

leave to screen 0.

endcase.

endmodule. " USER_COMMAND_0100 INPUT

0 Kudos

In your code

module USER_COMMAND_0100 input.

case okcode.

when 'GETT'.

select single * from makt into gs_makt where matnr = gv_matnr.

Once the data is selected, it is trying to get back again to screen 100 (as you have not specified what needs to be done after data population). So it triggeres PBO of screen 100 again.

You can do this.

Once data is populated, call screen 200. Create this screen 200 and display the result in screen 200. You can also display result in screen 100 itself but you will have to handle that code.

ashish

0 Kudos

hi ashish,

In that screen only i am populatng the fields from makt into that fields in screen.

it is fetching the data but as it is moving to pbo it is clearing that workarea before it is poupating the data.

0 Kudos

What do you want to do once data is populated in SY-UCOMM?

0 Kudos

Why don't you remove the <b>clear</b> statement from the module ?

0 Kudos

Hi Madavi,

In PBO conditionally clear the table otherwise it will clear every time. Remove clear statement from PBO

When ever any event is trigger in module pool it will go to PAI and then to PBO.

Regards

Ganesh