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

Event code in table maintenance generator

Former Member
0 Likes
1,803

Hi All,       Need to call event in Table maintenance generator of the z table. I have to use 1st event (Select ’01’ – Before saving data in the database).     Need to do fallowing job: Table cleaning : Delete all records with value year =< 2011 -New rule :      No save can be done with value (Pst Var, PA,PSA, Cost = ‘ *,*,*,*’). I am attaching table entry with this mail, I have written the code for this but not sure please suggest me modification if required for this.Because i have never done this before. Thanks and Regards Sankil     

4 REPLIES 4
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
886

Hi Sankil

I would suggest you to check in debugging and have a look at TOTAL and EXTRACT internal table values. Read the values from these table and proceed

Nabehet

Read only

0 Likes
886

hi nabheet,   I have check in debugging values are showing proper but message what  i need when given 4 fields * need to pop up with message,which is not reflecting at all also in debugging. Thanks Sankil

Read only

Former Member
0 Likes
886

hi Sankil

Some variable is not available in your code and you did not modify EXTRACT table.

Try to modify your code as blow:

This event has no standard routine. The following global data is available for the realization of the user routine:

•internal table TOTAL
•field symbols
•field symbols <ACTION> and <ACTION_TEXT>
•<STATUS>-UPD_FLAG
If internal table data are to be changed before saving, t he changes should be made in both the internal table

TOTAL and in the internal table EXTRACT.

FORM abc.
DATA: F_INDEX LIKE SY-TABIX. "Index to note the lines found
LOOP AT TOTAL.
IF <ACTION> = desired constant.
READ TABLE EXTRACT WITH KEY <vim_xtotal_key>.
IF SY-SUBRC EQ 0.
F_INDEX = SY-TABIX.
ELSE.
CLEAR F_INDX.
ENDIF.
(make desired changes to the line TOTAL)
MODIFY TOTAL.
CHECK F_INDX GT 0.
EXTRACT = TOTAL.
MODIFY EXTRACT INDEX F_INDX.
ENDIF.
ENDLOOP.
SY-SUBRC = 0.
ENDFORM

refer event 01: http://help.sap.com/saphelp_nw04/helpdata/en/91/ca9f0ea9d111d1a5690000e82deaaa/frameset.htm

regards,

Archer

Read only

Former Member
0 Likes
886

hi nabheet,  I have check in debugging values are showing proper but message what  i need when given 4 fields * need to pop up with message,which is not reflecting at all also in debugging. Thanks Sankil