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

Updating standard table

Former Member
0 Likes
1,073

Dear friends,

I have to update standard table EKPO. in EKPO i have to update field NETPR. I have value in one varible. I have purchasing document number, Item number and material number also.

How to do this. Please let me know.

Thanks in advance

Regards,

Ajay

4 REPLIES 4
Read only

Former Member
0 Likes
783

hi,

Do you have access for standard table.

if not Write a small program to update netpr value

using update statement addition with set.

Read only

Former Member
0 Likes
783

Hello Ajay-

Follow the below steps to update standard table EKPO.

Pull the particular using select statement.

data:i_vbap type table of vbap,

w_vbap type vbap.

select * from vbap into table i_vbap

where matnr eq ** and

posnr eq *** and.........

      • if only 1 record

Read i_vbap into w_vbap index 1.

if sy-subrc eq 0.

vbap-netpr = v_netpr. *** the value in variable

vbap-matnr = w_ivbap-matnr.

vbap-......follow the sequence.

MODIFY vbap FROM w_vbap.

****if multiple records.

Loop at i_vbap into w_vbap.

vbap-netpr = v_netpr. *** the value in variable

vbap-matnr = w_ivbap-matnr.

vbap-......follow the sequence.

MODIFY vbap FROM w_vbap.

endloop.

Cheers,

~Srini....

Read only

0 Likes
783

Dear Srini,

that logic updates only EKPO table, not all related tables. I hope there will be function module for that to change.

Please suggest.

Thanks,

Ajay

Read only

Former Member
0 Likes
783

Hi,

Select the values from datbase table based on the PO No and the Line item no into a internal table which have the same structure as the database table which you are updating.

Change the value of the NETPR and updatate it. Please note that the structure of the internal table is same as the database table.

regards

Sourabh