2014 Mar 06 6:21 AM
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
2014 Mar 06 7:11 AM
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
2014 Mar 06 9:41 AM
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
2014 Mar 06 8:10 AM
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
2014 Mar 06 11:45 AM
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