Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Check existing views for a specific Material

Former Member
0 Kudos

Hi!

Does anybody know a way to check which views (basic, mrp, purchase...) exist for a specific material. With SAP 4.7 there is the function BAPI_MATERIAL_GETALL to check this but within older versions this function is not available...

Thanks,

Konrad

1 ACCEPTED SOLUTION

Former Member

Hi Konrad

see the field PSTAT and/or VPSTA of MARA: the value of these field should be a sequence of letters, each letter should indicate an active view:

A Work scheduling

B Accounting

C Classification

D MRP

E Purchasing

F Production resources/tools

G Costing

K Basic data

L Storage

P Forecasting

Q Quality management

S Warehouse management

V Sales

X Plant stocks

Z Storage location stocks

Max

7 REPLIES 7

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

There is a field in MARA which has a bunch of letters in it. Each letter stands for a specific view that exists for the material. This is field is PSTAT.

<i>

Maintenance status

Use

The maintenance status records:

Which user departments may maintain a material master record of a particular material type

Which user departments have already maintained the material master record at a particular hierarchy level

The overall maintenance status is made up of the individual maintenance statuses. The individual maintenance statuses have the following meaning:

User department Maintenance status

Work scheduling A

Accounting B

Classification C

MRP D

Purchasing E

Production resources/tools F

Costing G

Basic data K

Storage L

Forecasting P

Quality management Q

Warehouse management S

Sales V

Plant stocks X

Storage location stocks Z

</i>

Regards,

Rich Heilman

Former Member
0 Kudos

Check the following link.

You can check what are the views available for a material based on the maintanence status field in mara table.

Then check the order of those views defined by using the tcode OMT3R and you can select that view dynamically. Doesnt matter if it is 13th position for one material and 15th for other.

former_member425121
Participant
0 Kudos

Hi Konrad

Try with next functions:

(In this example the class is 'CAR_REF', then only set your variable class name)

  • I. Check if Material has assigned class 'CAR_REF'

  • ---------------------------------------------------

mafid = 'O'. " Object Type

klart = c_clasn. " Id.Num 'CAR_REF' = '001'

l_objnr = p_material. " Object

kreuz = 'X'. " Visualize

datuv1 = sy-datum. " Date

refresh l_ikssk_v0. " CLINT for Material-CAR_REF Table

call function 'CLSE_SELECT_KSSK'

exporting

mafid = mafid

klart = klart

objek = l_objnr

view = kreuz

refresh = kreuz

key_date = datuv1

tables

exp_kssk = l_ikssk_v0

exceptions

no_entry_found = 1.

check not l_ikssk_v0[] is initial.

check not l_ikssk_v0-clint is initial.

  • II. Get Features List for Class-Material

  • ---------------------------------------------

clear aennr1.

refresh iksml.

clear iksml.

iksml-clint = l_ikssk_v0-clint. " Set Mat-Class KLINT

append iksml.

call function 'CLSE_SELECT_KSML'

exporting

key_date = datuv1

i_aennr = aennr1

tables

imp_exp_ksml = iksml

exceptions

no_entry_found = 04.

  • III. Get Features (Views) that Material has filled

  • -----------------------------------------------------

clear change_subsc_act.

refresh l_iausp.

call function 'CLFM_SELECT_AUSP'

exporting

mafid = mafid

classtype = klart

object = l_objnr

key_date = datuv1

with_change_number = change_subsc_act

i_aennr = aennr1

i_atzhl_same_ini = kreuz

tables

exp_ausp = l_iausp

exceptions

no_values = 01.

In l_iausp you get the views filled to Material-Class.

Cheers.

Frank

former_member425121
Participant
0 Kudos

Hi Konrad

Please give the points if you found the answer or close your topic.

Regards

Frank

Former Member

Hi Konrad

see the field PSTAT and/or VPSTA of MARA: the value of these field should be a sequence of letters, each letter should indicate an active view:

A Work scheduling

B Accounting

C Classification

D MRP

E Purchasing

F Production resources/tools

G Costing

K Basic data

L Storage

P Forecasting

Q Quality management

S Warehouse management

V Sales

X Plant stocks

Z Storage location stocks

Max

Former Member
0 Kudos

Check out this function module 'SELECTION_VIEWS_FIND'. It uses PSTAT to give an ITAB with very specific information on views selected for a Material.

PSTAT alone may not sufficient in some cases.

former_member221770
Contributor
0 Kudos

Konrad,

try the FM 'SELECTION_VIEWS_FIND'.

Cheers,

Pat.