SAP Function Modules

IDOC_CREATE_COPCPA SAP Function module







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

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


Pattern for FM IDOC_CREATE_COPCPA - IDOC CREATE COPCPA





CALL FUNCTION 'IDOC_CREATE_COPCPA' "
  EXPORTING
    rcvpfc =                    " bdaledc-rcvpfc  Recipient - Partner function
    rcvprn =                    " bdaledc-rcvprn  Recipient - Partner number
    rcvprt =                    " bdaledc-rcvprt  Recipient - Partner type
    sndpfc =                    " bdaledc-sndpfc  Sender - Partner function
    sndprn =                    " bdaledc-sndprn  Sender - Partner number
    sndprt =                    " bdaledc-sndprt  Sender - Partner type
*   flg_no_commit = SPACE       " xflag
  IMPORTING
    count =                     " sy-tabix      Number of basic IDocs generated
    created_comm_idocs =        " sy-tabix      Number of communication IDocs generated
  TABLES
    t_matnr =                   "               Range for materials
    t_werks =                   "               Range for plants
    t_klvar =                   "               Range for costing variants
    t_tvers =                   "               Range for costing version
    t_status =                  "               Range for status
    t_kadat =                   "               Range for costing date (from)
    t_bidat =                   "               Range for expiry date
    t_kkzma =                   "               Range for maual costing
    t_kalkl =                   "               Range for on-going standard costing
    t_kalaid =                  "
    t_kaladat =                 "
*   t_keko_extern =             " keko
*   et_comm_docum =             " tswotobjid
    .  "  IDOC_CREATE_COPCPA

ABAP code example for Function Module IDOC_CREATE_COPCPA





The ABAP code below is a full code listing to execute function module IDOC_CREATE_COPCPA 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_count  TYPE SY-TABIX ,
ld_created_comm_idocs  TYPE SY-TABIX ,
it_t_matnr  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_t_matnr  LIKE LINE OF it_t_matnr ,
it_t_werks  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_t_werks  LIKE LINE OF it_t_werks ,
it_t_klvar  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_t_klvar  LIKE LINE OF it_t_klvar ,
it_t_tvers  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_t_tvers  LIKE LINE OF it_t_tvers ,
it_t_status  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_t_status  LIKE LINE OF it_t_status ,
it_t_kadat  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_t_kadat  LIKE LINE OF it_t_kadat ,
it_t_bidat  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_t_bidat  LIKE LINE OF it_t_bidat ,
it_t_kkzma  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_t_kkzma  LIKE LINE OF it_t_kkzma ,
it_t_kalkl  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_t_kalkl  LIKE LINE OF it_t_kalkl ,
it_t_kalaid  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_t_kalaid  LIKE LINE OF it_t_kalaid ,
it_t_kaladat  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_t_kaladat  LIKE LINE OF it_t_kaladat ,
it_t_keko_extern  TYPE STANDARD TABLE OF KEKO,"TABLES PARAM
wa_t_keko_extern  LIKE LINE OF it_t_keko_extern ,
it_et_comm_docum  TYPE STANDARD TABLE OF TSWOTOBJID,"TABLES PARAM
wa_et_comm_docum  LIKE LINE OF it_et_comm_docum .


DATA(ld_rcvpfc) = some text here

DATA(ld_rcvprn) = some text here

DATA(ld_rcvprt) = some text here

DATA(ld_sndpfc) = some text here

DATA(ld_sndprn) = some text here

DATA(ld_sndprt) = some text here
DATA(ld_flg_no_commit) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_matnr to it_t_matnr.

"populate fields of struture and append to itab
append wa_t_werks to it_t_werks.

"populate fields of struture and append to itab
append wa_t_klvar to it_t_klvar.

"populate fields of struture and append to itab
append wa_t_tvers to it_t_tvers.

"populate fields of struture and append to itab
append wa_t_status to it_t_status.

"populate fields of struture and append to itab
append wa_t_kadat to it_t_kadat.

"populate fields of struture and append to itab
append wa_t_bidat to it_t_bidat.

"populate fields of struture and append to itab
append wa_t_kkzma to it_t_kkzma.

"populate fields of struture and append to itab
append wa_t_kalkl to it_t_kalkl.

"populate fields of struture and append to itab
append wa_t_kalaid to it_t_kalaid.

"populate fields of struture and append to itab
append wa_t_kaladat to it_t_kaladat.

"populate fields of struture and append to itab
append wa_t_keko_extern to it_t_keko_extern.

"populate fields of struture and append to itab
append wa_et_comm_docum to it_et_comm_docum. . CALL FUNCTION 'IDOC_CREATE_COPCPA' EXPORTING rcvpfc = ld_rcvpfc rcvprn = ld_rcvprn rcvprt = ld_rcvprt sndpfc = ld_sndpfc sndprn = ld_sndprn sndprt = ld_sndprt * flg_no_commit = ld_flg_no_commit IMPORTING count = ld_count created_comm_idocs = ld_created_comm_idocs TABLES t_matnr = it_t_matnr t_werks = it_t_werks t_klvar = it_t_klvar t_tvers = it_t_tvers t_status = it_t_status t_kadat = it_t_kadat t_bidat = it_t_bidat t_kkzma = it_t_kkzma t_kalkl = it_t_kalkl t_kalaid = it_t_kalaid t_kaladat = it_t_kaladat * t_keko_extern = it_t_keko_extern * et_comm_docum = it_et_comm_docum . " IDOC_CREATE_COPCPA
IF SY-SUBRC EQ 0. "All OK 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_count  TYPE SY-TABIX ,
ld_rcvpfc  TYPE BDALEDC-RCVPFC ,
it_t_matnr  TYPE STANDARD TABLE OF STRING ,
wa_t_matnr  LIKE LINE OF it_t_matnr,
it_t_werks  TYPE STANDARD TABLE OF STRING ,
wa_t_werks  LIKE LINE OF it_t_werks,
ld_rcvprn  TYPE BDALEDC-RCVPRN ,
ld_created_comm_idocs  TYPE SY-TABIX ,
ld_rcvprt  TYPE BDALEDC-RCVPRT ,
it_t_klvar  TYPE STANDARD TABLE OF STRING ,
wa_t_klvar  LIKE LINE OF it_t_klvar,
ld_sndpfc  TYPE BDALEDC-SNDPFC ,
it_t_tvers  TYPE STANDARD TABLE OF STRING ,
wa_t_tvers  LIKE LINE OF it_t_tvers,
ld_sndprn  TYPE BDALEDC-SNDPRN ,
it_t_status  TYPE STANDARD TABLE OF STRING ,
wa_t_status  LIKE LINE OF it_t_status,
ld_sndprt  TYPE BDALEDC-SNDPRT ,
it_t_kadat  TYPE STANDARD TABLE OF STRING ,
wa_t_kadat  LIKE LINE OF it_t_kadat,
ld_flg_no_commit  TYPE XFLAG ,
it_t_bidat  TYPE STANDARD TABLE OF STRING ,
wa_t_bidat  LIKE LINE OF it_t_bidat,
it_t_kkzma  TYPE STANDARD TABLE OF STRING ,
wa_t_kkzma  LIKE LINE OF it_t_kkzma,
it_t_kalkl  TYPE STANDARD TABLE OF STRING ,
wa_t_kalkl  LIKE LINE OF it_t_kalkl,
it_t_kalaid  TYPE STANDARD TABLE OF STRING ,
wa_t_kalaid  LIKE LINE OF it_t_kalaid,
it_t_kaladat  TYPE STANDARD TABLE OF STRING ,
wa_t_kaladat  LIKE LINE OF it_t_kaladat,
it_t_keko_extern  TYPE STANDARD TABLE OF KEKO ,
wa_t_keko_extern  LIKE LINE OF it_t_keko_extern,
it_et_comm_docum  TYPE STANDARD TABLE OF TSWOTOBJID ,
wa_et_comm_docum  LIKE LINE OF it_et_comm_docum.


ld_rcvpfc = some text here

"populate fields of struture and append to itab
append wa_t_matnr to it_t_matnr.

"populate fields of struture and append to itab
append wa_t_werks to it_t_werks.

ld_rcvprn = some text here

ld_rcvprt = some text here

"populate fields of struture and append to itab
append wa_t_klvar to it_t_klvar.

ld_sndpfc = some text here

"populate fields of struture and append to itab
append wa_t_tvers to it_t_tvers.

ld_sndprn = some text here

"populate fields of struture and append to itab
append wa_t_status to it_t_status.

ld_sndprt = some text here

"populate fields of struture and append to itab
append wa_t_kadat to it_t_kadat.
ld_flg_no_commit = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_t_bidat to it_t_bidat.

"populate fields of struture and append to itab
append wa_t_kkzma to it_t_kkzma.

"populate fields of struture and append to itab
append wa_t_kalkl to it_t_kalkl.

"populate fields of struture and append to itab
append wa_t_kalaid to it_t_kalaid.

"populate fields of struture and append to itab
append wa_t_kaladat to it_t_kaladat.

"populate fields of struture and append to itab
append wa_t_keko_extern to it_t_keko_extern.

"populate fields of struture and append to itab
append wa_et_comm_docum to it_et_comm_docum.

SAP Documentation for FM IDOC_CREATE_COPCPA


The corresponding costings are sought for the given ranges. Using the given costing values, the corresponding IDOCs are generated and ...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 IDOC_CREATE_COPCPA or its description.