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

bapi_material_savedata

Former Member
0 Likes
629

Hi,

I am working on a module pool program.In the o/p screen there are many records.If the user wants to change the field values of a particular record,he clicks on the checkbox besides that record and when he click on the change button,control goes to update screen.In this screen when the user changes the value of one particular field and click on the checkbox beside and then click on the execute button,the changed value of that field should get updated in that particular record in the database table.Here I want to update mvke and marc tables.

I have used FM BAPI_MATERIAL_SAVEDATA to update the database tables.

Only marc table is getting updated with changed values.mvke table is not getting updated.What would be the reason for this.

I am sending a part of my code.Please check it.

form move_mat_data .

*Header

gt_bapi_head-material = gs_output1-matnr.

gt_bapi_head-ind_sector = gs_output1-mbrsh.

gt_bapi_head-matl_type = gs_output1-mtart.

gt_bapi_head-basic_view = 'X'.

gt_bapi_head-purchase_view = 'X'.

gt_bapi_head-account_view = 'X'.

gt_bapi_head-sales_view = 'X'.

*Client

gt_bapi_client-matl_group = gs_output1-matkl.

gt_bapi_client-base_uom = gs_output1-meins.

gt_bapi_clientx-matl_group = 'X'.

gt_bapi_clientx-base_uom = 'X'.

*Plant

gt_bapi_marc1-plant = gs_output1-werks.

gt_bapi_marc1-pur_status = gs_output1-mmsta.

gt_bapi_marc1-mrp_type = gs_output1-dismm.

gt_bapi_marc1-mrp_ctrler = gs_output1-dispo.

gt_bapi_marc1-serv_level = gs_output1-zserclass.

gt_bapi_marc1-availcheck = gs_output1-mtvfp.

gt_bapi_marcx-plant = gs_output1-werks .

gt_bapi_marcx-pur_status = 'X'.

gt_bapi_marcx-mrp_type = 'X'.

gt_bapi_marcx-mrp_ctrler = 'X'.

gt_bapi_marcx-serv_level = 'X'.

gt_bapi_marcx-availcheck = 'X'.

  • Material Description

REFRESH gt_materialdesc.

gt_materialdesc-langu = gs_output1-spras.

gt_materialdesc-matl_desc = gs_output1-maktx.

append gt_materialdesc.

*Sales

gt_bapi_mvke1-sales_org = gs_output1-vkorg.

gt_bapi_mvke1-distr_chan = gs_output1-vtweg.

gt_bapi_mvke1-sal_status = gs_output1-vmsta.

gt_bapi_mvke1-valid_from = gs_output1-vmstd.

gt_bapi_mvkex-sales_org = 'X'.

gt_bapi_mvkex-distr_chan = 'X'.

gt_bapi_mvkex-sal_status = 'X'.

gt_bapi_mvkex-valid_from = 'X'.

endform. " move_mat_data

4 REPLIES 4
Read only

Former Member
0 Likes
578

Hello Radha Rani,

I prepared one detailed documentation for this bapi with screen shots. At that time i used to change the db table marc for customer defined field.

I can mail that document as it is not possible to paste here with screen shots.

Regards

--

Sasidhar Reddy Matli.

Read only

Former Member
0 Likes
578

We have to populate the sales data to get MVKE tables updated

check the bold lines

Header

gt_bapi_head-material = gs_output1-matnr.

gt_bapi_head-ind_sector = gs_output1-mbrsh.

gt_bapi_head-matl_type = gs_output1-mtart.

gt_bapi_head-basic_view = 'X'.

gt_bapi_head-purchase_view = 'X'.

gt_bapi_head-account_view = 'X'.

gt_bapi_head-sales_view = 'X'. we have to populate the this structure

*Client

gt_bapi_client-matl_group = gs_output1-matkl.

gt_bapi_client-base_uom = gs_output1-meins.

gt_bapi_clientx-matl_group = 'X'.

gt_bapi_clientx-base_uom = 'X'.

*Plant

gt_bapi_marc1-plant = gs_output1-werks.

gt_bapi_marc1-pur_status = gs_output1-mmsta.

gt_bapi_marc1-mrp_type = gs_output1-dismm.

gt_bapi_marc1-mrp_ctrler = gs_output1-dispo.

gt_bapi_marc1-serv_level = gs_output1-zserclass.

gt_bapi_marc1-availcheck = gs_output1-mtvfp.

gt_bapi_marcx-plant = gs_output1-werks .

gt_bapi_marcx-pur_status = 'X'.

gt_bapi_marcx-mrp_type = 'X'.

gt_bapi_marcx-mrp_ctrler = 'X'.

gt_bapi_marcx-serv_level = 'X'.

gt_bapi_marcx-availcheck = 'X'.

Material Description

REFRESH gt_materialdesc.

gt_materialdesc-langu = gs_output1-spras.

gt_materialdesc-matl_desc = gs_output1-maktx.

append gt_materialdesc.

*Sales

gt_bapi_mvke1-sales_org = gs_output1-vkorg.

gt_bapi_mvke1-distr_chan = gs_output1-vtweg.

gt_bapi_mvke1-sal_status = gs_output1-vmsta.

gt_bapi_mvke1-valid_from = gs_output1-vmstd.

gt_bapi_mvkex-sales_org = 'X'.

gt_bapi_mvkex-distr_chan = 'X'.

gt_bapi_mvkex-sal_status = 'X'.

gt_bapi_mvkex-valid_from =

Read only

0 Likes
578

Hi,

How to populate sales data?

Read only

0 Likes
578

I have populated the sales data using this code

*Sales

gt_bapi_mvke1-sales_org = gs_output1-vkorg.

gt_bapi_mvke1-distr_chan = gs_output1-vtweg.

gt_bapi_mvke1-sal_status = gs_output1-vmsta.

gt_bapi_mvke1-valid_from = gs_output1-vmstd.

gt_bapi_mvkex-sales_org = 'X'.

gt_bapi_mvkex-distr_chan = 'X'.

gt_bapi_mvkex-sal_status = 'X'.

gt_bapi_mvkex-valid_from = 'X'.