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

bdc -- mm01

Former Member
0 Likes
845

hi to all

how to handle views in mm01 in one BDC program

hi to all

how to handle views in mm01 in one BDC program

4 REPLIES 4
Read only

Former Member
0 Likes
794

To handle MM01 Views, you may refer to this link:

Read only

Former Member
0 Likes
794

You have to use the FM: SELECTION_VIEWS_FIND to get the indexes of the views that are displyed n the list of views.

Sample usage:

call function 'MATERIAL_INIT'

exporting

tcode = tcode

kz_berprf = x

importing

it130m = t130m

tkstatus = tkstatus

exceptions

no_authority = 01

material_article_mismatch = 02.

call function 'BILDSEQUENZ_IDENTIFY'

exporting

materialart = materialart

tcode_ref = t130m-trref

importing

bildsequenz = bildsequenz.

call function 'SELECTION_VIEWS_FIND'

exporting

bildsequenz = bildsequenz

pflegestatus = tkstatus

tables

bildtab = ztab_new.

I would rather suggest you to use the BAPI instead of BDC.

It is very simple and you don;t need to wory about the screen flow .

Refer this link:

Read only

amit_khare
Active Contributor
0 Likes
794

Hi,

Just use SELECTION_VIEWS_FIND function module to dynamically select the view.

For Example.

call function 'BDC_OPEN_GROUP'

exporting

group = 'Z5AK_MM02'

keep = 'X'

user = 'DEVELOPER'.

if sy-subrc <> 0.

message e016.

endif.

loop at it_mater.

select single vpsta from mara into v_vpsta where matnr = it_mater-v_matnum.

call function 'SELECTION_VIEWS_FIND'

exporting

bildsequenz = '21'

pflegestatus = v_vpsta

tables

bildtab = i_bildtab.

endloop.

loop at i_bildtab where guifu = 'SP04'.

concatenate 'MSICHTAUSW-KZSEL(' i_bildtab-idxbd ')' into v_var.

endloop.

loop at it_mater.

clear it_bdc.

it_bdc-program = 'SAPLMGMM'.

it_bdc-dynpro = '0060'.

it_bdc-dynbegin = 'X'.

append it_bdc.

clear it_bdc.

it_bdc-fnam = 'RMMG1-MATNR'.

it_bdc-fval = it_mater-v_matnum.

append it_bdc.

clear it_bdc.

it_bdc-fnam = 'BDC_OKCODE'.

it_bdc-fval = '/00'.

append it_bdc.

clear it_bdc.

it_bdc-program = 'SAPLMGMM'.

it_bdc-dynpro = '0070'.

it_bdc-dynbegin = 'X'.

append it_bdc.

clear it_bdc.

it_bdc-fnam = 'BDC_OKCODE'.

it_bdc-fval = '=RESA'.

append it_bdc.

clear it_bdc.

it_bdc-program = 'SAPLMGMM'.

it_bdc-dynpro = '0070'.

it_bdc-dynbegin = 'X'.

append it_bdc.

clear it_bdc.

it_bdc-fnam = v_var.

it_bdc-fval = 'X'.

append it_bdc.

  • CLEAR it_bdc.

  • it_bdc-fnam = 'MSICHTAUSW-KZSEL(03)'.

  • it_bdc-fval = 'X'.

  • APPEND it_bdc.

clear it_bdc.

it_bdc-fnam = 'BDC_OKCODE'.

it_bdc-fval = '=ENTR'.

append it_bdc.

clear it_bdc.

it_bdc-program = 'SAPLMGMM'.

it_bdc-dynpro = '0080'.

it_bdc-dynbegin = 'X'.

append it_bdc.

clear it_bdc.

it_bdc-fnam = 'RMMG1-WERKS'.

it_bdc-fval = it_mater-v_werks.

append it_bdc.

clear it_bdc.

it_bdc-fnam = 'RMMG1-VKORG'.

it_bdc-fval = it_mater-v_sales.

append it_bdc.

clear it_bdc.

it_bdc-fnam = 'RMMG1-VTWEG'.

it_bdc-fval = it_mater-v_channel.

append it_bdc.

clear it_bdc.

it_bdc-fnam = 'BDC_OKCODE'.

it_bdc-fval = '=ENTR'.

append it_bdc.

clear it_bdc.

it_bdc-program = 'SAPLMGMM'.

it_bdc-dynpro = '4000'.

it_bdc-dynbegin = 'X'.

append it_bdc.

clear it_bdc.

it_bdc-fnam = 'BDC_OKCODE'.

it_bdc-fval = '=BU'.

append it_bdc.

*call transaction 'Z5AK3' using it_bdc mode 'N' MESSAGES INTO ITAB.

call function 'BDC_INSERT'

exporting

tcode = 'MM02'

tables

dynprotab = it_bdc.

if sy-subrc <> 0. .

message e016.

endif.

refresh it_bdc.

endloop.

call function 'BDC_CLOSE_GROUP'.

if sy-subrc <> 0.

message e017.

endif.

Regards,

Amit

Read only

0 Likes
794

see the below thread, it will have the sample code also for MM01 BDC

<b>plz rewards the point for helpful one.</b>