‎2011 Apr 06 10:27 AM
Hi All
I am using WS_DELIVERY_UPDATE_2 to update delivery qty and pick quantity. but there is no result, and no error. did i miss anything?
call function 'WS_DELIVERY_UPDATE_2'
exporting
vbkok_wa = wa_vbkok
delivery = p_vbeln
update_picking = 'X'
no_messages_update = 'X'
synchron = 'X'
commit = 'X'
nicht_sperren = 'x'
if_database_update = '1'
if_error_messages_send = 'x'
importing
ef_error_any = z_error_any
ef_error_in_item_deletion = z_deletion_error
ef_error_in_pod_update = z_pod_error
ef_error_in_interface = z_interface_error
ef_error_in_goods_issue = z_pgi_error
ef_error_in_final_check = z_final_error
tables
vbpok_tab = i_vbpok
prot = i_prot.
Thanks,
Venkat.
‎2011 Apr 06 11:35 AM
Hi
You need not use every parameter.Attached along is the sample code for catching the error message.
And do use Bapi commit for synchronous DB update
CALL FUNCTION 'WS_DELIVERY_UPDATE_2
EXPORTING
vbkok_wa = vbkok_wa "(TYPE vbkok)
commit = 'X'
delivery = p_delivery
it_sernr_update = it_sernr "(TYPE shp_sernr_update_t)
TABLES
prot = prott "(LIKE STANDARD TABLE OF prott WITH HEADER LINE)
EXCEPTIONS
error_message = 99.
Certain messages do not appear only sy-subrc is set
IF sy-subrc = 99.
prott-msgno = '000'(037).
prott-msgty = 'E'(036).
prott-msgid = c_message_id.
prott-msgv1 = 'Delivery'(034).
prott-msgv2 = p_delivery.
prott-msgv3 = 'cannot be updated'(035).
*prott-MSGV4 = it
APPEND prott.
ENDIF.
DESCRIBE TABLE prott LINES v_prott_lines.
IF v_prott_lines <> 0.
gv_error = c_char_x.
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = c_wait.
IF v_prott_lines <> 0.
PERFORM post_prott_messages TABLES i_message_tab
prott.
CLEAR prott.
REFRESH prott.
Hope it helps.
Renu
‎2011 Apr 07 6:45 AM
Hi Renu
Thanks for your reply. I tried with your code still no result and no error.
I want to update delivery and pik quanitity also. check my code and any necessary inputs required please tell..
WA_VBKOK_WA-VBELN_VL = ls_it_lips1-vbeln.
WA_VBKOK_WA-VBTYP_VL = 'T'.
move WA_VBKOK_WA to VBKOK_WA.
DELIVERY = ls_it_lips1-vbeln.
loop at lt_it_lips1 into ls_it_lips1.
WA_VBPOK_TAB-VBELN_VL = ls_it_lips1-vbeln.
WA_VBPOK_TAB-POSNR_VL = ls_it_lips1-posnr.
WA_VBPOK_TAB-VBELN = ls_it_lips1-vbeln.
WA_VBPOK_TAB-POSNN = ls_it_lips1-posnr.
WA_VBPOK_TAB-MATNR = ls_it_lips1-matnr.
WA_VBPOK_TAB-WERKS = ls_it_lips1-werks.
APPEND WA_VBPOK_TAB to VBPOK_TAB.
*MOVE WA_VBPOK_TAB to VBPOK_TAB.
endloop.
loop at lt_it_lips1 into ls_it_lips1.
WA_PROTT-VBELN = ls_it_lips1-vbeln.
WA_PROTT-POSNR = ls_it_lips1-posnr.
WA_PROTT-matnr = ls_it_lips1-matnr.
WA_PROTT-arktx = ls_it_lips1-arktx.
WA_PROTT-LFIMG = ls_it_lips1-LFIMG.
WA_PROTT-VRKME = ls_it_lips1-VRKME.
APPEND WA_PROTT to PROTT .
*MOVE WA_PROTT to PROTT.
endloop.
CALL FUNCTION 'WS_DELIVERY_UPDATE_2'
EXPORTING
VBKOK_WA = VBKOK_WA
SYNCHRON = 'X'
NO_MESSAGES_UPDATE_1 = 'X'
COMMIT = 'X'
DELIVERY = DELIVERY
UPDATE_PICKING = 'X'
IMPORTING
EF_ERROR_ANY = EF_ERROR_ANY
EF_ERROR_IN_ITEM_DELETION = EF_ERROR_IN_ITEM_DELETION
EF_ERROR_IN_POD_UPDATE = EF_ERROR_IN_POD_UPDATE
EF_ERROR_IN_INTERFACE = EF_ERROR_IN_INTERFACE
EF_ERROR_IN_GOODS_ISSUE = EF_ERROR_IN_GOODS_ISSUE
EF_ERROR_IN_FINAL_CHECK = EF_ERROR_IN_FINAL_CHECK
EF_ERROR_PARTNER_UPDATE = EF_ERROR_PARTNER_UPDATE
EF_ERROR_SERNR_UPDATE = EF_ERROR_SERNR_UPDATE
TABLES
VBPOK_TAB = VBPOK_TAB
PROT = PROTT
EXCEPTIONS
error_message = 99.
data c_message_id type MSGID.
Certain messages do not appear only sy-subrc is set
IF sy-subrc = 99.
wa_prott-msgno = '000'(037).
wa_prott-msgty = 'E'(036).
wa_prott-msgid = c_message_id.
wa_prott-msgv1 = 'Delivery'(034).
wa_prott-msgv2 = delivery.
wa_prott-msgv3 = 'cannot be updated'(035).
*prott-MSGV4 = it
APPEND wa_prott to prott1.
ENDIF.
Thanks,
Venkat.
Edited by: venkat1011 on Apr 7, 2011 10:47 AM
‎2011 Apr 07 12:39 PM
Hi Venkat,
I didnt find anything wrong in your code as well ... i suggest you debug and see what is happening.
I tried doing a whereuse on the FM and its been similarly used everywhere.
Let me know if you need some more help
Regards
Renu
‎2011 Apr 11 9:31 AM
Hi Renu,
I am not getting where is the problem, i cheked through debugging, displaying error message 99 .. delivery not updated.
I observed that after executing FM PROTT contains nothing, eventhough we suplly some records.
Thanks,
Venkat.
‎2011 Apr 11 9:34 AM
Hi Renu,
I am not getting where is the problem, i cheked through debugging, displaying error message 99 .. delivery not updated.
I observed that after executing FM PROTT contains nothing, eventhough we suplly some records.
Thanks,
Venkat.
‎2011 Apr 11 10:34 AM
Hi Venkat,
Read the code snippet i have posted above.
If you get error message no as 99 then you need to populate prott table yourself.
Certain messages do not appear only sy-subrc is set
IF sy-subrc = 99.
prott-msgno = '000'(037).
prott-msgty = 'E'(036).
prott-msgid = c_message_id.
prott-msgv1 = 'Delivery'(034).
prott-msgv2 = p_delivery.
prott-msgv3 = 'cannot be updated'(035).
APPEND prott.
ENDIF.
Regards
Renu