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 Terminated

Former Member
0 Likes
1,612

How can we modify the value of one field in the structure.

I used this code :

read table xlikp with key vbeln = likp-vbeln.

if sy-subrc = 0.

move sy-datum to xlikp-lfdat.

modify xlikp index sy-tabix.

  • read table likp with key vbeln = xlikp-vbeln.

modify likp from xlikp.

.

I have to update the field in LIKP-LFDAT with current system date. ? whats wrong in this code as it gives me a message "update terminated"?

When you said MODIFY likp, you are actually trying to modify the database table not the work area in the user exit. You are supposed to modify the xlikp and ylikp structures in those user exits. For likp, you just have to assign the value in the user exit. Do not use modify.

12 REPLIES 12
Read only

Former Member
0 Likes
1,524

Hi,

Structure LIKP and XLIKP are not in the same format.

Please check the stucuture/data declaration.

By the way, I am still investigating your previous thread. It is interesting ... let you know if I find a solution.

Regards,

Ferry Lianto

Read only

0 Likes
1,524

LIKP and XLIKP do not have the same field defs.

You need to simply use an:

UPDATE LIKP

set lfdat= sy-datum

where vbeln = Your_Vbeln.

Read only

0 Likes
1,524

Thanks Ferry . I m also looking into it ..will update you .

Read only

Former Member
0 Likes
1,524

Hi,

if xlikp is a work area its fine,but if xlikp is an internal table then use the statement

<b>modify likp from table xlikp.</b>

And instead of

modify xlikp index sy-tabix.

Use

<b>modify xlikp transporting lfdat.</b>

Also check the structure of likp & xlikp,they s'd be same.

Read only

Former Member
0 Likes
1,524

Please do not update standard SAP tables directly like that. You will have lot of problems down the line. You should do this in extreeeeeemely rare cases and that too if you know exactly what you are doing. Delivery date on the delivery has a lot of application logic associated with it and changing it directly like that will cause a lot of instability in your system. Please look at BAPI_OUTB_DELIVERY_CHANGE or BAPI_INB_DELIVERY_CHANGE.

Read only

0 Likes
1,524

Hi Srinivas ,

I dont know if you got a chance to see my previous thread.

But the Business req is to change the Delivery Date to current system date when del is created with ref to Sales Order . Manually I can go and change it but when i try to do it from USER EXIT SAVE :

likp-lfdat = sy-datum or move sy-datum to likp or modify likp from table xlikp , I get a message "update terminated ". I also looked through this note : 751000 ...dunno if its pointing to this problem ?

Read only

0 Likes
1,524

Hi Srinivas ,

I dont know if you got a chance to see my previous thread.

But the Business req is to change the Delivery Date to current system date when del is created with ref to Sales Order . Manually I can go and change it but when i try to do it from USER EXIT SAVE :

likp-lfdat = sy-datum or move sy-datum to likp or modify likp from table xlikp , I get a message "update terminated ". I also looked through this note : 751000 ...dunno if its pointing to this problem ?

Read only

0 Likes
1,524

I went to tcode ST22 to see the error log :

It says duplicate SAPSQL_ARRAY_INSERT_DUPREC ,

likp_verbuchen subroutine , line : INSERT LIKP from TABLE lt_likp_db_i .

Read only

0 Likes
1,524

SAP BEE, see your other thread. If you use USEREXIT_SAVE_DOCUMENT_PREPARE and modify the XLIKP table you will see the change in the delivery date. I just tried it in debug and it works.

Read only

0 Likes
1,524

Did you test it for : VL01n : Create Delivery with order reference ??

Read only

0 Likes
1,524

I haven't tried it for VL01N, but it should work.

Read only

0 Likes
1,524

When you said MODIFY likp, you are actually trying to modify the database table not the work area in the user exit. You are supposed to modify the xlikp and ylikp structures in those user exits. For likp, you just have to assign the value in the user exit. Do not use modify.