cancel
Showing results for 
Search instead for 
Did you mean: 

Final Invoice checkbox changed with BBP_PD_PO_UPDATE

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (2)

Answers (2)

michael_saulo2
Discoverer
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

hi!!! I did another test and worked!

Into the i_item_tab-DESCRIPTION field I passed 'Jorgelina'. and was saved.

this description is in CRMD_ORDERADM_I table while the FINAL_INV and FINAL_ENTRY fields are in table BBP_PDIGP.

I tried with another field in the BBP_PDIGP table ans was chaged!!!!

Any idea?

Former Member
0 Kudos

Maybe some bug?

Note 1267916 - PO item flags do not stay checked

That might point you in the right direction.

Regards,

Robin

Former Member
0 Kudos

Thanks for this! But this note is already applied and it is not working!

Some other suggestion?

Former Member
0 Kudos

Hi jorgelina,

did you manage to get this working? I'm facing the exact same issue here. would like to know how you might have solve the problem

regards

Harpal

Former Member
0 Kudos

yes I did!. I don´t have the code here but I think the only different thing I´ve done is

change

i_item_tab-final_inv = 'X'.

i_item_tab-final_entry = 'X'.

to

i_item_tab-final_inv = 'C'.

i_item_tab-final_entry = 'C.

Please try with this.

Good luck.

Jorgelina

Former Member
0 Kudos

Hi Jorgelina - Thanks so much for sharing this information.

I am coding a program to do exactly the same thing. Do you mind pasting the code that eventually worked?

Best Regards,

Mark

SreekanthKrishn
Contributor
0 Kudos

HI Mark/harpal/Ina,

I am also facing the same issue.

Is there any other change that you have done in the code given by Ina other than

making the final_invoice and final entry to 'C'.

Any pointers will be highly useful.

Thanks in advance,

Sreekanth