on 08-06-2013 2:23 PM
Hello experts ,
1) How to delete a SC if follow on docs are created ?
2) Is it advisable to delete complete history along with SC ?
Thanks
Kapil
Hi Kapil,
* Convert header structure to the type expected by 'BBP_PD_PO_UPDATE'
MOVE-CORRESPONDING ls_header_import TO ls_po_header_u.
ls_po_header_u-zzdeleted_doc = 'X'.
* Convert item structure to the type expected by 'BBP_PD_SC_UPDATE'
LOOP AT lt_item ASSIGNING <fs_item>.
APPEND INITIAL LINE TO lt_update_item ASSIGNING <fs_update_item>.
MOVE-CORRESPONDING <fs_item> TO <fs_update_item>.
<fs_update_item>-del_ind = 'X'.
ENDLOOP.
CLEAR lt_messages.
* Update Shopping Cart
CALL FUNCTION 'BBP_PD_PO_UPDATE'
EXPORTING
i_header = ls_po_header_u
i_save = 'X'
iv_with_change_approval = ' '
IMPORTING
e_changed = lv_changed
TABLES
i_item = lt_update_item
e_messages = lt_messages.
CALL FUNCTION 'BBP_PD_PO_SAVE'
EXPORTING
iv_header_guid = ls_po_header_u-guid.
COMMIT WORK.
* Convert item structure to the type expected by 'BBP_PD_SC_UPDATE'
LOOP AT lt_item ASSIGNING <fs_item>.
APPEND INITIAL LINE TO lt_update_item ASSIGNING <fs_update_item>.
MOVE-CORRESPONDING <fs_item> TO <fs_update_item>.
<fs_update_item>-del_ind = 'X'.
READ TABLE lt_status WITH KEY p_guid = <fs_item>-guid
stat = 'I1113'
TRANSPORTING NO FIELDS.
IF sy-subrc IS INITIAL.
READ TABLE lt_status WITH KEY p_guid = <fs_item>-guid
stat = 'I1115'
inact = ' '
TRANSPORTING NO FIELDS.
IF sy-subrc IS NOT INITIAL.
lv_fdoc_error = 'X'.
ENDIF.
ENDIF.
ENDLOOP.
* Update Shopping Cart
CALL FUNCTION 'BBP_PD_SC_UPDATE'
EXPORTING
i_header = ls_po_header_u
i_save = 'X'
iv_with_change_approval = ' '
IMPORTING
e_changed = lv_changed
TABLES
i_item = lt_update_item
e_messages = lt_messages.
CALL FUNCTION 'BBP_PD_SC_SAVE'
EXPORTING
iv_header_guid = ls_po_header_u-guid.
Regards,
Ronen Ravansari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kapit,
1. What is the purpose of deleting the SC if the PO is available ?
2. You can archive the documents with preceeding one.
regards,
Kannan B
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kapit,
Answering your questions:
1) You can't modify a SC with a follow on document, you can delete the follow on document of the SC and reuse it for other sourcing. Or, if you have a complete circuit of follow on document, you can archive it.
2) There is not a standard option to do this, but you can develop a custom program that do it.
Best Regards,
Emanuel.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kapit,
just move it to archive
Regards
Konstantin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.