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

Regarding Updating Database

Former Member
0 Likes
1,289

hi guys,

i just got a problem with updation of Database table EINE. I got some price details

and these details have to be updated to EINE-NETPR.

i am using select statement to select price details and using update command to update EINE-netpr.

update EINE where netpr = itab-netpr. ( simillar to this )

if sy-subrc = 0.

commit work.

endif

But, still when i checked the entries in EINE, netpr ( price ) is not updated.

I checked in debug mode and update command works well but its not updating EINE in real when i am checking the entries in it.

can any one please help me, do u think UPDATE command can be used to update Data base tables or do u think i need to add any other commit work statements after update or can any one tell me exactly how to update the database tables.

please send me a piece of code if possible.

thank you

pavan kumar

10 REPLIES 10
Read only

Former Member
0 Likes
1,191

Hi,

It is not good practice to do direct table udpates..

Instead use a BAPI or standard sap FM to update the standard sap tables..

Thank,

Naren

Read only

Former Member
0 Likes
1,191

Hi,

You can use in this way also ..

<b>UPDATE EINE SET NETPR = 'A310'

WHERE field = XXX</b>

Regards

Sudheer

Read only

Former Member
0 Likes
1,191

Hi,

Agree with Naren that it is not good practice to update SAP table directly. Try to use BAPI or BDC to update EINE.

But you can try like this.

UPDATE EINE SET NETPR = ITAB-NETPR

WHERE <your condition>.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
1,191

Hi,

DO NOT try updating the table entries through update command or by going into debug modein your SE11 table entries.

We do not know which standard tables get afffected dur to this change.

As Narendran suggested, you can use the standard FMs to update the field.

Regards

Subramanian

Read only

Former Member
0 Likes
1,191

thanks for your answers, but can you please tell me how do u use BDC to update the data base in my requirement or is there any standard BAPI available to update it.

thanks

pavan kumar

Read only

0 Likes
1,191

What is the standard transaction that updates this table?

Rob

Read only

0 Likes
1,191

Hi,

USe ME12 or ME14.

Regards

Subramanian

Read only

Former Member
0 Likes
1,191

standard transaction is ME11

thanks

pavan kumar

Read only

Former Member
0 Likes
1,191

Hi Pavan,

Please try this FM perhaps they may help.

ME_DIRECT_INPUT_INFORECORD

ME_DB_UPDATE_INFORECORDS

ME_UPDATE_INFORECORD

ME_UPDATE_INFORECORD_COND

ME_UPDATE_INFORECORD_PD

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
1,191

thanks for your answers, but if i use any one of the function modules i suppose these function modules specified are only used to update the info record right?

what i mean is, i can use any one of these function modules only after select statement just to update i.e instead of UPDATE command right?

thanks

pavan kumar