SAP Function Modules

PRICAT_IN_MATERIAL_READ SAP Function module - PRICAT: Read Article Data for a Catalog Item







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

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


Pattern for FM PRICAT_IN_MATERIAL_READ - PRICAT IN MATERIAL READ





CALL FUNCTION 'PRICAT_IN_MATERIAL_READ' "PRICAT: Read Article Data for a Catalog Item
  EXPORTING
    iv_matnr =                  " matnr         Material Number
    iv_prinbr =                 " pricat_k003-prinbr  PRICAT: Unique Internal Catalog Number
    iv_productgroup =           " pricat_k003-productgroup  PRICAT: PGI or assortment module from Pricat IDoc
    iv_ean_upc_base =           " pricat_k003-ean_upc_base  PRICAT: EAN/UPC code of the base unit of measure
    iv_validity_base =          " pricat_k003-validity_base  PRICAT: Datum, ab dem die angegebenen Änderung gültig werden
    iv_only_pricat_units = C_NO  " xfeld        Checkbox
  TABLES
    rt_pricat_k004_vb =         " pricat_k004_vb  Copy of table PRICAT_K004 for posting material
    rt_pricat_k005_vb =         " pricat_k005_vb  Copy of structure Bapimltxrt for posting texts
    rt_pricat_k005b_vb =        " pricat_k005b_vb  Copy of structure Bapie1mamrt for posting till receipt texts
    rt_pricat_k005k_vb =        " pricat_k005k_vb  Copy of structure Bapie1maktrt for posting short texts
    rt_pricat_k006_vb =         " pricat_k006_vb  Copy of structure Bapie1ausprt for posting characteristics
    rt_pricat_k007_vb =         " pricat_k007_vb  Copy of Structure for Posting Displays
    it_pricat_k004 =            " pricat_k004   PRICAT: Catalog Item Units of Measure, Dimensions, Weights, EANs/UPCs
  CHANGING
    rs_pricat_k003_vb =         " pricat_k003_vb  PRICAT: Catalog Item Basic Data
    rs_pricat_k003z_vb =        " pricat_k003z_vb  PRICAT: Catalog Item Basic Data Extras
    rs_pricat_s_in =            " pricat_s_in   PRICAT: Maintenance Structure for Inbound
  EXCEPTIONS
    READ_ERROR = 1              "               Das Material konnte nicht gelesen werden.
    APPL_LOG_ERROR = 2          "               Fehler in der Protokolverarbeitung
    .  "  PRICAT_IN_MATERIAL_READ

ABAP code example for Function Module PRICAT_IN_MATERIAL_READ





The ABAP code below is a full code listing to execute function module PRICAT_IN_MATERIAL_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:
it_rt_pricat_k004_vb  TYPE STANDARD TABLE OF PRICAT_K004_VB,"TABLES PARAM
wa_rt_pricat_k004_vb  LIKE LINE OF it_rt_pricat_k004_vb ,
it_rt_pricat_k005_vb  TYPE STANDARD TABLE OF PRICAT_K005_VB,"TABLES PARAM
wa_rt_pricat_k005_vb  LIKE LINE OF it_rt_pricat_k005_vb ,
it_rt_pricat_k005b_vb  TYPE STANDARD TABLE OF PRICAT_K005B_VB,"TABLES PARAM
wa_rt_pricat_k005b_vb  LIKE LINE OF it_rt_pricat_k005b_vb ,
it_rt_pricat_k005k_vb  TYPE STANDARD TABLE OF PRICAT_K005K_VB,"TABLES PARAM
wa_rt_pricat_k005k_vb  LIKE LINE OF it_rt_pricat_k005k_vb ,
it_rt_pricat_k006_vb  TYPE STANDARD TABLE OF PRICAT_K006_VB,"TABLES PARAM
wa_rt_pricat_k006_vb  LIKE LINE OF it_rt_pricat_k006_vb ,
it_rt_pricat_k007_vb  TYPE STANDARD TABLE OF PRICAT_K007_VB,"TABLES PARAM
wa_rt_pricat_k007_vb  LIKE LINE OF it_rt_pricat_k007_vb ,
it_it_pricat_k004  TYPE STANDARD TABLE OF PRICAT_K004,"TABLES PARAM
wa_it_pricat_k004  LIKE LINE OF it_it_pricat_k004 .

DATA(ld_rs_pricat_k003_vb) = 'Check type of data required'.
DATA(ld_rs_pricat_k003z_vb) = 'Check type of data required'.
DATA(ld_rs_pricat_s_in) = 'Check type of data required'.
DATA(ld_iv_matnr) = 'Check type of data required'.

SELECT single PRINBR
FROM PRICAT_K003
INTO @DATA(ld_iv_prinbr).


SELECT single PRODUCTGROUP
FROM PRICAT_K003
INTO @DATA(ld_iv_productgroup).


SELECT single EAN_UPC_BASE
FROM PRICAT_K003
INTO @DATA(ld_iv_ean_upc_base).


SELECT single VALIDITY_BASE
FROM PRICAT_K003
INTO @DATA(ld_iv_validity_base).

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

"populate fields of struture and append to itab
append wa_rt_pricat_k004_vb to it_rt_pricat_k004_vb.

"populate fields of struture and append to itab
append wa_rt_pricat_k005_vb to it_rt_pricat_k005_vb.

"populate fields of struture and append to itab
append wa_rt_pricat_k005b_vb to it_rt_pricat_k005b_vb.

"populate fields of struture and append to itab
append wa_rt_pricat_k005k_vb to it_rt_pricat_k005k_vb.

"populate fields of struture and append to itab
append wa_rt_pricat_k006_vb to it_rt_pricat_k006_vb.

"populate fields of struture and append to itab
append wa_rt_pricat_k007_vb to it_rt_pricat_k007_vb.

"populate fields of struture and append to itab
append wa_it_pricat_k004 to it_it_pricat_k004. . CALL FUNCTION 'PRICAT_IN_MATERIAL_READ' EXPORTING iv_matnr = ld_iv_matnr iv_prinbr = ld_iv_prinbr iv_productgroup = ld_iv_productgroup iv_ean_upc_base = ld_iv_ean_upc_base iv_validity_base = ld_iv_validity_base iv_only_pricat_units = ld_iv_only_pricat_units TABLES rt_pricat_k004_vb = it_rt_pricat_k004_vb rt_pricat_k005_vb = it_rt_pricat_k005_vb rt_pricat_k005b_vb = it_rt_pricat_k005b_vb rt_pricat_k005k_vb = it_rt_pricat_k005k_vb rt_pricat_k006_vb = it_rt_pricat_k006_vb rt_pricat_k007_vb = it_rt_pricat_k007_vb it_pricat_k004 = it_it_pricat_k004 CHANGING rs_pricat_k003_vb = ld_rs_pricat_k003_vb rs_pricat_k003z_vb = ld_rs_pricat_k003z_vb rs_pricat_s_in = ld_rs_pricat_s_in EXCEPTIONS READ_ERROR = 1 APPL_LOG_ERROR = 2 . " PRICAT_IN_MATERIAL_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_rs_pricat_k003_vb  TYPE PRICAT_K003_VB ,
ld_iv_matnr  TYPE MATNR ,
it_rt_pricat_k004_vb  TYPE STANDARD TABLE OF PRICAT_K004_VB ,
wa_rt_pricat_k004_vb  LIKE LINE OF it_rt_pricat_k004_vb,
ld_rs_pricat_k003z_vb  TYPE PRICAT_K003Z_VB ,
ld_iv_prinbr  TYPE PRICAT_K003-PRINBR ,
it_rt_pricat_k005_vb  TYPE STANDARD TABLE OF PRICAT_K005_VB ,
wa_rt_pricat_k005_vb  LIKE LINE OF it_rt_pricat_k005_vb,
ld_rs_pricat_s_in  TYPE PRICAT_S_IN ,
ld_iv_productgroup  TYPE PRICAT_K003-PRODUCTGROUP ,
it_rt_pricat_k005b_vb  TYPE STANDARD TABLE OF PRICAT_K005B_VB ,
wa_rt_pricat_k005b_vb  LIKE LINE OF it_rt_pricat_k005b_vb,
ld_iv_ean_upc_base  TYPE PRICAT_K003-EAN_UPC_BASE ,
it_rt_pricat_k005k_vb  TYPE STANDARD TABLE OF PRICAT_K005K_VB ,
wa_rt_pricat_k005k_vb  LIKE LINE OF it_rt_pricat_k005k_vb,
ld_iv_validity_base  TYPE PRICAT_K003-VALIDITY_BASE ,
it_rt_pricat_k006_vb  TYPE STANDARD TABLE OF PRICAT_K006_VB ,
wa_rt_pricat_k006_vb  LIKE LINE OF it_rt_pricat_k006_vb,
ld_iv_only_pricat_units  TYPE XFELD ,
it_rt_pricat_k007_vb  TYPE STANDARD TABLE OF PRICAT_K007_VB ,
wa_rt_pricat_k007_vb  LIKE LINE OF it_rt_pricat_k007_vb,
it_it_pricat_k004  TYPE STANDARD TABLE OF PRICAT_K004 ,
wa_it_pricat_k004  LIKE LINE OF it_it_pricat_k004.

ld_rs_pricat_k003_vb = 'Check type of data required'.
ld_iv_matnr = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_rt_pricat_k004_vb to it_rt_pricat_k004_vb.
ld_rs_pricat_k003z_vb = 'Check type of data required'.

SELECT single PRINBR
FROM PRICAT_K003
INTO ld_iv_prinbr.


"populate fields of struture and append to itab
append wa_rt_pricat_k005_vb to it_rt_pricat_k005_vb.
ld_rs_pricat_s_in = 'Check type of data required'.

SELECT single PRODUCTGROUP
FROM PRICAT_K003
INTO ld_iv_productgroup.


"populate fields of struture and append to itab
append wa_rt_pricat_k005b_vb to it_rt_pricat_k005b_vb.

SELECT single EAN_UPC_BASE
FROM PRICAT_K003
INTO ld_iv_ean_upc_base.


"populate fields of struture and append to itab
append wa_rt_pricat_k005k_vb to it_rt_pricat_k005k_vb.

SELECT single VALIDITY_BASE
FROM PRICAT_K003
INTO ld_iv_validity_base.


"populate fields of struture and append to itab
append wa_rt_pricat_k006_vb to it_rt_pricat_k006_vb.
ld_iv_only_pricat_units = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_rt_pricat_k007_vb to it_rt_pricat_k007_vb.

"populate fields of struture and append to itab
append wa_it_pricat_k004 to it_it_pricat_k004.

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