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

Urgent

Former Member
0 Likes
874

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?

5 REPLIES 5
Read only

Former Member
0 Likes
777

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.

Read only

0 Likes
777

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

Read only

Former Member
0 Likes
777

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.

Read only

Former Member
0 Likes
777

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.

Read only

Former Member
0 Likes
777

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