‎2008 Dec 13 3:43 PM
Hi all,
I need to perform an update on a transparent table LIKP. In particular, I have to select a special delivery number (VBELN) into the LIKP and set up the VSART field to a particular value.
I have used the following code but the COMMIT doesn't work:
SELECT SINGLE * FROM likp INTO wa_likp
WHERE vbeln EQ ddt.
wa_likp-vsart = '03'.
MODIFY likp FROM wa_likp.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .
WAIT UP TO 5 SECONDS.If I put a breakpoint on the select statement, the code works fine.
Does anyone have any suggestion to do this work?
Thanks,
GB
‎2008 Dec 13 3:56 PM
‎2008 Dec 13 4:01 PM
commit work would definately or else try calling the fm u are using, in update task
‎2008 Dec 13 6:36 PM
Hi there... try this
Its always good practice to check the select and then perform the process..
SELECT SINGLE * FROM likp INTO wa_likp
WHERE vbeln EQ ddt.
wa_likp-vsart = '03'.
if sy-subrc eq 0.
MODIFY likp FROM wa_likp.
Commit work.
endif.
‎2008 Dec 13 7:32 PM
Hi,
I would suggest you use UPDATE instead of MODIFY.
SELECT SINGLE * FROM likp INTO wa_likp
WHERE vbeln EQ ddt.
wa_likp-vsart = '03'.
UPDATE LIKP SET VSART = '03'
where vbeln EQ wa_likp-vbeln.
COMMIT WORK.
Now if you already have the document number, you need not select from the database. Simply use the UPDATE statment. And remember to use the conversion exit for the delivery number before you do the update.
regards,
Aadvait
Edited by: Advait Gode on Dec 13, 2008 8:32 PM
‎2008 Dec 14 2:01 PM
Hi all,
I used all your tips, but without any result.
Other ideas?
Thanks,
Gianluca
‎2008 Dec 14 2:22 PM
Hi,
Can you paste the code that you have implemented ? I hope you are using the conversion exit for the Delivery number as I mentioned earlier.
What I was proposing was something like this.
" call the conversion exit for the field ddt
UPDATE LIKP SET VSART = '03'
where vbeln EQ ddt.
if sy-subrc = 0. "Put a breakpoint here and see what is the value of Sy-subrc. If you dont want to put a break point, then give a message with the value of the sy-subrc to see if the update was successfull
COMMIT WORK.
endif.
Also make sure that 03 is an acceptable value for the field VSART and that there is no check table/ restrictive domain vaules for it.
regards,
Advait
‎2008 Dec 15 8:47 AM
Here are my code, that not work (Note that the VBELN doesn't need a conversion exit because it's filled by the SELECT single stm)
SELECT SINGLE * FROM likp INTO wa_likp
WHERE vbeln EQ wa_sel_object_tab2-ddt.
UPDATE likp SET vsart = '03'
WHERE vbeln EQ wa_likp-vbeln.
IF sy-subrc = 0.
COMMIT WORK.
* COMMIT WORK AND WAIT.
ENDIF.The value of sy-subr is 0 (I seen it in debug mode).
Also I tryed with the stm COMMIT WORK AND WAIT. without any result.
Help me please.
Thanks,
GB
‎2008 Dec 15 6:04 PM
your Code looks good through.
Small doubt:Check the Sy-subrc value for Below query?
*SELECT SINGLE * FROM likp INTO wa_likp*
WHERE vbeln EQ wa_sel_object_tab2-ddt
And VSART NE '03'.
Does Sy-subrc = 0 here?
‎2008 Dec 15 8:55 AM
>
> CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' .
> WAIT UP TO 5 SECONDS.
>
Try calling the FM like this
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' in update task.
‎2008 Dec 15 9:00 AM
>
>
SELECT SINGLE * FROM likp INTO wa_likp > WHERE vbeln EQ ddt. > wa_likp-vsart = '03'. > MODIFY likp FROM wa_likp. > > CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' . > WAIT UP TO 5 SECONDS.>
> GB
Why do you do the select? Bad Performance....
update likp
set vsart = '03'
where vbeln = ddt.
if sy-subrc = 0.
commit work and wait.
else.
message 'Update likp failed' type 'A'.
endif.
‎2008 Dec 15 10:06 AM
No one of your solution works...
I try with:
the update task, the SET UPDATE TASK LOCAL, the UPDATE stm in place of the modify, the BAPI_TRANSACTION_COMMIT, the COMMIT WORK, but no result are taken.
How it's possible??!?
‎2008 Dec 15 10:17 AM
>
> No one of your solution works...
> How it's possible??!?
Yoa are doing something wrong.
‎2008 Dec 15 5:00 PM
There's any BAPI to perform the VSART change into an existing Delivery?
I created the Delivery with BAPI_OUTB_DELIVERY_CREATENOREF
I found BAPI_OUTB_DELIVERY_CHANGE but how can I change the LIKP-VSART?
Thanks in advance,
GB
‎2008 Dec 15 8:04 PM
> > No one of your solution works...
> > How it's possible??!?
Yoa are doing something wrong.
Seems most likely to me.
‎2008 Dec 16 11:34 AM
Hi all,
I solved the issue with this code:
* Wait until COMMIT of Delivery
DO.
SELECT COUNT(*) FROM likp
WHERE vbeln = ddt.
CHECK sy-subrc = 0.
EXIT.
ENDDO.
UPDATE likp SET vsart = '03'
WHERE vbeln EQ ddt.
IF sy-subrc NE 0.
MESSAGE w904 WITH ddt '03'.
ENDIF.The infinite loop is useful to guarantee that the delivery is committed.
Best regards,
Gianluca Barile
‎2008 Dec 16 11:45 AM
Hi,
It seems like you are doing this in a user exit while creating the delivery. In that case yes the update will not happen until the delivery is created in the database. You didn't mention in your question about this and hence everybody was on a single track.
regards,
Advait
‎2008 Dec 15 9:31 AM
after MODIFY likp FROM wa_likp.
try with SET UPDATE TASk LOCAL
‎2008 Dec 15 5:37 PM
I tried your code. It works fine. You are probably not SELECTing anything in the first place because of missing leading zeroes.
Rob