BAPI to change purchase order to put deletion flag

Hello Guru's,
        We are about to archive data & for that we need that according to date range all open purchase order ,open purchase requsitions & open RFQ should be marked for deletion.
Is there some BAPI to do so.Please guide.

*DELETING FLAG *
REPORT ZMMR_DELETEPO NO STANDARD PAGE HEADING MESSAGE-ID zisb.
tables : zvtls_sap.
*C-- Types Declarations
TYPES : BEGIN OF tp_flatfile_vtls,
        ebeln(10),
        ebelp type ekpo-ebelp,
        END OF tp_flatfile_vtls.
*=====================================================================
                  INTERNAL TABLES DECLARATION
*=====================================================================
DATA:  t_flatfile_vtls TYPE tp_flatfile_vtls OCCURS 0 WITH HEADER LINE.
data : begin of t_sapdata occurs 0,
       po like zvtls_sap-posap,
       item like zvtls_sap-itemsap,
       end of t_sapdata.
data : begin of t_flatfile_vtls1 occurs 0,
       po(10),
       item like zvtls_sap-itemsap,
       end of t_flatfile_vtls1.
data : begin of t_update occurs 0,
       mandt like zvtls_sap-mandt,
       povtls like zvtls_sap-povtls,
       itemvtls like zvtls_sap-itemvtls,
       posap like zvtls_sap-posap,
       itemsap like zvtls_sap-itemsap,
       aedat like zvtls_sap-aedat,
       paedt like zvtls_sap-paedt,
       loekz like zvtls_sap-loekz,
       end of t_update.
data : begin of t_poheader occurs 0,
       po like zvtls_sap-posap,
       end of t_poheader.
data : begin of t_poitem occurs 0,
       po like zvtls_sap-posap,
       item like zvtls_sap-itemsap,
       end of t_poitem.
DATA : BEGIN OF T_MESSAGE OCCURS 0,
       MSGTY,
       MSGID(2),
       MSGNO(3),
       MSGTX(100),
       PO like zvtls_sap-povtls,
       item like zvtls_sap-itemvtls,
       END OF T_MESSAGE.
DATA : BEGIN OF t_bapi_poheader OCCURS 0.
        INCLUDE STRUCTURE bapimepoheader.
DATA : END OF t_bapi_poheader.
DATA : BEGIN OF t_bapi_poheaderx OCCURS 0.
        INCLUDE STRUCTURE bapimepoheaderx.
DATA : END OF t_bapi_poheaderx.
DATA : BEGIN OF t_bapi_poitem OCCURS 0.
        INCLUDE STRUCTURE bapimepoitem.
DATA : END OF t_bapi_poitem.
DATA : BEGIN OF t_bapi_poitemx OCCURS 0.
        INCLUDE STRUCTURE bapimepoitemx.
DATA : END OF t_bapi_poitemx.
DATA : BEGIN OF t_bapireturn OCCURS 0.
        INCLUDE STRUCTURE bapiret2.
DATA : END OF t_bapireturn.
*=====================================================================
                  V A R I A B L E S
*=====================================================================
DATA: w_success(6)  TYPE n,
      w_bklas like t023-bklas,
      w_curryear(4),
      w_begda like sy-datum,
      w_endda like sy-datum,
      w_begyr(4),
      w_endyr(4),
      w_currmon(2),
      w_assetclass like ankt-anlkl,
      w_price type p,
      w_recordsap type i,
      w_povtls(10),
      w_count type i.
DATA:  w_filepath TYPE rlgrap-filename,
       w_rc TYPE sy-subrc,
       w_sscrfields_ucomm1   TYPE sscrfields-ucomm,
       w_file1 TYPE string,
       w_file2 TYPE FILENAME-FILEINTERN.
*=====================================================================
                  C O N S T A N T S
*=====================================================================
CONSTANTS: c_x              TYPE  c         VALUE 'X',
           c_hyp            TYPE  c         VALUE '-',
           c_err            TYPE  bdc_mart  VALUE 'E'.
CONSTANTS:  c_slash(1)            TYPE c VALUE '/',
            c_hash(1)             TYPE c VALUE '#',
            c_pipe                TYPE c VALUE '|',
            c_1                   TYPE i VALUE 1,
            c_zero                TYPE n VALUE '0',
            c_rg1(3)              TYPE c VALUE 'rg1',
            c_gr3(3)              TYPE c VALUE 'GR3',
            c_gr2(3)              TYPE c VALUE 'GR2',
            c_e(1)                TYPE c VALUE 'E',
            c_filepath(8)         TYPE c VALUE '/interf/',
            c_filetype(10)        TYPE c VALUE 'ASC'.
CONSTANTS : c_bapimepoheaderx   TYPE x030l-tabname
                               VALUE 'bapimepoheaderx',
           c_bapimepoitem      TYPE  x030l-tabname
                               VALUE 'bapimepoitem',
           c_bapimepoaccount   TYPE  x030l-tabname
                               VALUE 'bapimepoaccount',
           c_t_bapi_poheader(15)        TYPE c
                                        VALUE 't_bapi_poheader',
           c_t_bapi_poitem(13)          TYPE c
                                        VALUE 't_bapi_poitem',
           c_t_bapi_poitemx(14)         TYPE c
                                        VALUE 't_bapi_poitemx',
           c_t_bapi_poheaderx(16)       TYPE c
                                        VALUE 't_bapi_poheaderx'.
CLASS cl_abap_char_utilities DEFINITION LOAD.
CONSTANTS:con_tab  TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
*======================================================================
                       SELECTION SCREEN
*======================================================================
SELECTION-SCREEN BEGIN OF BLOCK inputpath WITH FRAME TITLE text-001.
SELECTION-SCREEN : BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
PARAMETERS : p_fore RADIOBUTTON GROUP rg1
                    USER-COMMAND pc,
             p_back RADIOBUTTON GROUP rg1 DEFAULT 'X'.
SELECTION-SCREEN : END OF BLOCK blk2.
SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-003.
PARAMETERS :  p_file1 LIKE rlgrap-filename OBLIGATORY MODIF ID gr2.
PARAMETERS :  p_afile1 LIKE rlgrap-filename OBLIGATORY MODIF ID gr3.
SELECTION-SCREEN : END OF BLOCK blk1.
SELECTION-SCREEN END OF BLOCK inputpath.
*C-- Initialization Event
INITIALIZATION.
  CLEAR w_filepath.
  CONCATENATE c_filepath sy-sysid c_slash sy-mandt c_slash INTO
  w_filepath.
  CONDENSE w_filepath NO-GAPS.
  p_file1 = text-008.
  p_afile1 = text-009.
*======================================================================
                       SELECTION SCREEN EVENTS
*======================================================================
*C-- Selection Screen Output
AT SELECTION-SCREEN OUTPUT.
  IF p_fore = c_x.
    w_sscrfields_ucomm1 = space.
  ELSE.
    w_sscrfields_ucomm1 = c_rg1.
  ENDIF.
  LOOP AT SCREEN.
*C--Modify selection screen if presentation
*C--or application server radio button is chosen
    IF w_sscrfields_ucomm1 = space.
      IF screen-group1 = c_gr3.
        screen-active = c_zero.
      ENDIF.
    ELSE.
      IF screen-group1 = c_gr2.
        screen-active = c_zero.
      ENDIF.
    ENDIF.
    if screen-name = 'P_AFILE1'.
      screen-input = 0.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.
*C-- Selection Screen VALUE-REQUEST FOR File path
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
  IF p_fore EQ c_x.
    CALL FUNCTION 'F4_FILENAME'
      EXPORTING
        program_name  = syst-cprog
        dynpro_number = syst-dynnr
      IMPORTING
        file_name     = p_file1.
  ENDIF.
*C-- At Start of the Selection Process
START-OF-SELECTION.
  IF p_fore EQ c_x.
    w_file1 = p_file1.
  ELSE.
    w_file2 = p_afile1.
  ENDIF.
  IF p_fore EQ c_x. " Presentaion Server
*C--Validations for the input files
    PERFORM validate_pre_file USING p_file1.
*C-- Load the contents of the input file into the internal table
    PERFORM upload_file TABLES t_flatfile_vtls
                        USING w_file1
                        CHANGING w_rc.
    IF w_rc <> 0.
      MESSAGE s006 DISPLAY LIKE c_e.
    ENDIF.
  ELSE. " Application Server
*C--Validations for the input files
    PERFORM validate_app_file USING  w_file2.
*C-- Load the contents of the input file into the internal table
    PERFORM upload_file_app TABLES t_flatfile_vtls
                            USING w_file2
                            CHANGING w_rc.
  ENDIF.
  loop at t_flatfile_vtls.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = t_flatfile_vtls-ebeln
      IMPORTING
        output = t_flatfile_vtls1-po.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = t_flatfile_vtls-ebelp
      IMPORTING
        output = t_flatfile_vtls1-item.
    append t_flatfile_vtls1.
    clear t_flatfile_vtls1.
  endloop.
  perform get_podata.
  loop at t_poheader.
    perform move_to_bapi.
    perform call_bapi.
  endloop.
  PERFORM STORE_MESSAGES TABLES T_MESSAGE.
*&      Form  validate_pre_file
    Routine to validate presentation server file path.
     -->fp_name  text
FORM validate_pre_file USING fp_name TYPE rlgrap-filename.
  DATA : l_result,
         l_filename TYPE string.
  l_filename = fp_name.
  CLEAR l_result.
  CALL METHOD cl_gui_frontend_services=>file_exist
    EXPORTING
      file                 = l_filename
    RECEIVING
      result               = l_result
    EXCEPTIONS
      cntl_error           = 1
      error_no_gui         = 2
      wrong_parameter      = 3
      not_supported_by_gui = 4
      OTHERS               = 5.
  IF sy-subrc <> 0.
    MESSAGE s007 DISPLAY LIKE c_e.
    LEAVE LIST-PROCESSING.
  ELSEIF l_result IS INITIAL.
    MESSAGE s008 DISPLAY LIKE c_e.
    LEAVE LIST-PROCESSING.
  ENDIF.
ENDFORM.                    " validate_pre_file_hdr
*&      Form  validate_app_file
      text - Checks if the path entered and filename is correct
FORM validate_app_file USING  fp_file  TYPE FILENAME-FILEINTERN.
  data : l_fname(60).
  CALL FUNCTION 'FILE_GET_NAME'
    EXPORTING
      LOGICAL_FILENAME = FP_FILE
      OPERATING_SYSTEM = SY-OPSYS
    IMPORTING
      FILE_NAME        = L_FNAME
    EXCEPTIONS
      FILE_NOT_FOUND   = 1
      OTHERS           = 2.
  IF SY-SUBRC = '0'.
    OPEN DATASET  L_FNAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
      MESSAGE s007 DISPLAY LIKE c_e.
    ELSE.
      CLOSE DATASET l_fname.
    ENDIF.
  ENDIF.
ENDFORM.                    " validate_app_file
*&      Form  upload_file
      Routine to upload data from file to tables.
     -->P_fp_flatfile
     -->P_fp_file
     <--P_fp_rc
FORM  upload_file TABLES   fp_flatfile
                  USING    fp_file TYPE string
                  CHANGING fp_rc TYPE sy-subrc.
  IF fp_flatfile[] IS INITIAL.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                = fp_file
        filetype                = c_filetype
        has_field_separator     = c_x
      TABLES
        data_tab                = fp_flatfile
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        OTHERS                  = 17.
    MOVE sy-subrc TO fp_rc.
  ENDIF.
ENDFORM.  " upload_file
*&      Form  upload_file_app
      text
     -->FP_FLATFILEtext
     -->FP_FILE    text
     -->FP_RC      text
FORM  upload_file_app TABLES   fp_flatfile
                      USING    fp_file TYPE FILENAME-FILEINTERN
CHANGING fp_rc TYPE sy-subrc.
  DATA: l_string TYPE tedata-data.
  DATA: wa_data_file TYPE tp_flatfile_vtls,
        l_wllength TYPE i,
        FNAME(60).
  CALL FUNCTION 'FILE_GET_NAME'
    EXPORTING
      LOGICAL_FILENAME = FP_FILE
      OPERATING_SYSTEM = SY-OPSYS
    IMPORTING
      FILE_NAME        = FNAME
    EXCEPTIONS
      FILE_NOT_FOUND   = 1
      OTHERS           = 2.
  IF SY-SUBRC = 0.
    OPEN DATASET  FNAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
*C-- commented by Bikash
     MESSAGE s107(yaero_ps) DISPLAY LIKE c_e.
      message e008.
    ELSE.
      DO.
        CLEAR: l_string.
        READ DATASET  FNAME INTO l_string LENGTH l_wllength.
        IF sy-subrc NE 0.
          EXIT.
        ELSE.
          SPLIT l_string AT con_tab INTO   wa_data_file-ebeln
                                           wa_data_file-ebelp.
          APPEND wa_data_file TO fp_flatfile.
        ENDIF.
      ENDDO.
      CLOSE DATASET  FNAME.
    ENDIF.
  ENDIF.
ENDFORM.  " upload_file_app
*&      Form  get_podata
      text
form get_podata.
  select *
  into table t_update
  from zvtls_sap
  for all entries in t_flatfile_vtls1
   where itemvtls = t_flatfile_vtls1-item
  and povtls = t_flatfile_vtls1-po.
  sort t_update by posap itemsap.
  loop at t_update.
    at new posap.
      t_poheader-po = t_update-posap.
      append t_poheader.
      clear t_poheader.
    endat.
    t_poitem-po = t_update-posap.
    t_poitem-item = t_update-itemsap.
    append t_poitem.
    clear t_poitem.
    t_update-paedt = sy-datum.
    t_update-loekz = 'X'.
    modify t_update.
  endloop.
  modify zvtls_sap from table t_update.
endform.                    "get_podata
*&      Form  move_to_bapi
      text
form move_to_bapi.
  t_bapi_poheader-po_number = t_poheader-po.
  CLEAR t_bapi_poheaderx.
  PERFORM fill_check_structure USING c_bapimepoheaderx
                                     c_t_bapi_poheader
                                     c_t_bapi_poheaderx
                                     c_x.
  refresh : t_bapi_poitem,t_bapi_poitemx.
  loop at t_poitem where po = t_poheader-po.
    clear t_bapi_poitem.
    t_bapi_poitem-po_item = t_poitem-item.
    t_bapi_poitem-delete_ind = 'X'.
    CLEAR t_bapi_poitemx.
    PERFORM fill_check_structure USING c_bapimepoitem
                                       c_t_bapi_poitem
                                       c_t_bapi_poitemx
                                       c_x.
    t_bapi_poitemx-po_item = t_poitem-item.
    t_bapi_poitemx-po_itemx = c_x.
    APPEND t_bapi_poitem.
    APPEND t_bapi_poitemx.
    clear t_bapi_poitem.
    clear t_bapi_poitemx.
  endloop.
endform.                    "move_to_bapi
*&      Form  call_bapi
      This form Routine is used to commit the data records
FORM call_bapi .
  DATA : l_msgty      TYPE c,
         l_msgid(2)   TYPE c,
         l_msgno(3)   TYPE c,
         l_msgtx(100) TYPE c,
         l_errflag    TYPE c.
  CLEAR: t_bapireturn.
  REFRESH: t_bapireturn.
  *CALL FUNCTION 'BAPI_PO_CHANGE'*
    EXPORTING
      PURCHASEORDER = T_POHEADER-PO
      POHEADER      = T_BAPI_POHEADER
      POHEADERX     = T_BAPI_POHEADERX
    TABLES
      RETURN        = T_BAPIRETURN
      POITEM        = T_BAPI_POITEM
      POITEMX       = T_BAPI_POITEMX.
  READ TABLE t_bapireturn WITH KEY type = c_err TRANSPORTING NO FIELDS.
  IF sy-subrc NE 0.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait = c_x.
  ENDIF.
*C-- Write messages
  WRITE: / 'PO Number', t_poheader-po.
  clear : t_update,w_povtls.
  read table t_update with key posap = t_poheader-po.
  w_povtls = t_update-povtls.
  CLEAR l_errflag.
  LOOP AT t_bapireturn.
    CLEAR: l_msgty, l_msgid, l_msgno, l_msgtx.
    l_msgty = t_bapireturn-type.
    l_msgid = t_bapireturn-id.
    l_msgno = t_bapireturn-number.
    l_msgtx = t_bapireturn-message.
    WRITE: / l_msgty, l_msgid, l_msgno, l_msgtx.
    if l_msgtx cs t_poheader-po.
      w_count = w_count + 1.
      loop at t_update.
        if sy-tabix = w_count.
          t_message-item = t_update-itemvtls.
        endif.
      endloop.
    endif.
    t_message-msgty = l_msgty.
    t_message-msgid = l_msgid.
    t_message-msgno = l_msgno.
    t_message-msgtx = l_msgtx.
    t_message-po = w_povtls.
    append t_message.
    clear t_message.
    IF l_msgty EQ c_err.
      l_errflag = c_x.
    ENDIF.    " l_msgty EQ 'E'
  ENDLOOP.
  ULINE.
  IF l_errflag NE c_x.
    w_success = w_success + 1.
  ENDIF.    " l_errflag NE C_X
endform.                    "call_bapi
*&      Form  fill_check_structure
      This form Routine will check whether the specified structure
      exist/active
FORM fill_check_structure  USING    fp_tabname TYPE any
                                    fp_orgtabname TYPE any
                                    fp_chktabname TYPE any
                                    fp_check TYPE c.
  FIELD-SYMBOLS : <fs_chk>, <fs_org>.
  DATA:    l_char1(61)  TYPE c,
           l_char2(61)  TYPE c.
  DATA:    BEGIN OF tl_nametab OCCURS 60.
          INCLUDE STRUCTURE x031l.
  DATA:    END OF tl_nametab.
  REFRESH tl_nametab.
  CALL FUNCTION 'RFC_GET_NAMETAB'
    EXPORTING
      tabname          = fp_tabname
    TABLES
      nametab          = tl_nametab
    EXCEPTIONS
      table_not_active = 1
      OTHERS           = 2.
  IF sy-subrc <> 0.
    CLEAR tl_nametab.
  ENDIF.
  LOOP AT tl_nametab.
    CLEAR: l_char1, l_char2.
    CONCATENATE fp_chktabname c_hyp tl_nametab-fieldname INTO l_char1.
    ASSIGN (l_char1) TO <fs_chk>.
    CONCATENATE fp_orgtabname c_hyp tl_nametab-fieldname INTO l_char2.
    ASSIGN (l_char2) TO <fs_org>.
    IF <fs_org> IS NOT INITIAL.
      <fs_chk> = fp_check.
    ENDIF.
  ENDLOOP.
ENDFORM.                    " fill_check_structure
*&      Form  STORE_MESSAGES
      text
     -->FP_MESSAGEStext
FORM STORE_MESSAGES TABLES FP_MESSAGES STRUCTURE T_MESSAGE.
  DATA: wl_output_data LIKE t_MESSAGE.
  DATA: l_catstr TYPE string.
  DATA: l_fieldvalue TYPE string.
  DATA: l_index TYPE i VALUE 1.
  DATA: L_FNAME(60).
  FIELD-SYMBOLS <fs>.
  CLEAR l_catstr.
  CALL FUNCTION 'FILE_GET_NAME'
    EXPORTING
      LOGICAL_FILENAME = '/USR/SAP/VTLS/POCHANGE/LOG'
      OPERATING_SYSTEM = SY-OPSYS
    IMPORTING
      FILE_NAME        = L_FNAME
    EXCEPTIONS
      FILE_NOT_FOUND   = 1
      OTHERS           = 2.
  IF SY-SUBRC = '0'.
    IF fp_messages[] IS NOT INITIAL.
      OPEN DATASET L_FNAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc NE 0.
        LEAVE LIST-PROCESSING.
      ELSE.
        LOOP AT fp_messages INTO wl_output_data.
          DO.
           ASSIGN COMPONENT l_index OF STRUCTURE wl_output_data TO <fs>.
            IF sy-subrc <> 0.
              EXIT.
            ENDIF.
            MOVE <fs> TO l_fieldvalue.
            IF l_catstr IS NOT INITIAL.
              CONCATENATE l_catstr l_fieldvalue INTO l_catstr SEPARATED
              BY con_tab.
            ELSE.
              MOVE l_fieldvalue TO l_catstr.
            ENDIF.
            l_index = l_index + c_1.
            CLEAR l_fieldvalue.
            CLEAR <fs>.
          ENDDO.
          l_index = c_1.
          TRANSFER l_catstr TO L_FNAME .
          CLEAR wl_output_data.
          CLEAR l_catstr.
        ENDLOOP.
        CLOSE  DATASET L_FNAME.
      ENDIF.
    ENDIF.
  ENDIF.
ENDFORM.                    "STORE_MESSAGES

Similar Messages

  • LSMW issue using BAPI for changing Purchase Order G/L Account

    Wonder if anyone can help as I'm tearing my hair out!!
    Have used LSMW lots of times using the transaction recorder, but tried using a BAPI as we have a mass update to do of G/L Accounts for Purchase Orders and it seems the tidiest and most efficient way to do it.
    Got my LSMW project working as a test by changing the Short Text on a purchase order, this works fine.  However, when I add the Account Assignment details in (Structure E1BPMEPOACCOUNT and E1BPMEACCOUNTX) everything seems to run fine, the IDOC posts and gives message 'Document xxx changed'.  Yet when I look into the order it hasn't actually changed the G/L.
    If I go into the purchase order in change mode in another session and run the LSMW again it recognises the purchase order is locked so it seems to be doing everything right, just not updating the G/L Account field.  Anyone got any ideas ? It updated the short text fine so I'm sure everything is set up OK but for some reason it ignores the G/L that I upload.  Anything relating to the Account Assignment (Unloading Point, GR, Cost Center) just gets ignored if I try and upload a change.
    I seem to be so close it seems a shame not to be able to get it sorted !!!
    Thanks,

    Helen Smith wrote:
    HI Praveen,
    >
    > Thank you very much for your response.  I tested the BAPI as per yor instructions and the return message comes back 'Eng & other PO xxxx changed' so it seems to indicate a success message again (like the LSMW does) but the actual data doesn't update.
    >
    > I thought I'd found it as I searched OSS and found note  0001382965 which seemed exactly my problem.  I imported it and applied it but yet I still get the same issue - LSMW runs, says app doc posted and purchase order has been saved but no Account Assignment field will update.
    >
    > So it seems as if it's the BAPI not doing what it should - so I'm considering logging with SAPNET just to see if they can help as getting desperate with this one now! Felt sure I had it sorted when I found that note!
    >
    > Thanks
    >
    > Helen
    >
    > ** I should add I also ran the test above altering something in the item detail (the short text) - and that worked and updated.  So it still seems to point to the Account Assignment part of the BAPI not updating.
    >
    > Edited by: Helen Smith on Nov 2, 2010 4:35 PM
    Hi Helen,
    Just wondering whether you have found solution to your issue.
    We also encounter the same issue and have implemented the note without any positive result.
    Please share if you found the solution.
    Thank you.
    Abraham

  • BAPI or FM for changing Purchase Order

    Hi,
    Does anybody know a BAPI or FM to change Purchase Order item details. I looked for  a BAPI but only found for creating and listing.
    thanks.

    I think this is becuase the BAPI for PO change has not been "released". If you use transaction BAPI, then click the filter button, then select "All", the PO change bapi will appear int he MM-> purchasing-> purchase order hierarchy. (BAPI_PO_CHANGE)
    Although it is not officially "released", neither is the function module to do the same task. We use the BAPI on a regular basis, and it works fine. I think unreleased just means you will get no support if you use it, and SAP can change it at any time.
    I am not sure what makes a BAPI go from un-released to released...

  • Mass change on production order (assembly type) to put deletion flag status

    Dear all,
    I've make a mass change on production orders to settle the status DLFL through the Tcode CO78.
    Some of the production orders  are "assembly order" type. Those could not be up-dated with the DLFL because there are linked to customer order. The customers orders are closed.
    What can I do to change the status for this kind of production orders. It is necessary for me to be able to put the DLFL status in order to improve the process of production closure done each month.

    Hi kiran 
    Thanks for the response. As I cannot put deletion indicator on the Assembly order directly, Do we have to put deletion indicator on the sales order item?. If so, Can we put a deletion indicator after the sales order was delivered and invoiced. What exactly have you guys done to put deletion flag on the production order.

  • PURCHASE ORDER STATUS :When Deleting ALL ITEMS.

    Hi experts,
    I need  to make purchase order status stay  " Release Compleated " when deleting all items.
    Anyone Know How to do it?
    Or anyone Know how to use BAPI_PO_CHANGE in BAdI : ME_PROCESS_PO_CUST 
    In my project , I use Release Strategy of purchase orders, and there is a case of deleting all items.
    In this situation, purchase order status returns to "Active " and release strategy tab disappears.
    This is our problem.
    I need to make purchase order status stay  " Release Compleated " and prevent  release strategy tab disappearing.
    I tried to update the fields EREKZ(final invoice) and ELIKZ(delivery completed) in
    BAdI : ME_PROCESS_PO_CUST  Method : PROCESS_ITEM using BAPI_PO_CHANGE according to SAP Note 456691.
    But BAPI_PO_CHANGE couldn't update EREKZ because of our customize , and I couldn't find how to use
    BAPI_PO_CHANGE in the BAdI.
    Anyone know solutions to solve this problem?
    Thanks a lot.
    Regards,
    TKD

    Hi,
    please review the following information in SAP Note No. 456691 as
    copied below:
    18. Question:
    When are the header conditions updated if a purchase order item is
    deleted?
    Answer:
    If a purchase order item is deleted, the item is marked as 'statistical'
    (field EKPO-STAPO = X) and the change is reflected in the header
    conditions.
    However, if for the item the final invoice indicator(EKPO-EREKZ) or the
    inward delivery completed indicator (EKPO-ELIKZ) is set, the item is not
    marked as 'statistical' (EKPO-STAPO is not set) and thus the header
    conditions are not updated.
    I hope this helps you
    BR
    Nadia Orlandi

  • Production order gets automat. deletion flag if a change in sales order hap

    Dear friends,
    I have the problem that there is a change in the sales order ( for example the customer) and then the already existing production order receives a deletion flag wich cannot be done undo.
    For example, we receive a request for a sales and we create a sales order. Afterwards, we will create the sales order with the customer who gave us the request. Then we can directly start with the Engineering, purchasing and so on. After a period of time, it happens that the "real" customer is know. So, each sales order line item will be deliverd to another customer. This can be relevant for the export control if the customers are located in different countries.
    At the time of adding or chanign the new customer and saving the already existing production order will receive the deletion flag.
    For me this situation is strange as I would not expect that the production order would receive a deletion flag only because a change in the sales order occurs.
    Can please anyone help!?
    Thank you very much,
    Bjoern

    Dear Friends,
    thank you very much.
    I found the problem and this is actually a funtionality comming from the export control checks. I forwarded this to our export control specialist as I dont see this as a production theme.
    The problem was, that the customer was changed and it was a different country. In this case the export control was activated and the online check was not sucsessfull. In this case a production is not allowed anymore and the system directly deletes the production order independing in which status the order is.
    Interesting function.
    Thank you all!

  • Production order gets automat. deletion flag if a change in sales order ha

    Dear friends,
    I have the problem that there is a change in the sales order ( for example the customer) and then the already existing production order receives a deletion flag wich cannot be done undo.
    For example, we receive a request for a sales and we create a sales order. Afterwards, we will create the sales order with the customer who gave us the request. Then we can directly start with the Engineering, purchasing and so on. After a period of time, it happens that the "real" customer is know. So, each sales order line item will be deliverd to another customer. This can be relevant for the export control if the customers are located in different countries.
    At the time of adding or chanign the new customer and saving the already existing production order will receive the deletion flag.
    For me this situation is strange as I would not expect that the production order would receive a deletion flag only because a change in the sales order occurs.
    Can please anyone help!?
    Thank you very much,
    Bjoern

    Dear Friends,
    thank you very much.
    I found the problem and this is actually a funtionality comming from the export control checks. I forwarded this to our export control specialist as I dont see this as a production theme.
    The problem was, that the customer was changed and it was a different country. In this case the export control was activated and the online check was not sucsessfull. In this case a production is not allowed anymore and the system directly deletes the production order independing in which status the order is.
    Interesting function.
    Thank you all!

  • Possibilities for changing purchase order print behavior

    Hello guys,
    I'm kind of new in SAP MM and I had to deal with PDF formula for purchase order. Now I have some questions about what is possible to change behavior for printing data in purchase order print.
    First of all we're using our own PDF formula which is a little bit like standard formula MEDRUCK_PO. We're using programm SAPFM06P with routine ADOBE_ENTRY_NEU, no changes in SAP standard behavior were made.
    Everyhting works fine with that but we sometimes have some special cases where our user wants some other behavior. Can you please say if it is possible and if so where to do that? (Customizing, formula itself)
    1. Changes in purchase order positions -> We have for example 4 purchase order positions. Now for one of them the price has changed. When printing formula then, you only see the changed order position. When you want to see all, user has to change some detail in every of the other positions, thats pretty annoying.
    2. Header text 'Changes in purchase order' -> Sometimes the header text is displayed as 'Changes in purchase order', sometimes as "normal" 'Purchase order'. I know it has something to do with status (field DRUVO) of purchase order, but its not clear when which status is set. Any help? :-)
    3. Deleted positions -> How is the standard behavior when a position is deleted? I think it will not be listed anymore in the positions printout. Anyway I can control it by catching LOEKZ field. But how is it with the total value field in sum data. I think it still is the whole value including the deleted positions. Is this changeable?
    I know there is some customizing in SPRO -> Materials Management -> Purchasing -> Messages
    but I'm not quite sure how it works :-(
    Can anyone enlight me? :-)
    Thanks a lot.
    Regards
    Michael

    SAP can differentiate between a new created purchase order and an existing purchase order that only got changed.
    Based on that it can be customized whether you print the full purchase order or only the part that was changed, and accordingly you may get different texts on your form (... 'Changes in purchase order', sometimes as "normal" 'Purchase order'.)
    A deletion of a PO item  is as well a change.  If you decided to print only a change message, then you get a print having the item number and a text *** item deleted *** or similar based on your customizing.
    But if you decided to print the full PO in both cases (creation and change), then you get the full PO but the deleted item is no longer among them and no hint either that it was deleted..
    Basically this setting is made in SPRO -> Materials Management -> Purchasing -> Messages -> Output Control -> Message Types -> Define Message Types for Purchase Order
    see as well the wiki: Printing of purchasing documents - ERP SCM - SCN Wiki

  • Adding a new check box in change purchase order screen

    Hi
      I have to add one custom field a check in the screen for change purchase order in EBP.
    We are using ITS.
    Kindly advice.
    Thanks and Regards
    Manoj

    Hello Manoj,
    you can define Customer Fields (CUF) at header, item, accounting level on any document type (including PO).
    Adding seach fields acts as old ABAP method of table append, i.e. those fields are stored in standard SRM tables. So you can process your own logic and checks against those fields.
    There is a BADI to control the display or not, the input or not, the default or input values.
    There is a BADI to control the ergonomy of CUF (by default they are added one after the other after standard fields).
    There have been many posts about CUF and linked OSS notes explaining own it works and which includes to use.
    Rgds
    Christophe

  • How to change purchase order's cost center in batch

    Dear all :
    how to change purchase order's cost center in batch?

    Dear Manish :
    thanks so much for you reply.
    the filed which i wanted to change it's content is cost center (KOSTL) in table EKKN.
    i couldn't find it in this t-code when i select fields.

  • I want to change Purchase Order Print

    I want to change Purchase Order Print. I want to add the name who has done last change in Purchase Order. Please help.

    You no need to add the changes, It can be shown in Environment menu. If u want to see the person who changed the PO in ur Print, ABAP work will be required..
    By the way what is the business requirement for this. B'cas PO is meant for vendor, Why do u want to print, whoever did the changes..This thing you can see from SAP itself at anytime.
    Cheers!
    ***Reward If useful (RIU)

  • No Authorization to change Purchase Order for Professional Purchaser

    Hi Experts, I am facing the following issue,
    System Info :
    SRM 5.0
    ECC 6.0
    IE 6.0
    I logged in as the professional Purchaser in to My SAP SRM browser and when I try to change a Direct material purchase order, I get the following message:
    No Authorization to change Purchase Order xxxxxxxxxxx.
    Here is my sequence of operations:
    Logged in as Proff Purchaser, selected the process purchase order link, then selected the purchase order from  the worklist and click on the change icon.
    Please let me know if need to customize any settings.
    Thanks in advance,
    Raj

    hi,
       In trascn PFCG,for the role of Startegic purchaser,under the Personalization tab,set the attribute  BBP_WFL_SECURITY to '4'.Also,check the authorisation data for the Strategic purchaser role.
    HTH.
    BR,
    Disha.
    Pls reward points for useful answers.

  • BAPI to Reject purchase order

    Hi All
    Kindly let us know if there is any  BAPI to Reject purchase order  (ME29N)
    Thanks

    Hi,
    Try this,
    BAPI_PO_RELEASE
    see the below link for more help.
    Re: BAPI to reject PO (like ME29N functionality to reject PO)
    Regards,
    Vijay

  • BAPI for Mass Purchase Order Confirmation

    Dear All,
    In standard SAP,it is possible to confirm for single line item only by using confirmation tab.
    We want to confirm Mass PO Confirmation.
    Is there any BAPI for Mass Purchase Order Confirmation?
    Regards,
    Ramesh

    Hi Sumant,
    I have tried with TC:MASS.
    By using this TC we can update quantity but not  delivery date & Confirmation Control (Fields available in the confirmation tab of ME22n for Vendor Confirmation).
    Is there any way to updates all these fields which are available in the Confirmation Tab?
    Is there any BAPI which is tranferring confirmation tab details into EKES table?
    Expecting your valuable inputs in this regard.
    Regards,
    Ramesh

  • Report on changed Purchase order

    Dear group Members
    Warm greetings
    I am not finding a standard report where i can view list of all changed purchase orders
    help me to find this report, i will be very thankful to you
    regards
    shamul heq

    hii Shamu
    In standard SAP , there is no reports particularly for ammendment Po list.
    But individual PO u can see the chages happened in that PO's one by one.
    GO to ME23N , the go to environment, then header chages  here u can find the list of changes happened in PO.
    If u need the report , u can create custom report with help of technical consultant.
    Thanks
    SAp-MM
    Edited by: MM group on Feb 25, 2010 5:29 AM

Maybe you are looking for

  • Why does Apple Mail window default to wrong monitor?

    I have two 30" Apple monitors with a MacPro 3.2 GHz Quad-Core Intel Xeon running Mavericks. In previous systems I would have my Apple Mail open on the second monitor. Since Mavericks nothing I do will let Mail open anywhere but in its default positio

  • No audio on TV when using HDMI

    Hello, I just bought the Satellite P875-S7200 and I connected it to my HDTV using HDMI. The problem is there is no sound coming out on the TV but there is sound on the laptop. I've checked the Playback Devices when you right-click the speaker icon fr

  • Form Personalization - calling stored procedure attached in the form/library

    Let said we have a form: OEXOEORD.fmb (Sales order form) Using Form Builder to open it, we see that it links to other PL/SQl Libraries such as OEXOELIN (file: OEXOELIN.pll) and there are many stored procedures in OEXOELIN. is that possible that in th

  • Email addresses as parameters.

    Hi, I know this should really be in the SQL forum-but it is SQL in BIP, so I thought I would try it here first! I have a report with a parameter for an email address, the parameter is referenced within the sql statement as a variable (&p_email_addres

  • Trying to update 14.2 but it says I have to close photoshop exe

    Trying to update 14.2 but it says i have to close photoshopcc exe