SAP Function Modules

FC_CREATE_AUTOM_LINES SAP Function module







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

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


Pattern for FM FC_CREATE_AUTOM_LINES - FC CREATE AUTOM LINES





CALL FUNCTION 'FC_CREATE_AUTOM_LINES' "
  EXPORTING
    e_dimen =                   " ecmca-rdimen  Dimension
    e_docty =                   " ecmca-docty   Document type
    e_doc_count =               " sy-index      Number of document lines after processing
    e_itclg =                   " ecmca-ritclg  FS chart of accounts
    e_poper =                   " ecmca-poper   Posting period
    e_rvers =                   " ecmca-rvers   Version
    e_ryear =                   " ecmca-ryear   Fiscal year
  IMPORTING
    i_doc_count =               " sy-index      Number of document line items before processing
    i_subrc =                   " sy-subrc      Return code whether auto lines available
  TABLES
    it_postab =                 " fc05ptab      Table of document line items
*   it_msgtab =                 " fc05_t_message
  EXCEPTIONS
    NO_ENTRY_TF140 = 1          "               No selected items defined
    MAX_DOC_LINES = 2           "               Maximum number of document line items
    WRONG_APPLIED_IND = 3       "               Wrong where-applied indicator
    MISSING_ITEMS = 4           "               Items missing for deferred income taxes
    .  "  FC_CREATE_AUTOM_LINES

ABAP code example for Function Module FC_CREATE_AUTOM_LINES





The ABAP code below is a full code listing to execute function module FC_CREATE_AUTOM_LINES 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_i_doc_count  TYPE SY-INDEX ,
ld_i_subrc  TYPE SY-SUBRC ,
it_it_postab  TYPE STANDARD TABLE OF FC05PTAB,"TABLES PARAM
wa_it_postab  LIKE LINE OF it_it_postab ,
it_it_msgtab  TYPE STANDARD TABLE OF FC05_T_MESSAGE,"TABLES PARAM
wa_it_msgtab  LIKE LINE OF it_it_msgtab .


SELECT single RDIMEN
FROM ECMCA
INTO @DATA(ld_e_dimen).


SELECT single DOCTY
FROM ECMCA
INTO @DATA(ld_e_docty).

DATA(ld_e_doc_count) = '123 '.

SELECT single RITCLG
FROM ECMCA
INTO @DATA(ld_e_itclg).


SELECT single POPER
FROM ECMCA
INTO @DATA(ld_e_poper).


SELECT single RVERS
FROM ECMCA
INTO @DATA(ld_e_rvers).


SELECT single RYEAR
FROM ECMCA
INTO @DATA(ld_e_ryear).


"populate fields of struture and append to itab
append wa_it_postab to it_it_postab.

"populate fields of struture and append to itab
append wa_it_msgtab to it_it_msgtab. . CALL FUNCTION 'FC_CREATE_AUTOM_LINES' EXPORTING e_dimen = ld_e_dimen e_docty = ld_e_docty e_doc_count = ld_e_doc_count e_itclg = ld_e_itclg e_poper = ld_e_poper e_rvers = ld_e_rvers e_ryear = ld_e_ryear IMPORTING i_doc_count = ld_i_doc_count i_subrc = ld_i_subrc TABLES it_postab = it_it_postab * it_msgtab = it_it_msgtab EXCEPTIONS NO_ENTRY_TF140 = 1 MAX_DOC_LINES = 2 WRONG_APPLIED_IND = 3 MISSING_ITEMS = 4 . " FC_CREATE_AUTOM_LINES
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 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_doc_count  TYPE SY-INDEX ,
ld_e_dimen  TYPE ECMCA-RDIMEN ,
it_it_postab  TYPE STANDARD TABLE OF FC05PTAB ,
wa_it_postab  LIKE LINE OF it_it_postab,
ld_i_subrc  TYPE SY-SUBRC ,
ld_e_docty  TYPE ECMCA-DOCTY ,
it_it_msgtab  TYPE STANDARD TABLE OF FC05_T_MESSAGE ,
wa_it_msgtab  LIKE LINE OF it_it_msgtab,
ld_e_doc_count  TYPE SY-INDEX ,
ld_e_itclg  TYPE ECMCA-RITCLG ,
ld_e_poper  TYPE ECMCA-POPER ,
ld_e_rvers  TYPE ECMCA-RVERS ,
ld_e_ryear  TYPE ECMCA-RYEAR .


SELECT single RDIMEN
FROM ECMCA
INTO ld_e_dimen.


"populate fields of struture and append to itab
append wa_it_postab to it_it_postab.

SELECT single DOCTY
FROM ECMCA
INTO ld_e_docty.


"populate fields of struture and append to itab
append wa_it_msgtab to it_it_msgtab.
ld_e_doc_count = '123 '.

SELECT single RITCLG
FROM ECMCA
INTO ld_e_itclg.


SELECT single POPER
FROM ECMCA
INTO ld_e_poper.


SELECT single RVERS
FROM ECMCA
INTO ld_e_rvers.


SELECT single RYEAR
FROM ECMCA
INTO ld_e_ryear.

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