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 to create material with reference

0 Likes
1,788

Hi,

i'm looking for a BAPI to create Material with reference. I found BAPI_MATERIAL_SAVEDATA but didn't find a 'reference'-parameter.

As an alternative i could also use a BAPI that reads all the data you need for BAPI_MATERIAL_SAVEDATA from an existing material and then use this data to create a new material.

Unfortunately BAPI_MATERIAL_GETDETAIL does not provide the same fields.

Can anyone help me out.

regards

Steffen

7 REPLIES 7
Read only

abdul_hakim
Active Contributor
0 Likes
1,170

Hi

Welcome to SDN.

Try BAPI_STANDARDMATERIAL_CREATE

REgards,

Abdul

Read only

0 Likes
1,170

Hi Abdul,

thanks for your answer.

The BAPI you mentioned calls a dialog. I need a remote BAPI (Material with reference) with no dialog to call it from PHP.

Any ideas?

Thanks in advance.

Steffen

Read only

0 Likes
1,170

Hi Steffen!

With BAPI_MATERIAL_MAINTAINDATA_RT it's no problem, but you have to use SAP-Retial.

But have a look at MATERIAL_MAINTAIN_DARK, if here more options are available.

Regards,

Christian

Read only

0 Likes
1,170

Hi Christian,

sorry for not writing sooner.

I need ab BAPI for standard material and it has to be a remote enabled function.

(i do not want to modify the function to remote enable it)

any mor ideas?

Thanks

Steffen

Read only

0 Likes
1,170

Hi Steffen

Have you tried to use the BAPI BAPI_MATERIAL_GET_ALL to get out the data you need to copy?

Max

Read only

0 Likes
1,170

Hi Steffen!

You can follow two different ways:

- Max's approach: reading all needed material data from reference material and copying this 'manual' into the bapi call.

- Write a RFC-function, which just calls the bapi_material_maintain_dark - you don't need to modify, you just have to 'translate' the interface definition. Of course check first, if reference material is provided.

Regards,

Christian

Read only

0 Likes
1,170

thank all of you guys,

i already found the GETALL BAPI, but i will have to map the structure of this BAPI to the structure of the _SAVEDATA BAPI.

... not really easy to use.

I just wanted to use RFC-Calls from outside SAP without having to change or write anything inside SAP. So Max's approach seems to be the only one.

regards

Steffen