Application Development and Automation 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: 
Read only

Events - Table Maintenance Generator

Former Member
0 Likes
815

Hello All,

I have created a events in table maintenance generator. i am facing problem in coding. i need to do the coding "Before saving to database". I am using table "Total" and "Extract" for getting the table records since these two are char based i am getting junk values in these table. In my ztable i am having a field of type Dec. Is there any way to get the decimal values because i need to do validations depending on these values.

Also i dont know to identify the Newly added or Updated record from the user. Also i need to have a relation between the new and existing reocords in database.

Hello All,

I have created a events in table maintenance generator. i am facing problem in coding. i need to do the coding "Before saving to database". I am using table "Total" and "Extract" for getting the table records since these two are char based i am getting junk values in these table. In my ztable i am having a field of type Dec. Is there any way to get the decimal values because i need to do validations depending on these values.

Also i dont know to identify the Newly added or Updated record from the user. Also i need to have a relation between the new and existing reocords in database.

4 REPLIES 4
Read only

Peter_Inotai
Active Contributor
0 Likes
731

You can use event 21 for this.

If you want to check, which data was already saved you can just make a select from the database table and compare it with the TOTAL[] table.

Peter

Read only

0 Likes
731

Actually i am using the Event "01".

My Ztable is having 5 fields out of 5 fields 2 fields are char and 2 fields are Dats but one field is Dec. This dec field is giving problem. Because the TOTAL[] table is having values except for the Dec field it is having junk values.

Also how to find the newly modified or added field because this is having all the records in the field.

Read only

0 Likes
731

you can have a field symbol which is the same type as your ztable and assign TOTAL to it. Then you can refer to <struc>-dec_variable!

Also, the field symbol <action> contains the action of the current line within TOTAL.

The field symbols which show the processing status of the entries in the internal tables TOTAL and EXTRACT can take the following constant values:

GELOESCHT : flagged for deletion

NEUER_EINTRAG : New entry

AENDERN : changed entry

UPDATE_GELOESCHT : entry first changed and then flagged for deletion

NEUER_GELOESCHT : entry first newly created, not yet saved, and then flagged for deletion

ORIGINAL : the same as the database status

Example

IF <XACT> = GELOESCHT.

...

ENDIF.

Read only

Former Member
0 Likes
731

HI

GOOD

GO THROUGH THIS LINK WHICH CONTAIN THE DETAILS ABOUT THE TABLE MAINTENANCE GENERATOR DETAILS.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how to implement events in table maintenance.doc

THANKS

MRUTYUN