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
704

hi

I need to update Procurement type, Special Procurement Type and Price Control Indicator , Special procurement type for costing using MM02.

From SDN I could find that I can use BAPI_MATERIAL_SAVEDATA but how do I use this for updating it



    SELECT SINGLE * FROM mara INTO xmara WHERE matnr = material.

    headdata-material   = material.
    headdata-ind_sector = xmara-mbrsh.
    headdata-matl_type  = xmara-mtart.
    headdata-basic_view = 'X'.

    plantdata-proc_type  = w_dest_beskz.
    plantdata-spproctype = w_dest_sobsl.
    plantdata-specprocty = w_dest_sobsk.

    plantdatax-proc_type  = w_dest_beskz.
    plantdatax-spproctype = w_dest_sobsl.
    plantdatax-specprocty = w_dest_sobsk.


    valuationdata-vprsv  = w_dest_vprsv.
    valuationdatax-vprsv = 'X'.

    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
      EXPORTING
        headdata                   = headdata
*       CLIENTDATA                 =
*       CLIENTDATAX                =
       plantdata                  = plantdata
       plantdatax                 = plantdatax
*       FORECASTPARAMETERS         =
*       FORECASTPARAMETERSX        =
*       PLANNINGDATA               =
*       PLANNINGDATAX              =
*       STORAGELOCATIONDATA        =
*       STORAGELOCATIONDATAX       =
       valuationdata              = valuationdata
       valuationdatax             = valuationdatax
*       WAREHOUSENUMBERDATA        =
*       WAREHOUSENUMBERDATAX       =
*       SALESDATA                  =
*       SALESDATAX                 =
*       STORAGETYPEDATA            =
*       STORAGETYPEDATAX           =
*       FLAG_ONLINE                = ' '
*       FLAG_CAD_CALL              = ' '
*       NO_DEQUEUE                 = ' '
*       NO_ROLLBACK_WORK           = ' '
     IMPORTING
       return                     = return
*     TABLES
*       MATERIALDESCRIPTION        =
*       UNITSOFMEASURE             =
*       UNITSOFMEASUREX            =
*       INTERNATIONALARTNOS        =
*       MATERIALLONGTEXT           =
*       TAXCLASSIFICATIONS         =
*       RETURNMESSAGES             =
*       PRTDATA                    =
*       PRTDATAX                   =
*       EXTENSIONIN                =
*       EXTENSIONINX               =
              .

valuationdatax-vprsv = 'X'.

What does this mean... should be pass on value or should be pass 'X'..

headdata-basic_view = 'X'.

What view should I select.. please let me know this too.. points for every helpful answer

Please tell me this asp..

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
503

For the "X" structures, you should be passing the "X" to these fields. This is telling the BAPI that you want to update these specific fields. You are already passing the values via the other structure.



    plantdata-proc_type  = w_dest_beskz.
    plantdata-spproctype = w_dest_sobsl.
    plantdata-specprocty = w_dest_sobsk.
 
    plantdatax-proc_type  = 'X'.
    plantdatax-spproctype = 'X'.
    plantdatax-specprocty = 'X'.


Regards,

RIch Heilman

Read only

Former Member
0 Likes
503

> valuationdatax-vprsv = 'X'.

>

> What does this mean... should be pass on value or

> should be pass 'X'..

You should pass 'X' to all 'X' structures. It indicates that in the corresponding value structure "valuationdata" you have filled the field 'vprsv' with a value. If you don't pass an 'X', system will not take the value of that field.

> headdata-basic_view = 'X'.

> What view should I select.

You have to use COST_VIEW.

Read only

0 Likes
503

Hi Srinivas

I am also updating plant data..

plantdata = plantdata

plantdatax = plantdatax

valuationdata = valuationdata

valuationdatax = valuationdatax

So isnt there a view which should be selected for this

For valuation we have selected COST_VIEW in HEADDATA, isnt there any view we have to select to update plantdata ??

Read only

0 Likes
503

I don't think you have to specify that, once you fill the PLANTDATA and the PLANTDATAX tables, system will extend the material to those plants.