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 KONP table by a z programme

Former Member
0 Likes
2,756

Hi,

Is it possible to upadate table KONP (Example :Field "KSCHL" = FRC1) by a Z programme.

Since FRC1 cannot be modified or entered manually (as per my requirement).

Thanks

Amba Prasad

Hi,

Is it possible to upadate table KONP (Example :Field "KSCHL" = FRC1) by a Z programme.

Since FRC1 cannot be modified or entered manually (as per my requirement).

Thanks

Amba Prasad

8 REPLIES 8
Read only

Former Member
0 Likes
1,983

Hi,


<a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="732967"></a>

look at this forum, this will def help you.

Regards

Bhavana

Read only

Former Member
0 Likes
1,983

Hi Prasad,

I have tried this code and its working fine, please check this:

DATA: wa_konp LIKE STANDARD TABLE OF konp WITH HEADER LINE.

SELECT SINGLE * FROM konp INTO wa_konp WHERE knumh = '0000000002'

AND kopos = '01'.

CLEAR wa_konp-kschl.

IF sy-subrc EQ 0.

wa_konp-kschl = 'MWAS'.

MODIFY konp FROM wa_konp.

ENDIF.

Regards,

Md Ziauddin.

Read only

Former Member
0 Likes
1,983

Hi Prasad,

IT IS NEVER RECOMMENDED TO UPDATE ANY SAP TABLES BY A Z OBJECT. - So, you can do a where-used-list on the table and can search for all the objects like Function Modules, Classes, etc which might update the tables.

If you are sure about the functionality and know all the tables that needs to be changed simultaneously in an Update Task, then you can go ahead with this. But do a proper SY-SUBRC check for all the Data Dictionary access statements and call

COMMIT WORK or ROLLBACK WORK accordingly.

Hope this helps.

Thanks,

Samantak.

Read only

0 Likes
1,983

YES PRASAD , IT IS POSSIBLE. and the above code is ok.But as Samantak told it is not absolutely not advisable to do this from Z

Thing is that if u do the code where and when will u run the code.That may give a furious result of other processes.Plz consult your Functional.

Read only

Former Member
0 Likes
1,983

Shouldn't this be done via VOFM entry?

Read only

Former Member
0 Likes
1,983

Hi,

in taken into consideration previous discussion ,

you can use FM " PRICING_DOC_UPDATE" to update inplace of zprogram to update konv directly

Regards,

Alpesh

Read only

Former Member
0 Likes
1,983

Hi ,

you can update the standard tables with update , but please see to make use of lock objects before you attempt to update standard sap tables.

Regards,

Uma Dave

Read only

0 Likes
1,983

Hi,

Never Update SAP Standard tables using UPDATE. This will lead to data inconsistency.

Update the standard tables using BAPI or BDC only

Regards

Vinod