SAP Function Modules

AD1C_PROF_READ SAP Function module







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

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


Pattern for FM AD1C_PROF_READ - AD1C PROF READ





CALL FUNCTION 'AD1C_PROF_READ' "
  EXPORTING
    i_profnr =                  " ad01c_prof-profnr
    i_usage =                   " ad01c_prof-dpus
*   i_flag_no_buffer = SPACE    " sy-batch
*   i_flag_all_chars = SPACE    " boole_d
  IMPORTING
    e_prof =                    " ad01c_prof
* TABLES
*   et_fields =                 " ad01fields
*   et_sel =                    " ad01c_sel
*   et_sela =                   " ad01c_sela
*   et_selr =                   " ad01_selr
*   et_mat =                    " ad01c_mat
*   et_mata =                   " ad01c_mata
*   et_matr =                   " ad01_matr
  EXCEPTIONS
    INPUT_ERROR = 1             "
    PROF_NOT_FOUND = 2          "
    .  "  AD1C_PROF_READ

ABAP code example for Function Module AD1C_PROF_READ





The ABAP code below is a full code listing to execute function module AD1C_PROF_READ 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_prof  TYPE AD01C_PROF ,
it_et_fields  TYPE STANDARD TABLE OF AD01FIELDS,"TABLES PARAM
wa_et_fields  LIKE LINE OF it_et_fields ,
it_et_sel  TYPE STANDARD TABLE OF AD01C_SEL,"TABLES PARAM
wa_et_sel  LIKE LINE OF it_et_sel ,
it_et_sela  TYPE STANDARD TABLE OF AD01C_SELA,"TABLES PARAM
wa_et_sela  LIKE LINE OF it_et_sela ,
it_et_selr  TYPE STANDARD TABLE OF AD01_SELR,"TABLES PARAM
wa_et_selr  LIKE LINE OF it_et_selr ,
it_et_mat  TYPE STANDARD TABLE OF AD01C_MAT,"TABLES PARAM
wa_et_mat  LIKE LINE OF it_et_mat ,
it_et_mata  TYPE STANDARD TABLE OF AD01C_MATA,"TABLES PARAM
wa_et_mata  LIKE LINE OF it_et_mata ,
it_et_matr  TYPE STANDARD TABLE OF AD01_MATR,"TABLES PARAM
wa_et_matr  LIKE LINE OF it_et_matr .


SELECT single PROFNR
FROM AD01C_PROF
INTO @DATA(ld_i_profnr).


SELECT single DPUS
FROM AD01C_PROF
INTO @DATA(ld_i_usage).

DATA(ld_i_flag_no_buffer) = 'some text here'.
DATA(ld_i_flag_all_chars) = 'some text here'.

"populate fields of struture and append to itab
append wa_et_fields to it_et_fields.

"populate fields of struture and append to itab
append wa_et_sel to it_et_sel.

"populate fields of struture and append to itab
append wa_et_sela to it_et_sela.

"populate fields of struture and append to itab
append wa_et_selr to it_et_selr.

"populate fields of struture and append to itab
append wa_et_mat to it_et_mat.

"populate fields of struture and append to itab
append wa_et_mata to it_et_mata.

"populate fields of struture and append to itab
append wa_et_matr to it_et_matr. . CALL FUNCTION 'AD1C_PROF_READ' EXPORTING i_profnr = ld_i_profnr i_usage = ld_i_usage * i_flag_no_buffer = ld_i_flag_no_buffer * i_flag_all_chars = ld_i_flag_all_chars IMPORTING e_prof = ld_e_prof * TABLES * et_fields = it_et_fields * et_sel = it_et_sel * et_sela = it_et_sela * et_selr = it_et_selr * et_mat = it_et_mat * et_mata = it_et_mata * et_matr = it_et_matr EXCEPTIONS INPUT_ERROR = 1 PROF_NOT_FOUND = 2 . " AD1C_PROF_READ
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_e_prof  TYPE AD01C_PROF ,
ld_i_profnr  TYPE AD01C_PROF-PROFNR ,
it_et_fields  TYPE STANDARD TABLE OF AD01FIELDS ,
wa_et_fields  LIKE LINE OF it_et_fields,
ld_i_usage  TYPE AD01C_PROF-DPUS ,
it_et_sel  TYPE STANDARD TABLE OF AD01C_SEL ,
wa_et_sel  LIKE LINE OF it_et_sel,
ld_i_flag_no_buffer  TYPE SY-BATCH ,
it_et_sela  TYPE STANDARD TABLE OF AD01C_SELA ,
wa_et_sela  LIKE LINE OF it_et_sela,
ld_i_flag_all_chars  TYPE BOOLE_D ,
it_et_selr  TYPE STANDARD TABLE OF AD01_SELR ,
wa_et_selr  LIKE LINE OF it_et_selr,
it_et_mat  TYPE STANDARD TABLE OF AD01C_MAT ,
wa_et_mat  LIKE LINE OF it_et_mat,
it_et_mata  TYPE STANDARD TABLE OF AD01C_MATA ,
wa_et_mata  LIKE LINE OF it_et_mata,
it_et_matr  TYPE STANDARD TABLE OF AD01_MATR ,
wa_et_matr  LIKE LINE OF it_et_matr.


SELECT single PROFNR
FROM AD01C_PROF
INTO ld_i_profnr.


"populate fields of struture and append to itab
append wa_et_fields to it_et_fields.

SELECT single DPUS
FROM AD01C_PROF
INTO ld_i_usage.


"populate fields of struture and append to itab
append wa_et_sel to it_et_sel.
ld_i_flag_no_buffer = 'some text here'.

"populate fields of struture and append to itab
append wa_et_sela to it_et_sela.
ld_i_flag_all_chars = 'some text here'.

"populate fields of struture and append to itab
append wa_et_selr to it_et_selr.

"populate fields of struture and append to itab
append wa_et_mat to it_et_mat.

"populate fields of struture and append to itab
append wa_et_mata to it_et_mata.

"populate fields of struture and append to itab
append wa_et_matr to it_et_matr.

SAP Documentation for FM AD1C_PROF_READ


Reading settings for creation, reading and processing dynamical line items from a dynamical line item customizing profile. ...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 AD1C_PROF_READ or its description.