cancel
Showing results for 
Search instead for 
Did you mean: 

JCo and BAPI_STANDARDMATERIAL_CREATE

Former Member
0 Kudos

Hi,

I just came up with a problem. I need to create a material in mm and need to use the JCo.

The function I need "BAPI_STANDARDMATERIAL_CREATE" is activated for remote calls and should do what I want.

But, as it seems,this function can not be called from within the java connector and needs a working sapgui as the calling object.

As I still need to create a material in mm from within my java connector program I wanted to ask if someone here already has some experience.

I couldn't come up with a solution till now.

Every help would be welcome.

Ian

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

hello, i am working on a very similar project to yours. i am trying to create a material master from a jsp page. the function is being called from a java file. how do i go about this? i have the java client and the sap connection working fine with jco but do not know where to begin with the bapi_material_savedata function???

Former Member
0 Kudos

Ok, solved it.

Now I am using BAPI_MATERIAL_GETINTNUMBER to fetch an internal number and then create it.

Thanks for the help so far and good night.

Regards,

Ian

gregorw
Active Contributor
0 Kudos

Hello Ian,

congratulations to the solution. I think it would be nice to cover weblog with this. Thank you for the points.

Regards

Gregor

Former Member
0 Kudos

how do you use the getintnumber function to return a number? i assume you then use this number to populate the information for the savedata function? i am trying to do the same thing, i can't seem to get it working though. could you offer any assistance?

Former Member
0 Kudos

Hi Margaret,

I am sorry that I replay that late. But I didn't think that here would happen that much more.

BAPI_MATERIAL_GETINTNUMBER fills a table with the number of numbers you provided as a param during the creation of the function call.

If I remember it correctly, you then need to retrieve that table, using the specific name, and read that number from the table.

Pass that number on to the material data you want to create and you should have your material added.

If you need any further help, I'd be happy to give you a hand with what I know.

Regards,

Ian

ps: Gregor, I will take up that idea of yours with the weblog in the next few days. Just need to get to my workstation, with my code, again. thanks and good night.

Former Member
0 Kudos

Hi there,

@Gregor:

Thanks. I will try this one as soon as our vpn works again. I'll say if it helped.

@Pran:

Thanks for this hint.

As I am quite new to SAP and JCo I need to handle your hint with that bit information I found about z function modules.

As I see it, I would need to do some internal work in the sap system, to write this z function module and to handle the call to the bapi I want use.

As we want to be as less invasive as we can, we want to provide a solution as near to "out of the box" as possible.

But I will hold that idea of yours.

Thanks for your help.

Nice rest weekendend and regards,

Ian

gregorw
Active Contributor
0 Kudos

Hello Ian,

the key word for Pran's solution is to record a batch input, put that in a function module and call that through RFC. If you have some ABAP aware colleagues they can show you how to do that.

Regards

Gregor

Former Member
0 Kudos

Hi there again,

BAPI_MATERIAL_SAVEDATA is just the one I needed. Thanks for the help and sorry for the late reply. I am just writing my bt.

edit:

But i came up with a problem and hope that you can help me with this one too.

If I try to create a material I get the system message:

"Die numerische Materialnummer 4501 wurde ohne führende Nullen übergeben"

in english something like:

"The numerical material number 4501 was provided without leading zeros."

I had a look at standard materials and tried to add some 0. But nothing helped and I can't find a site where this problem is already handled.

Thanks for your time.

Regards,

Ian

Message was edited by: Ian Molloy

Former Member
0 Kudos

Hi Ian

Why dont you try writing a Z function module that is remote enabled and call BAPI_STANDARDMATERIAL_CREATE internally. You should then be able to call your Z remote Function module using Java via Java Connector.

Regards

Pran

gregorw
Active Contributor
0 Kudos

Hello Ian,

I think you should try out the Function Module: "BAPI_MATERIAL_SAVEDATA".

Regards

Gregor