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

update

Former Member
0 Likes
710

Hi

I have value "ffg" for a field and want to replace second or 3 rd charatcer with "g" Aand update the table assume mara.

How can we update standard table..can we do directly?

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
686

Hi

You must use BAPIs in this case of updating any standard SAP table.

Please use

<b>BAPI_MATERIAL_EDIT</b>. Read the standard documentation

Hope this will help.

Please reward suitable points, incase it suits your requirements.

Regards

- Atul

6 REPLIES 6
Read only

Former Member
0 Likes
686

Hi RK,

Your question is quite unclear.........

If you want to modify the table from program then there should not be any problem as you would be using all the primary key to Modify that Entry in the Database Table.

Regards,

Kunjal

Read only

Former Member
0 Likes
686

Hi,

Std tables are to be updated using the relavent transaction.

for example if you wants to update MARA table you have to go to MM02 t code and have to change the relavent field.

Once you change on the screen by default it will get updated. So no need to write any code.

that is the right methoid for updation of any field in SAP using the related Transaction.

regards,

Anji

Read only

Former Member
0 Likes
687

Hi

You must use BAPIs in this case of updating any standard SAP table.

Please use

<b>BAPI_MATERIAL_EDIT</b>. Read the standard documentation

Hope this will help.

Please reward suitable points, incase it suits your requirements.

Regards

- Atul

Read only

Former Member
0 Likes
686

Hi rk,

1. First of all we should not update standard tables, directly via sql.

(Sap does not recommend this)

2. However, if we want to do this process, then we should do like this.

3.

a) Create one internal table, SAME AS database table.

b) Select * From DBTAB into ITAB.

c)

Loop at Itab.

itab-field1+2(1) = 'g'.

MODIFY DBTAB FROM ITAB.

ENDLOOP.

4. The above logic will update the whole database table, (one by one record in a loop).

regards,

amit m.

Read only

Former Member
0 Likes
686

Hi

My requirement is like this

There is a field labor in mara and has value "FFG",now i want to check condition like this

if i_zdbt-field = 'condition'

update second character of mara-labor with "g".

This is my req.

Thanks in advance

Read only

0 Likes
686

if i_zdbt-field = 'condition'

mara-labor+1(1) = 'g'.

endif.

~Suresh