Application Development 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: 

problem in using BAPI_MATERIAL_SAVEDATA

Former Member
0 Kudos

Hi all,

I am using BAPI_MATERIAL_SAVEDATA to create a material.

this BAPI is in a loop, internal table have 4 records with different material numbers and all other data is same.

data is for BASIC and SALEs views.

For fist record it is created data for basic and sales views

for second record it is created only basic view

for third record it is created data for basic and sales views

for fourth record it is created only basic view

Am i missing any thing to pass? why it is creating only basic view for second and fourth records?

i have debugged, data is same except material no for every loop.

i am using commit work and wait for every loop. also tried to use after completion of loop but no change in result

Please help me.

Thanks in advance.

Best records,

Venu.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Venu,

Material view creation depends on Material type.

check the possible views allowed for the material type( i.e for 2nd row of internal table).

6 REPLIES 6

Former Member
0 Kudos

Hi,

Can you place the code

0 Kudos

Hi Thank you for reply.

FORM f_call_fm_mm TABLES tt_return "Error return

USING ps_mm_wa TYPE y88t_armat

pv_bukrs "Company code

pv_chart_acc "Chart of accounts

pv_sector "Industry sector

pv_status.

*

ENDFORM. " F_CALL_FM_MM

Former Member
0 Kudos

Hi venu Gopal,

Check the importing and table parameters which are ending with 'X' these parameter are set to 'X' then only they update.

check whether at end of the loop u may write any clear statement or not.

The Example Parameters ends with 'X' is PLANTDATAX,PLANNINGDATAX,STORAGELOCATIONDATAX

Regards

Siva

Former Member
0 Kudos

Venu,

Material view creation depends on Material type.

check the possible views allowed for the material type( i.e for 2nd row of internal table).

0 Kudos

Hi Jeevan,

Thank you for your reply, it's correct depends on material type.

For second and fourth record other views are not available.

Thank you.

Former Member
0 Kudos

Hi All,

In BAPI "BAPI_MATERIAL_SAVEDATA"

to pass below Parameters also:

In Client-specific material data

  

    clientdat-MATL_GROUP = gs_bapimaterial-matkl.
    clientdat-BASE_UOM = gs_bapimaterial-meins.
    clientdat-BASE_UOM_ISO = gs_bapimaterial-meins.

In information on Update for Clientdata.

  clientdatax-MATL_GROUP = 'X'.
    clientdatax-base_uom = 'X'.
    clientdatax-base_uom_iso = 'X'.

After call 'BAPI_MATERIAL_SAVEDATA'

   IF RETURN-TYPE = 'S' .
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          WAIT = 'X'.
    ELSEIF RETURN-TYPE = 'E' .
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK' .
    ENDIF .

It will work fine.