‎2006 Jun 05 8:35 PM
Hello all,
In custom table maintenance view I'm using a couple of events in PAI to format records to be inserted. I also have a program that inserts entries into that table. Is there a function call that I can use instead of regular insert statement that would also go through those events?
Thank you,
Leon
‎2006 Jun 05 8:40 PM
You can call the event subroutines from ur external program using PERFORM statement.
‎2006 Jun 05 8:58 PM
Hi Leon,
You can use PERFORM statement to call particular routine in a different program to go through the events.
perform function_name1(prog_name1) using param1 param2.function_name1 routine will be called from prog_name1 which is external to your tbale maintenance module pool.
Cheers,
Vikram
Please reward for helpful replies!!
‎2006 Jun 05 9:04 PM
Thank you for your replies but the routine I'm using is standard temporal_delimitation and there are no parameters that I can use.
‎2006 Jun 05 9:14 PM
If u've declared TABLES statement for the table ur going to insert in the external abap program, the content of the work area is available to the event routines.
Another method to have access to data in ur external program from event routines is declare shared data area
using
DATA: BEGIN OF COMMON PART area1
<variables>
END OF COMMON PART area1.
the declaration should be same in both programs.
Regards
Sridhar
‎2006 Jun 05 9:16 PM
Hi Leon,
Im not very clear with your requiremnt but if you have to use this routine, why dont you copy routine into new Z include program and modify the same to meet your requirements and then call it from your table maintenance program.
Cheers,
Vikram
Pls reward for helpful replies!!
‎2006 Jun 05 10:12 PM
Leon,
As per my knowledge,I don't think its possible to trigger those events.
My suggestion would be to do such checks/formats before updating to this table.
Regds
Manohar
‎2006 Jun 05 10:51 PM
What about those functions: VIEWPROC_<view> and VIEWFRAME_<view> or VIEW_MAINTENANCE. Are those to accomplish what I need. the interface is confusing.
‎2006 Jun 05 11:13 PM
If you want to call subroutines created for table maintenance events from another abap program, you don't need to use VIEWPROC_<view> VIEWFRAM functions...
What are the Table maintenance dialog events (event numbers) did you use? I believe there are no insert statements in those subroutines, just formatting.. isn't it?
Ifur abap program and the subroutines process one record at a time, then here's the pseudo code of the external abap program for using the event subroutines.
report ZPROGRAM
tables ZTAB
select single * from ZTAB where ...
perform event_sub_routine(include_prog_name)
insert ztab.
******
Include program
form event_sub_routine
Do the required format changes to ZTAB.
Adjust the code to work for both table maintenance and the external program
endform