Application Development 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: 

Update database table - Urgent

Former Member
0 Kudos

Hi Experts,

I want to update a database table from an internal table with a certain condition .

For example I want to update the MARA table from values in the internal table it_mara (say) with a condition MTART in MARA eq 'XYZ'.

Could any one tell me the syntax for this.Its bit urgent.

Regards,

Vishnu.

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos

YOu have another internal table and get only the records that you need.

loop at itab where mtart = 'XYZ'.

move-corresponding itab to itab_new.

append itab_new.

clear itab_new.

endloop.

modify mara from table itab_new.

Regards,

Ravi Kanth Talagana

7 REPLIES 7

former_member181962
Active Contributor
0 Kudos

YOu have another internal table and get only the records that you need.

loop at itab where mtart = 'XYZ'.

move-corresponding itab to itab_new.

append itab_new.

clear itab_new.

endloop.

modify mara from table itab_new.

Regards,

Ravi Kanth Talagana

0 Kudos

Do not pursue any coding options that perform direct table updates!!!

Look for BAPIs or even resort to an old-fashioned BDC ot make your updates.

Direct table updates can quickly destroy the referential integrity of the database.

And it could quickly end your employment as well.

Former Member
0 Kudos

It's generally a bad idea to directly update standard SAP tables. There may be other tables that need to be updated as well and if you don't take that into account, you could run into a problem with data integrity.

Rob

Former Member
0 Kudos

Hi Experts,

I want to transfer some data from 3 internal tables into an app server.I remember that there is some syntax 'Open file with appending mode'.

Could you tell me the correct syntac for the same.

Regards,

Vishnu.

0 Kudos

Vishnu,

Just to be clear - you did NOT implement direct table updates - did you?

0 Kudos

Vishnu,

Your answer:

OPEN DATASET your_app_server_path_and_filename_here FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

0 Kudos

This is an entirely different question. Since you've marked it as solved, you'll probably get more response if you post a new thread.

Rob