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

how to insert/modify records from internal table to database table

Former Member
0 Likes
845

Hi ,

Can anyone please send me the code to modify a database table (MARA) from

Internal table t_MARA.

Regards

rahul

1 ACCEPTED SOLUTION
Read only

former_member378318
Contributor
0 Likes
690

Hi Sharma,

Yes the previous replies are very naughty advising you to directly update table MARA, this is not recommended and could seriously damage the data integrity of the database.

Have a look at the BAPI called BAPI_MATERIAL_MAINTAINDATA_RT which you can use to safely update MARA and associated tables.

Surbjeet

Hi ,

Can anyone please send me the code to modify a database table (MARA) from

Internal table t_MARA.

Regards

rahul

4 REPLIES 4
Read only

Former Member
Read only

marcelo_ramos1
SAP Mentor
SAP Mentor
0 Likes
690

Hi,

Try this way.


  INSERT mara FROM TABLE t_mara.

Or.

  LOOP AT t_mara.
    INSERT INTO mara VALUES t_mara.
  ENDLOOP.

Or.

  UPDATE mara FROM TABLE t_mara.

Or.

MODIFY mara FROM TABLE t_mara.

Regards.

Marcelo Ramos

Read only

Former Member
0 Likes
690

PLEASE DO NOT UPDATE STANDARD TABLES FROM YOUR PROGRAM.

Read only

former_member378318
Contributor
0 Likes
691

Hi Sharma,

Yes the previous replies are very naughty advising you to directly update table MARA, this is not recommended and could seriously damage the data integrity of the database.

Have a look at the BAPI called BAPI_MATERIAL_MAINTAINDATA_RT which you can use to safely update MARA and associated tables.

Surbjeet