9 Replies Latest reply: May 17, 2012 6:08 AM by DAYAL ROY RSS

Final Invoice checkbox changed with BBP_PD_PO_UPDATE

jorgelina cadorin
Currently Being Moderated

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.

Actions