Application Development and Automation 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: 
Read only

regarding bdc(views problem in mm01 while uploading the data)

Former Member
0 Likes
377

hi experts,

i have coded a bdc in which i m using mm01 and extending the material to the different plant ,but here in some cases depending upon the material the views get changed for solving this i have to deselect and again select the views which i want and also i have to provide the valuation type for this material, so plz suggest me how to rectifie the views problem.......

hi experts,

i have coded a bdc in which i m using mm01 and extending the material to the different plant ,but here in some cases depending upon the material the views get changed for solving this i have to deselect and again select the views which i want and also i have to provide the valuation type for this material, so plz suggest me how to rectifie the views problem.......

1 REPLY 1
Read only

Former Member
0 Likes
351

Hi ,

Read this code for getting the views.

tables: mara,

t134,

t133a.

data: begin of bildtab occurs 30.

include structure mbildtab.

data: end of bildtab.

data: tkstatus(15),

dispstatus like t130m-pstat.

parameters: p_matnr like mara-matnr.

call function 'MATERIAL_INIT'

exporting

tcode = 'MM02'

kz_berprf = 'X'

importing

tkstatus = tkstatus

exceptions

no_authority = 01.

call function 'SELECTION_VIEWS_FIND'

exporting

bildsequenz = '21'

pflegestatus = tkstatus"mara-pstat

tables

bildtab = bildtab.

*select single * from mara where matnr = p_matnr.

call function 'MARA_SINGLE_READ'

exporting

matnr = p_matnr "material

importing

wmara = mara

exceptions

lock_on_material = 01

lock_system_error = 02

not_found = 03

others = 04.

call function 'MARA_DUMMY_STATUS'

exporting

wmara_in = mara

importing

wmara_out = mara

exceptions

call_wrong = 1

imara_error = 2

tmara_error = 3

others = 4.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

select single * from t134 where mtart = mara-mtart.

call function 'ANZGSTATUS_SETZEN'

exporting

aktyp = 'V'

marastatus = mara-vpsta

t134status = t134-pstat

tkstatus = tkstatus "mara-pstat

importing

anzgstatus = dispstatus

tkbstatus = tkstatus.

translate dispstatus using ' $'..

loop at bildtab.

if bildtab-pstat ca dispstatus.

if bildtab-kzanz is initial.

bildtab-kzanz = 'X'.

modify bildtab.

endif.

else.

if not bildtab-kzanz is initial.

clear bildtab-kzanz.

modify bildtab.

endif.

endif.

endloop.

Other function modules are Selection_Views_Find.

Please reward if useful.