2006 Jul 19 7:24 PM
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"?
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"?
2006 Jul 19 7:27 PM
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
2006 Jul 19 7:29 PM
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.
2006 Jul 19 7:29 PM
2006 Jul 19 7:30 PM
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.
2006 Jul 19 7:31 PM
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.
2006 Jul 19 8:37 PM
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 ?
2006 Jul 19 9:05 PM
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 ?
2006 Jul 19 9:08 PM
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 .
2006 Jul 19 9:13 PM
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.
2006 Jul 19 9:14 PM
Did you test it for : VL01n : Create Delivery with order reference ??
2006 Jul 19 9:16 PM
2006 Jul 20 4:50 AM
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.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |