SAP Function Modules

CNVCF_PROGRAM_READ SAP Function module - copy of RPY_PROGRAM_READ from IDT







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

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


Pattern for FM CNVCF_PROGRAM_READ - CNVCF PROGRAM READ





CALL FUNCTION 'CNVCF_PROGRAM_READ' "copy of RPY_PROGRAM_READ from IDT
  EXPORTING
*   language = SY-LANGU         " sy-langu      R/3 System, current language
    program_name =              " rpy_prog-progname  ABAP program name
*   with_includelist = 'X'      " rglif-with_incl  Flag for listing all includes
*   only_source = ' '           " rglif-only_sourc  Flag: Read only source
*   only_texts = ' '            " rglif-only_texts  Flag: Read only text elements for a program
*   read_latest_version = SPACE  " progdir-state  ABAP/4 program status (active, saved, transported...)
*   with_lowercase = ' '        " rglif-lowercase  Lowercase letters allowed/not allowed
  IMPORTING
    prog_inf =                  " rpy_prog      Structure for programs
* TABLES
*   include_tab =               " rpy_repo      INCLUDEs/reports with title
*   source =                    " cnvc_scwb_abaptxt255  Source Table
*   source_extended =           " cnvc_scwb_abaptxt255  ABAP Text Line with Length 255
*   textelements =              " textpool      ABAP Text Pool Definition
  EXCEPTIONS
    CANCELLED = 1               "
    NOT_FOUND = 2               "
    PERMISSION_ERROR = 3        "
    .  "  CNVCF_PROGRAM_READ

ABAP code example for Function Module CNVCF_PROGRAM_READ





The ABAP code below is a full code listing to execute function module CNVCF_PROGRAM_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_prog_inf  TYPE RPY_PROG ,
it_include_tab  TYPE STANDARD TABLE OF RPY_REPO,"TABLES PARAM
wa_include_tab  LIKE LINE OF it_include_tab ,
it_source  TYPE STANDARD TABLE OF CNVC_SCWB_ABAPTXT255,"TABLES PARAM
wa_source  LIKE LINE OF it_source ,
it_source_extended  TYPE STANDARD TABLE OF CNVC_SCWB_ABAPTXT255,"TABLES PARAM
wa_source_extended  LIKE LINE OF it_source_extended ,
it_textelements  TYPE STANDARD TABLE OF TEXTPOOL,"TABLES PARAM
wa_textelements  LIKE LINE OF it_textelements .

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

DATA(ld_program_name) = some text here

DATA(ld_with_includelist) = some text here

DATA(ld_only_source) = some text here

DATA(ld_only_texts) = some text here

SELECT single STATE
FROM PROGDIR
INTO @DATA(ld_read_latest_version).


DATA(ld_with_lowercase) = some text here

"populate fields of struture and append to itab
append wa_include_tab to it_include_tab.

"populate fields of struture and append to itab
append wa_source to it_source.

"populate fields of struture and append to itab
append wa_source_extended to it_source_extended.

"populate fields of struture and append to itab
append wa_textelements to it_textelements. . CALL FUNCTION 'CNVCF_PROGRAM_READ' EXPORTING * language = ld_language program_name = ld_program_name * with_includelist = ld_with_includelist * only_source = ld_only_source * only_texts = ld_only_texts * read_latest_version = ld_read_latest_version * with_lowercase = ld_with_lowercase IMPORTING prog_inf = ld_prog_inf * TABLES * include_tab = it_include_tab * source = it_source * source_extended = it_source_extended * textelements = it_textelements EXCEPTIONS CANCELLED = 1 NOT_FOUND = 2 PERMISSION_ERROR = 3 . " CNVCF_PROGRAM_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 ELSEIF SY-SUBRC EQ 3. "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_prog_inf  TYPE RPY_PROG ,
ld_language  TYPE SY-LANGU ,
it_include_tab  TYPE STANDARD TABLE OF RPY_REPO ,
wa_include_tab  LIKE LINE OF it_include_tab,
ld_program_name  TYPE RPY_PROG-PROGNAME ,
it_source  TYPE STANDARD TABLE OF CNVC_SCWB_ABAPTXT255 ,
wa_source  LIKE LINE OF it_source,
ld_with_includelist  TYPE RGLIF-WITH_INCL ,
it_source_extended  TYPE STANDARD TABLE OF CNVC_SCWB_ABAPTXT255 ,
wa_source_extended  LIKE LINE OF it_source_extended,
ld_only_source  TYPE RGLIF-ONLY_SOURC ,
it_textelements  TYPE STANDARD TABLE OF TEXTPOOL ,
wa_textelements  LIKE LINE OF it_textelements,
ld_only_texts  TYPE RGLIF-ONLY_TEXTS ,
ld_read_latest_version  TYPE PROGDIR-STATE ,
ld_with_lowercase  TYPE RGLIF-LOWERCASE .

ld_language = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_include_tab to it_include_tab.

ld_program_name = some text here

"populate fields of struture and append to itab
append wa_source to it_source.

ld_with_includelist = some text here

"populate fields of struture and append to itab
append wa_source_extended to it_source_extended.

ld_only_source = some text here

"populate fields of struture and append to itab
append wa_textelements to it_textelements.

ld_only_texts = some text here

SELECT single STATE
FROM PROGDIR
INTO ld_read_latest_version.


ld_with_lowercase = 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 CNVCF_PROGRAM_READ or its description.