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: 

How to select plant view in BAPI_MATERIAL_SAVEDATA

Former Member
0 Kudos

Hi Friends,

I am using standard BAPI (BAPI_MATERIAL_SAVEDATA) to create Material Master. There is no option to select plant view in headdata itself but i need to populate plant data. So i've used PLANTDATA and PLANTDATAX parameter to pass plant name,storage location and period indicator.

say

PLANTDATA-plantname = '0011'.

PLANTDATA-storagelocation = '0011'.

PLANTDATA-periodind = 'D'.

PLANTDATAX-plantname = '0011'.

PLANTDATAX-storagelocation = 'X'.

PLANTDATAX-periodind = 'X'.

The material gets created but plant view is not created.

<<text removed>>

Thanks in advance.

Regards,

Prabhu

Edited by: Matt on May 5, 2009 11:15 AM - don't use ASAP

5 REPLIES 5

Former Member
0 Kudos

Hello,

Try this

Data:

PLANTDATA LIKE BAPI_MARC, "ins H 592229

PLANTDATAX LIKE BAPI_MARCX, "ins H 592229

  • Get plant

IF FT-FNAM = 'RM03M-WERKS'. "ins H 592229

PLANTDATA-PLANT = FT-FVAL. "ins H 592229

PLANTDATAX-PLANT = FT-FVAL. "ins H 592229

ENDIF.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA' "ins H 592229

EXPORTING "ins H 592229

HEADDATA = HEADDATA "ins H 592229

CLIENTDATA = CLIENTDATA "ins H 592229

CLIENTDATAX = CLIENTDATAX "ins H 592229

PLANTDATA = PLANTDATA "ins H 592229

PLANTDATAX = PLANTDATAX "ins H 592229

IMPORTING "ins H 592229

RETURN = RETURN_CODE2 "ins H 592229

TABLES "ins H 592229

MATERIALDESCRIPTION = MATERIALDESCRIPTION. "ins H 592229

Check this standard one is using in the same way

see this program MMCP3FP0

Former Member
0 Kudos

In the header data 'BAPIMATHEAD' check the Basic View and try out.

0 Kudos

Guys,

I tried in the same way as u said but it didn't get updated!! Any other idea?

Regards,

Prabhu

matt
Active Contributor
0 Kudos

>

> Hope u guys help me out ASAP.

Phrases such as ASAP are not permitted. They are seen by many as rather rude - implying that your question is somehow more important than anyone elses.

Former Member
0 Kudos

Hi Matt,

Sorry. Thanks for intimation.

Regards,

Prabhu