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

Problems creating MARD records with BAPI_MATERIAL_SAVEDATA.

Former Member
0 Likes
1,819

Dear all.

I am using BAPI_MATERIAL_SAVEDATA to create MARD records (plant and storage location details) for materials already existing in the system on MARA and MARC levels.

My problem is that the record is created without the MRP-indicator, which is set to value '1' before the call to BAPI_MATERIAL_SAVEDATA. See code below.

Would anyone know why the record is created without the MRP-incidator?

I have debugged the BAPI down to the call to MATERIAL_MAINTAIN_DARK and I can see the the value is passed to MATERIAL_MAINTAIN_DARK.

LOOP AT lt_create INTO w_crea.

w_head-material = w_crea-matnr.

w_head-matl_type = w_crea-mtart.

w_head-ind_sector = w_crea-mbrsh.

w_head-storage_view = 'X'.

w_storagelocationdata-plant = w_crea-werks.

w_storagelocationdata-stge_loc = w_crea-lgort.

w_storagelocationdatax-stge_loc = w_crea-lgort.

w_storagelocationdatax-plant = w_crea-werks.

w_storagelocationdata-mrp_ind = '1'. """"""""""""

w_storagelocationdatax-mrp_ind = 'X'.

CLEAR w_return.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = w_head

storagelocationdata = w_storagelocationdata

storagelocationdatax = w_storagelocationdatax

IMPORTING

return = w_return

EXCEPTIONS

communication_failure = 1

system_failure = 2

resource_failure = 3.

ENDLOOP.

Thanks in advance.

Lande

1 ACCEPTED SOLUTION
Read only

santhosh_patil
Contributor
0 Likes
1,325

Hi,

Try by seting the MRP_VIEW in the header

i,e

<b>w_head-mrp_view = 'X'.</b>

-


Patil

Dear all.

I am using BAPI_MATERIAL_SAVEDATA to create MARD records (plant and storage location details) for materials already existing in the system on MARA and MARC levels.

My problem is that the record is created without the MRP-indicator, which is set to value '1' before the call to BAPI_MATERIAL_SAVEDATA. See code below.

Would anyone know why the record is created without the MRP-incidator?

I have debugged the BAPI down to the call to MATERIAL_MAINTAIN_DARK and I can see the the value is passed to MATERIAL_MAINTAIN_DARK.

LOOP AT lt_create INTO w_crea.

w_head-material = w_crea-matnr.

w_head-matl_type = w_crea-mtart.

w_head-ind_sector = w_crea-mbrsh.

w_head-storage_view = 'X'.

w_storagelocationdata-plant = w_crea-werks.

w_storagelocationdata-stge_loc = w_crea-lgort.

w_storagelocationdatax-stge_loc = w_crea-lgort.

w_storagelocationdatax-plant = w_crea-werks.

w_storagelocationdata-mrp_ind = '1'. """"""""""""

w_storagelocationdatax-mrp_ind = 'X'.

CLEAR w_return.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = w_head

storagelocationdata = w_storagelocationdata

storagelocationdatax = w_storagelocationdatax

IMPORTING

return = w_return

EXCEPTIONS

communication_failure = 1

system_failure = 2

resource_failure = 3.

ENDLOOP.

Thanks in advance.

Lande

4 REPLIES 4
Read only

Former Member
0 Likes
1,325

Is there any help in the RETURN table?

Rob

Read only

0 Likes
1,325

The return says that it went OK. No errors. "Material changed..." or something like that.

Lande

Read only

santhosh_patil
Contributor
0 Likes
1,326

Hi,

Try by seting the MRP_VIEW in the header

i,e

<b>w_head-mrp_view = 'X'.</b>

-


Patil

Read only

Former Member
0 Likes
1,325

Thanks Patil. It worked.