SAP Function Modules

WPOCP_SAVE_CHANGED_PO_DATA SAP Function module - Saves Changed PO Items







WPOCP_SAVE_CHANGED_PO_DATA is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name WPOCP_SAVE_CHANGED_PO_DATA into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: WPOCP
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM WPOCP_SAVE_CHANGED_PO_DATA - WPOCP SAVE CHANGED PO DATA





CALL FUNCTION 'WPOCP_SAVE_CHANGED_PO_DATA' "Saves Changed PO Items
* EXPORTING
*   i_do_commit = ' '           " xfeld         Checkbox
*   i_check_data_only = 0       " i             Checkbox
*   i_items_per_process = 1000  " i
  TABLES
    changing_headers =          " wpocp_change_header  Change PO Header Data
    changing_items =            " wpocp_change_item  Change PO Item Data
*   i_ekko =                    " ekko          Purchasing Document Header
*   i_ekpo =                    " ekpo          Purchasing Document Item
    e_error_messages =          " wpocp_error_message  Error Message
  EXCEPTIONS
    ERROR_IN_APPLICATION = 1    "               Error in Application
    ERROR_IN_DATA = 2           "               Eror in Data (Validation Function)
    .  "  WPOCP_SAVE_CHANGED_PO_DATA

ABAP code example for Function Module WPOCP_SAVE_CHANGED_PO_DATA





The ABAP code below is a full code listing to execute function module WPOCP_SAVE_CHANGED_PO_DATA including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
it_changing_headers  TYPE STANDARD TABLE OF WPOCP_CHANGE_HEADER,"TABLES PARAM
wa_changing_headers  LIKE LINE OF it_changing_headers ,
it_changing_items  TYPE STANDARD TABLE OF WPOCP_CHANGE_ITEM,"TABLES PARAM
wa_changing_items  LIKE LINE OF it_changing_items ,
it_i_ekko  TYPE STANDARD TABLE OF EKKO,"TABLES PARAM
wa_i_ekko  LIKE LINE OF it_i_ekko ,
it_i_ekpo  TYPE STANDARD TABLE OF EKPO,"TABLES PARAM
wa_i_ekpo  LIKE LINE OF it_i_ekpo ,
it_e_error_messages  TYPE STANDARD TABLE OF WPOCP_ERROR_MESSAGE,"TABLES PARAM
wa_e_error_messages  LIKE LINE OF it_e_error_messages .

DATA(ld_i_do_commit) = 'Check type of data required'.
DATA(ld_i_check_data_only) = 'Check type of data required'.
DATA(ld_i_items_per_process) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_changing_headers to it_changing_headers.

"populate fields of struture and append to itab
append wa_changing_items to it_changing_items.

"populate fields of struture and append to itab
append wa_i_ekko to it_i_ekko.

"populate fields of struture and append to itab
append wa_i_ekpo to it_i_ekpo.

"populate fields of struture and append to itab
append wa_e_error_messages to it_e_error_messages. . CALL FUNCTION 'WPOCP_SAVE_CHANGED_PO_DATA' * EXPORTING * i_do_commit = ld_i_do_commit * i_check_data_only = ld_i_check_data_only * i_items_per_process = ld_i_items_per_process TABLES changing_headers = it_changing_headers changing_items = it_changing_items * i_ekko = it_i_ekko * i_ekpo = it_i_ekpo e_error_messages = it_e_error_messages EXCEPTIONS ERROR_IN_APPLICATION = 1 ERROR_IN_DATA = 2 . " WPOCP_SAVE_CHANGED_PO_DATA
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_i_do_commit  TYPE XFELD ,
it_changing_headers  TYPE STANDARD TABLE OF WPOCP_CHANGE_HEADER ,
wa_changing_headers  LIKE LINE OF it_changing_headers,
ld_i_check_data_only  TYPE I ,
it_changing_items  TYPE STANDARD TABLE OF WPOCP_CHANGE_ITEM ,
wa_changing_items  LIKE LINE OF it_changing_items,
ld_i_items_per_process  TYPE I ,
it_i_ekko  TYPE STANDARD TABLE OF EKKO ,
wa_i_ekko  LIKE LINE OF it_i_ekko,
it_i_ekpo  TYPE STANDARD TABLE OF EKPO ,
wa_i_ekpo  LIKE LINE OF it_i_ekpo,
it_e_error_messages  TYPE STANDARD TABLE OF WPOCP_ERROR_MESSAGE ,
wa_e_error_messages  LIKE LINE OF it_e_error_messages.

ld_i_do_commit = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_changing_headers to it_changing_headers.
ld_i_check_data_only = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_changing_items to it_changing_items.
ld_i_items_per_process = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_i_ekko to it_i_ekko.

"populate fields of struture and append to itab
append wa_i_ekpo to it_i_ekpo.

"populate fields of struture and append to itab
append wa_e_error_messages to it_e_error_messages.

SAP Documentation for FM WPOCP_SAVE_CHANGED_PO_DATA


This function module changes purchase order data.
Header data and item data can be changed. ...See here for full SAP fm documentation

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name WPOCP_SAVE_CHANGED_PO_DATA or its description.