2007 Feb 16 7:41 AM
Hi folks,
We generally know that we write " SELECT Statements " in PBO.
But if i write SELECT STATEMENT IN PAI. then wht will be the outcome and if there is any example plz suggest.
thnking u.
regards,
satya.
2007 Feb 16 7:43 AM
Hi Satys,
There is no difference to write the Code in PBO or PAI. that is depending on the scenario which we work. PBO will trigger before the screen comes and PAI will trigger any user action. if you write the same select in PAI it will work.
Regards
Sudheer
2007 Feb 16 8:27 AM
select statement is not at all affected whether you are coding it in pbo / pai?
this two events are for only screen display and user interaction on that.
PBO --- before showing the screen (and after PAI of the same screen/ pai of previous screen) .
PAI --- after user interaction in the screen.
so if you want to show the data in the screen field when it is loaded firsttime as well as after some user interaction. then do code in PBO.
if you want to put one value in the screen field and on the basis of that value you want to show the data in other fields of your screen then you can do it in PAI(or in PBO).
regards
shiba dutta
2007 Feb 16 11:19 AM
Hi shiba..
thank u for ur reply.
can u throw a samll expl i m bit confused. i can get my doubt cleared.
thank u all frnds...
regards,
satya
2007 Feb 16 11:24 AM
Hello,
PAI:
When ever some user actions takes place like SAVE, DELETE, SUBMIT etc.,, you capture the function code and write your code here.
PBO:
Just remember that PBO will be processed before the screen is displayed to the end user.
Dont have myth that select statements are always written in PBO. Nothing like that. Everything depends up on your requirements.
it is better if you go through some topics on Module Pool programming before trying your hand in development.
Regs,
Venkat Ramanan N
Message was edited by:
Venkat Ramanan Natarajan
Message was edited by:
Venkat Ramanan Natarajan
2007 Feb 16 11:33 AM
2007 Feb 16 11:54 AM
In PAI of the screen 9100 write as belwo
module USER_COMMAND_9001 input.
CASE sy-ucomm.
WHEN 'EXIT' or 'CANC'.
* free the container
* leave program.
LEAVE PROGRAM.
when 'BACK'.
* free ALV grid
set screen '0'.
leave screen.
* This leaves the program but you may need to re-call the
* transaction to go back to the original screen
When 'ME32K'.
CALL TRANSACTION 'ME32K' .
Similarly u can write ur query or anything depending
upon ur fcode created in the screen painter. This part of teh code will work only when u press the button after the display.
when others.
ENDCASE.
endmodule. " USER_COMMAND_9001 INPUT
module STATUS_9001 output.
*enable the back and cancel buttons
SET PF-STATUS 'Z_TEMPLATE_STATUS'.
SET TITLEBAR 'ZTITLE'.
* This form create the Docking container and the ALV grid.
perform f9000_objects_create.
Hope this solves ur query.
In PBO u will be setting the PF-STATUS and u have to specify the FCODE for
BACK, Cancel and Exit.