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 database table

Former Member
0 Likes
708

Hello Experts,

I need update database table MCHA from an internal table.

the code is:

<b>data: begin of i_afko occurs 0,

date1 like mcha-fvdt2,

end of i_afko.</b>

the contents of this internal table:

date1:

-


20061113

<b>data: begin of i_mcha occurs 0,

charg like mcha-charg,

end of i_data</b>.

i have one record in this internal table like this:

charg

-


132960

now i have to update table <b>MCHA</b> with <b>date1</b> value where <b>charg = i_mcha-charg.</b>

could any one of please tell me how can i update that?

Thanks a lot.

1 ACCEPTED SOLUTION
Read only

former_member186741
Active Contributor
0 Likes
672

sap strongly discourage direct updates to sap standrad tables, such as MCHA. Because of the way the tables are related to others it is very dangerous to manipulate them independently.You should use a standard transaction or write a program to call such a transation or a bapi.

However, MCHA does not have a field called DATE1 anyway...which field do you want to update?

5 REPLIES 5
Read only

former_member186741
Active Contributor
0 Likes
673

sap strongly discourage direct updates to sap standrad tables, such as MCHA. Because of the way the tables are related to others it is very dangerous to manipulate them independently.You should use a standard transaction or write a program to call such a transation or a bapi.

However, MCHA does not have a field called DATE1 anyway...which field do you want to update?

Read only

0 Likes
672

neil,

the thing is our business is needing to maintain a date calcualted through one of our programs on BATCH record's (MCHA-FVDT2) on Basic Data 2 tab.

If I wanna call a transaction(msc2n) to change the batch record through my program, would it be a better idea?

Read only

0 Likes
672

Unfortunately, MSC2N can't be used in batch input (according to OSS). They suggest using old transaction MSC2 instead.

You might also try BAPI_BATCH_CHANGE.

rob

Read only

0 Likes
672

cool!!!

Thnx Guyz.

Read only

Former Member
0 Likes
672

Hi,

mcha-date1 = i_afko-date1.

update mcha.

I hope this helps.

Shreekant.