2008 May 07 6:56 AM
Hi Experts,
Iam new to SAP.
How can i update custom Tables?
I have 2 custom tables and i created table maintenance generator and Tcodes for the both tables.
After creation of Tcodes what i'll do?
Before updating the table i have to check the formula by using check_formula function module?
How to approach this thing?
Hi Experts,
Iam new to SAP.
How can i update custom Tables?
I have 2 custom tables and i created table maintenance generator and Tcodes for the both tables.
After creation of Tcodes what i'll do?
Before updating the table i have to check the formula by using check_formula function module?
How to approach this thing?
2008 May 07 6:59 AM
Hi,
You have generated the table maintenance.
through SM30 you can maintain the table values.
For triggering the functioin module.
You know that you have given screen number while creating the table maintenance generator. go to that screen and go to the PAI module. and create one module for to call your function module.
Regards,
Madan.
2008 May 07 7:02 AM
You can do it in the generated coding indeed, however, after regenerating the screen everytime you will have to add this coding again.
Better is to use the events for table maintenances. These can be found via table maintenance generation, via the menu look for events.
http://help.sap.com/saphelp_nw70/helpdata/EN/91/ca9f0ea9d111d1a5690000e82deaaa/frameset.htm
Edited by: Micky Oestreich on May 7, 2008 8:04 AM
2008 May 07 7:00 AM
Hi,
1.execute the Tcodes of each table and give the values for all the fields and update it by saving.
2.check_formula:write the code under PAI:
Good to know that your problem is solved. But I also hope that you have noticed that having an entry in the TFKT table is not really mandatory. You can as well give the formula directly in the code.
The one good reason why you would want to do it through TFKT is that the table is allowed for mainenance. So should someone decide to change a formula lateron, they can just change the entry in the table. In other word, TFKT can serve as some sort of a configuration table.
3.Eg:REPORT ZTEST.
DATA: FORMULA(50) VALUE 'TFKT:CIRCLEAREA(A)',
RADIUS TYPE F VALUE '1000',
AREA TYPE F,
RETCODE LIKE SY-SUBRC.
WRITE: / 'Entered Radius :', RADIUS.
CALL FUNCTION 'CHECK_FORMULA'
EXPORTING FORMULA = FORMULA
PROGRAM = 'ZANAND_TEST'
ROUTINE = 'CHECK_VALUES'
IMPORTING SUBRC = RETCODE.
IF RETCODE IS INITIAL.
CALL FUNCTION 'EVAL_FORMULA'
EXPORTING FORMULA = FORMULA
PROGRAM = 'ZANAND_TEST'
ROUTINE = 'GET_VALUES'
IMPORTING VALUE = AREA
EXCEPTIONS OTHERS = 1.
WRITE: / 'AREA Computed :', AREA.
ENDIF.
FORM GET_VALUES USING PARM CHANGING WERT SUBRC.
IF PARM = 'A'.
WERT = RADIUS.
SUBRC = 0.
ENDIF.
ENDFORM.
FORM CHECK_VALUES USING PARM CHANGING SUBRC.
IF PARM = 'A'.
SUBRC = 0.
ENDIF.
ENDFORM.[/code]
Should you have further doubts, then please look at the sample programs RSCALC01 and RSCALC10.
Regards,
Shiva.
2008 May 07 7:11 AM
Hi,
Before updating the data you can call that function module
in sm30 Environment->Modification>events
here in the Editor you can write the code for calling the Required Function module.
Regards,
Raj.
2008 May 07 7:12 AM
You can do this using Table Maintenance Events. For details of this, please have a look at below link:
[Events in Table Maintenance|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how%20to%20implement%20events%20in%20table%20maintenance.doc]
Let me know if any doubts.
I hope it helps.
Best Regards,
Vibha
Please mark all the helpful answers