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

Material Master Create with BAPI

Former Member
0 Likes
2,676

I want to create materail with the help of BAPI_MATERIAL_SAVEDATA  .  But ti have field AUSUZ [Numerator for converting from unit to base unit (BTCI) ] and AUSUN [Denominator for conversion from unit to base unit (BTCI)] and STLAN [BOM Usage]  in material master template but these field not include in any of BAPI structure of BAPI_MATERIAL_SAVEDATA 'S import. So please suggest how  can  i update these fileds with the help of  BAPI_MATERIAL_SAVEDATA at the time of material creation.

6 REPLIES 6
Read only

jay_kumar8
Active Participant
0 Likes
1,795

You can check in the TABLES parameter UNITSOFMEASURE

in that 2 fields are there

NUMERATORUMREZDEC50Numerator for Conversion to Base Units of Measure
DENOMINATRUMRENDEC50Denominator for conversion to base units of measure

and in IMPORT parameter in the PLANTDATA there is field called..

BOM_USAGESTLANCHAR10BOM Usage

Regards

Raj

Read only

Former Member
0 Likes
1,795

Hello,

There has to be extenstion in BAPI. Please try using that.

Regards,

Kulprakash

Read only

Former Member
0 Likes
1,795

I am getting  following error that

Field VKORG has been transferred inconsistently or is blank.

As per our Scenario for Semi finished Material  VKORG ALWAYS BLANK.

What is the difference between

BAPI_MARD and  BAPI_MARDX

Read only

0 Likes
1,795

Hi Deepak,

    What ever the values you pass to the structure BAPI_MARD ..then you should pass the corresponding field value in BAPI_MARDX with value 'X' inorder to be updated in Database table..

Regards,

       Rohan

Read only

Former Member
0 Likes
1,795

I am getting  below error during debugging.

                                   TYPE                                  E
                                   ID                                  MM
                                   NUMBER                                  360
                                   MESSAGE                                  Key fields for use data PLANTDATA and checkbox structure PLANTDATAX are different
                                   LOG_NO                                  
                                   LOG_MSG_NO                                  000000
                                   MESSAGE_V1                                  PLANTDATA
                                   MESSAGE_V2                                  PLANTDATAX
Read only

0 Likes
1,795

Are you using the same plant in both the structures...

for example..

plantdata-plant = 'AXXX'

plantdatax-plant = 'AXXX

below is sample code

*   Set data to change

    LS_HEAD-MATERIAL     = <GS_STR>-MATNR.

    LS_PLANT-PLANT       = <GS_STR>-WERKS.

    LS_PLANT-PROC_TYPE   = 'X'.

    LS_PLANT-SPPROCTYPE  = '  '. 

    LS_PLANT-QUOTAUSAGE  = '4'.

    LS_PLANTX-PLANT      = <GS_STR>-WERKS.

    LS_PLANTX-PROC_TYPE  = 'X'.

    LS_PLANTX-SPPROCTYPE  = 'X'.

    LS_PLANTX-QUOTAUSAGE = 'X'.

*   Change material master data

    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

         EXPORTING

              HEADDATA   = LS_HEAD

              PLANTDATA  = LS_PLANT

              PLANTDATAX = LS_PLANTX

         IMPORTING

              RETURN     = LS_RETURN.

'.

Regards

Raj