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' SALES_VIEW

umtyzc
Participant
0 Likes
1,681

Hi all, I want to use 'BAPI_MATERIAL_SAVEDATA' to change only SALESDATA view MM02.(not create a new material)


I want to change  SAL_STATUS and  VALID_FROM fields. I don't want to restrict with sales organization or distr_chan.

(changing SAL_STATUS and VALID_FROM based only material number).



i pass these fields to exporting.

Which fields are necessary to implement this case? 

I want to change only SALESDATA (SAL_STATUS and VALID_FROM).



HEADDATA-MATERIAL    = itab-matnr.

HEADDATA-SALES_VIEW  = 'X'.



SALESDATA-SAL_STATUS  = 'Z1'.

SALESDATAX-SAL_STATUS = 'X'.

SALESDATA-VALID_FROM = p_mstdv.

SALESDATAX-VALID_FROM = 'X'.


CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

   EXPORTING

     HEADDATA                   = HEADDATA

     SALESDATA = SALESDATA

     SALESDATAX = SALESDATAX

   IMPORTING

     RETURN                     = RETURN

   TABLES

     RETURNMESSAGES             = RETURNMESSAGES.

1 ACCEPTED SOLUTION
Read only

JarosBaw
Active Participant
0 Likes
1,117

Hi,

You have to fill  SALES_ORG and DISTR_CHAN field in SALESDATA and SALESDATAX. If You have many SALES_ORG and DISTR_CHAN values, You should run this bapi as many times as number of used pairs SALES_ORG/DISTR_CHAN (taken ex. from MVKE tables for this material).

Jarek

Hi all, I want to use 'BAPI_MATERIAL_SAVEDATA' to change only SALESDATA view MM02.(not create a new material)


I want to change  SAL_STATUS and  VALID_FROM fields. I don't want to restrict with sales organization or distr_chan.

(changing SAL_STATUS and VALID_FROM based only material number).



i pass these fields to exporting.

Which fields are necessary to implement this case? 

I want to change only SALESDATA (SAL_STATUS and VALID_FROM).



HEADDATA-MATERIAL    = itab-matnr.

HEADDATA-SALES_VIEW  = 'X'.



SALESDATA-SAL_STATUS  = 'Z1'.

SALESDATAX-SAL_STATUS = 'X'.

SALESDATA-VALID_FROM = p_mstdv.

SALESDATAX-VALID_FROM = 'X'.


CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

   EXPORTING

     HEADDATA                   = HEADDATA

     SALESDATA = SALESDATA

     SALESDATAX = SALESDATAX

   IMPORTING

     RETURN                     = RETURN

   TABLES

     RETURNMESSAGES             = RETURNMESSAGES.

1 REPLY 1
Read only

JarosBaw
Active Participant
0 Likes
1,118

Hi,

You have to fill  SALES_ORG and DISTR_CHAN field in SALESDATA and SALESDATAX. If You have many SALES_ORG and DISTR_CHAN values, You should run this bapi as many times as number of used pairs SALES_ORG/DISTR_CHAN (taken ex. from MVKE tables for this material).

Jarek