SAP Function Modules

W_APPOINTMENT_CREATE_PO SAP Function module







W_APPOINTMENT_CREATE_PO 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 W_APPOINTMENT_CREATE_PO into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: WAP0
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM W_APPOINTMENT_CREATE_PO - W APPOINTMENT CREATE PO





CALL FUNCTION 'W_APPOINTMENT_CREATE_PO' "
  EXPORTING
    i_ekko =                    " ekko          Purchasing Document
*   i_commit =                  " rwap1-selkz
*   i_doc_update =              " rwap1-selkz
*   i_sync =                    " rwap1-selkz   Synchronous Posting
  IMPORTING
    e_wappt =                   " wappt
  TABLES
    t_ekpo =                    " ekpo          Purchasing Document Items
    t_eket =                    " eket          Purchasing Document Delivery Schedule
    t_ekes =                    " ekes
  EXCEPTIONS
    NO_DATA_RECEIVED = 1        "
    WRONG_PO_TYPE = 2           "
    APPOINTMENT_DUPLICATE = 3   "
    MULTIPLE_WAREHOUSE = 4      "
    NO_WAREHOUSE = 5            "
    CUSTOMIZING_ERROR = 6       "               Error in customizing
    MULTIPLE_DELIVERY_DATES = 7  "
    PO_NOT_ALLOWED = 8          "
    NO_APPOINTMENT_CREATED = 9  "
    PO_DELETED = 10             "
    CONFIRMATION_ERROR = 11     "
    NO_AUTHORITY = 12           "
    .  "  W_APPOINTMENT_CREATE_PO

ABAP code example for Function Module W_APPOINTMENT_CREATE_PO





The ABAP code below is a full code listing to execute function module W_APPOINTMENT_CREATE_PO 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:
ld_e_wappt  TYPE WAPPT ,
it_t_ekpo  TYPE STANDARD TABLE OF EKPO,"TABLES PARAM
wa_t_ekpo  LIKE LINE OF it_t_ekpo ,
it_t_eket  TYPE STANDARD TABLE OF EKET,"TABLES PARAM
wa_t_eket  LIKE LINE OF it_t_eket ,
it_t_ekes  TYPE STANDARD TABLE OF EKES,"TABLES PARAM
wa_t_ekes  LIKE LINE OF it_t_ekes .

DATA(ld_i_ekko) = 'Check type of data required'.

DATA(ld_i_commit) = some text here

DATA(ld_i_doc_update) = some text here

DATA(ld_i_sync) = some text here

"populate fields of struture and append to itab
append wa_t_ekpo to it_t_ekpo.

"populate fields of struture and append to itab
append wa_t_eket to it_t_eket.

"populate fields of struture and append to itab
append wa_t_ekes to it_t_ekes. . CALL FUNCTION 'W_APPOINTMENT_CREATE_PO' EXPORTING i_ekko = ld_i_ekko * i_commit = ld_i_commit * i_doc_update = ld_i_doc_update * i_sync = ld_i_sync IMPORTING e_wappt = ld_e_wappt TABLES t_ekpo = it_t_ekpo t_eket = it_t_eket t_ekes = it_t_ekes EXCEPTIONS NO_DATA_RECEIVED = 1 WRONG_PO_TYPE = 2 APPOINTMENT_DUPLICATE = 3 MULTIPLE_WAREHOUSE = 4 NO_WAREHOUSE = 5 CUSTOMIZING_ERROR = 6 MULTIPLE_DELIVERY_DATES = 7 PO_NOT_ALLOWED = 8 NO_APPOINTMENT_CREATED = 9 PO_DELETED = 10 CONFIRMATION_ERROR = 11 NO_AUTHORITY = 12 . " W_APPOINTMENT_CREATE_PO
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 ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 8. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 9. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 10. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 11. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 12. "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_e_wappt  TYPE WAPPT ,
ld_i_ekko  TYPE EKKO ,
it_t_ekpo  TYPE STANDARD TABLE OF EKPO ,
wa_t_ekpo  LIKE LINE OF it_t_ekpo,
ld_i_commit  TYPE RWAP1-SELKZ ,
it_t_eket  TYPE STANDARD TABLE OF EKET ,
wa_t_eket  LIKE LINE OF it_t_eket,
ld_i_doc_update  TYPE RWAP1-SELKZ ,
it_t_ekes  TYPE STANDARD TABLE OF EKES ,
wa_t_ekes  LIKE LINE OF it_t_ekes,
ld_i_sync  TYPE RWAP1-SELKZ .

ld_i_ekko = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_ekpo to it_t_ekpo.

ld_i_commit = some text here

"populate fields of struture and append to itab
append wa_t_eket to it_t_eket.

ld_i_doc_update = some text here

"populate fields of struture and append to itab
append wa_t_ekes to it_t_ekes.

ld_i_sync = some text here

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 W_APPOINTMENT_CREATE_PO or its description.