on 2008 Nov 24 3:41 AM
Hi!!
I'm trying to change the final_inv and final_entry fields using the BBP_PD_PO_UPDATE but I can't see my changes!..
Here is my code!
CALL FUNCTION 'BBP_PD_PO_GETDETAIL'
EXPORTING
i_object_id = t_file-ebeln
i_with_itemdata = 'X'
IMPORTING
e_header = e_header_tab
TABLES
e_item = e_item_tab
e_messages = lt_e_messages.
tHE CODE BELOW IS CAUSE I'M INTO A LOOP OF ITEMS
READ TABLE e_item_tab INTO e_item_tab_aux
WITH KEY number_int = t_file-ebelp.
IF sy-subrc EQ 0.
APPEND e_item_tab_aux.
ELSE.
CLEAR e_item_tab_aux.
ENDIF.
READ TABLE e_header_tab INDEX 1.
MOVE-CORRESPONDING e_header_tab TO i_header_tab.
APPEND i_header_tab.
move the items details to be modified.
LOOP AT e_item_tab_aux.
MOVE-CORRESPONDING e_item_tab_aux TO i_item_tab.
move the Final invoice flag and Comp Delivery flag data.
i_item_tab-final_inv = 'X'.
i_item_tab-final_entry = 'X'.
APPEND i_item_tab.
ENDLOOP.
DATA: i_changed TYPE xfeld,
i_header LIKE bbp_pds_po_header_d.
CALL FUNCTION 'BBP_PD_PO_UPDATE'
EXPORTING
I_PARK = 'X'
i_header = i_header_tab
IMPORTING
e_changed = i_changed
es_header = i_header
TABLES
i_item = i_item_tab
e_messages = i_messages
.
IF NOT i_changed IS INITIAL.
CALL FUNCTION 'BBP_PD_PO_SAVE'
EXPORTING
iv_header_guid = i_header_tab-guid.
CALL FUNCTION 'BBP_PROCDOC_RESET_BUFFER'.
COMMIT WORK AND WAIT.
ENDIF.
THE MESSAGES TABLE RETURNS EMPTY.
and everything seems to be fine but I can't se the changes in the BBP_PDIGP table.
do someone have an idea?
thanks.
Take a look at SAP Include LBBP_PDIGPF14 where those flags are set:
mix up final entry/ invoice ind for change versions (very complicated)
IF p_object_type EQ c_po.
CASE new_itmigp-final_entry.
WHEN c_on OR c_off.
new_itmigp-final_entry = old_itmigp-final_entry.
WHEN gc_unchecked_manually OR gc_checked_manually.
keep it
WHEN gc_to_set.
new_itmigp-final_entry = c_on.
WHEN gc_to_delete.
new_itmigp-final_entry = c_off.
WHEN OTHERS.
PERFORM abort.
ENDCASE.
CASE new_itmigp-final_inv.
WHEN c_on OR c_off.
new_itmigp-final_inv = old_itmigp-final_inv.
WHEN gc_unchecked_manually OR gc_checked_manually.
keep it
WHEN gc_to_set.
new_itmigp-final_inv = c_on.
WHEN gc_to_delete.
new_itmigp-final_inv = c_off.
WHEN OTHERS.
PERFORM abort.
ENDCASE.
ENDIF.
If you want to set the Final_Inv or Final_Entry flags, you need to send 'S' in as the value to set the switch. Your logic is sending an 'X'.
I realize this forum is pretty old, but in case anybody else comes across this issue of setting these flags via the BBP_PD_PO_UPDATE FM I wanted to post the answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael,
This is Dayal .
I was trying to to use below FM to update Final_Inv and Final_Entry as test sequence
BBP_PD_PO_UPDATE with I_ITEM-FINAL_INV = S and I_ITEM-FINAL_ENTRY =S (as per your suggestion)
BBP_PD_PO_SAVE
BAPI_TRANSACTION_COMMIT
after running the FM , doesn't return any error messge.
But not able to update the BBP_PDIGP-FINAL_INV and BBP_PDIGP-FINAL_ENTRY where as other value we can update.
Am I missing something.
Regards
Dayal
Hi Michael,
This is Dayal .
I was trying to to use below FM to update Final_Inv and Final_Entry as test sequence
BBP_PD_PO_UPDATE with I_ITEM-FINAL_INV = S and I_ITEM-FINAL_ENTRY =S (as per your suggestion)
BBP_PD_PO_SAVE
BAPI_TRANSACTION_COMMIT
after running the FM , doesn't return any error messge.
But not able to update the BBP_PDIGP-FINAL_INV and BBP_PDIGP-FINAL_ENTRY where as other value we can update.
Am I missing something.
Regards
Dayal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.