cancel
Showing results for 
Search instead for 
Did you mean: 

CSAP_MAT_BOM_CREATE and JAVA

Former Member
0 Kudos

Hi,

Has anybody used CSAP_MAT_BOM_CREATE in his/her Java Application?

or at least know CSAP_MAT_BOM_CREATE and necessary input to execute this API?

Looking forward answers.

BR,

Rafal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi, Rafal!

Call transaction SE37 and check function module documentation. You' ll find all requried infomration here!

Regards

Thomas

Former Member
0 Kudos

Hi,

I am really new and don't know how to call transaction SE37 or to find it. I think you mean that I should do it via SAP easy access, but where to find it?

BR,

Rafal

Former Member
0 Kudos

Hi, Rafal!

Just enter "SE37" in the command field in the menu bar, which opens the "Function Builder". Then type the function modules name into the input field and press the Display-Button. The source code and a button "function module documentation" will appear.

That' s it!

Regards,

Thomas

Former Member
0 Kudos

Hi,

Thanks a lot. I don't have command field in my menu bar (don't know why). Anyway I've found SE37 in another way by insert transaction into my favourites.

Do you know sth about using CSAP_MAT_BOM_CREATE directly into Java?

I've faced many problems and solved them successfully, but I still have really strange one. I can create BOM with <b>one</b> item, but if I try to create BOM with more than one, function throws a terminating error during execution.

I show the source code below:

JCO.Function function;
		try {
			function = this.createFunction("CSAP_MAT_BOM_CREATE");
		} catch (CreateFunctionException e) {
			return e.toString();
		}
		if (function == null) {
			return "Error: createBom() - Function==null";
		}

		//System.out.println(function.getImportParameterList().get);
		
		function.getImportParameterList().setValue("TESTBICYCLE4", "MATERIAL");
		function.getImportParameterList().setValue("1", "BOM_USAGE");
		function.getImportParameterList().setValue("03.01.2007", "VALID_FROM");
		
		Table tstpo=function.getTableParameterList().getTable("T_STPO");
		tstpo.appendRow();
		
		tstpo.setValue("0010", "ITEM_NO");
		tstpo.setValue("L", "ITEM_CATEG");
		tstpo.setValue("TESTIRON", "COMPONENT");
		tstpo.setValue("5", "COMP_QTY");
		tstpo.setValue("ST", "COMP_UNIT");
		
//if i comment following lines execution is possible, otherwise not
		tstpo.appendRow();
		
		tstpo.setValue("0020", "ITEM_NO");
		tstpo.setValue("L", "ITEM_CATEG");
		tstpo.setValue("TESTPLASTIC", "COMPONENT");
		tstpo.setValue("15", "COMP_QTY");
		tstpo.setValue("ST", "COMP_UNIT");
//execution

executeBapi(function);

Former Member
0 Kudos

Hi,

When the execution fails, what is the error coming back?

Have you tried executing the function directly in SAP from SE37 using the test data you have mentioned to see what happens?

It sounds like you don't know much about SAP or ABAP - I'd suggest maybe getting and ABAP developer to look at the function module with you to help resolve the problem.

Also, I notice the function module CSAP_MAT_BOM_CREATE has not been released by SAP (go to the attributes tab in SE37 and look for the released date at the bottom right - it is showing as not released on my system.) This could be a concern as there is no guarentee that SAP will continue to support/develop this module or even that it works correctly.

I would suggest talking to an ABAP developer about a different way to create BoM's.

Hope this helps,

Gareth.

Former Member
0 Kudos

Hi,

I've already solved my problem with items. I can create BOM consisting of more than one component.

I think it was released by SAP. When I go to attribute tab, it is written in general data:

person responsible: SAP

last changed by: SAP

changed on: 25.10.1999

Where have you found this information? Perhaps I'm "blind".

I know that CSAP_MAT_BOM_CREATE has many restrictions, therefore I need to ask whether it is possible to create multilevel BOM?

looking forward your answer

br,

Rafal

Former Member
0 Kudos

Hi Rafal,

I think I'm on a later version than you but lower down from the last changed by and changed on fields there is another field that is normally called Released On. Have a look at function module BAPI_SALESORDER_CREATEFROMDAT2 in SE37 and you will see what I mean.

With CSAP_MAT_BOM_CREATE it is set as Not Released. If you search around on OSS and probably here on SDN you will find what this really means but basically it is not advisable to use a module that SAP haven't released.

As I said, if I were you I would speak to an ABAP developer or post over in the ABAP programming thread to find a suitable function module for creating BoM's.

Gareth.

Former Member
0 Kudos

Hi,

Probably you are right, since you are much more experienced, but I checked BAPI_SALESORDER_CREATEFROMDAT2 and CSAP_MAT_BOM_CREATE according to your suggestion, and both have Not Released in the bottom right. I don't understand this distinction.

Thank you for your information. I will reward you and Thomas laten on. Perhaps I will need some additional help before I change the status to answered.

Br,

Rafal

Former Member
0 Kudos

What version of SAP are you working on? It may be you are no a much older version when BAPI_SALESORDER_CREATEFROMDAT2 still hadn't been released.

Try looking at a different function module, say READ_TEXT and you should see what I mean.

Gareth.

Former Member
0 Kudos

Hi, Rafal!

In general it' s recommended to use BAPIs instead of simple function modules, because they remain stable in their interface, do not have implicit commits (so always call BAPI_TRANSACTION_COMMIT afterwards). Regarding the status of function modules: there are 3 - released, internal usage and not released. These reflect the status of SAP development. Always use only these which are released for public usage, all others may have bugs or change until that.

Regards,

Thomas

PS: If you' re searching for a appropriate function, have a look at transaction BAPI which shows you all availalbe business objects in SAPs business repository and their methods - the above mentioned BAPIs - you should use for communication with R/3.

Former Member
0 Kudos

Hi,

Ok...now I see the difference.

I know that I can use BAPI_MATERIAL_BOM_GROUP_CREATE, but only in higher version than 4.6B. For lower one I don't know any other opportunity than CSAP_MAT_BOM_CREATE. Do you know?

Thanks.

Br,

Rafal

Former Member
0 Kudos

Hi!

A look in the BOR told me that there is no equivalent to the one you need which would be available sooner, so IMHO you' ll have to use the function module. But - to be honest - I' m no MM consultant.

Regards,

Thomas

Former Member
0 Kudos

Hi,

Thanks a lot.

In this case I think I need to use CSAP_MAT_BOM_CREATE. Do you know whether I can use BOM created with this function in Sales Order??

Thanks in advance.

Br,

Rafal

Former Member
0 Kudos

Hi, Rafal!

Regarding questions like these you should probably consult the .

Regards,

Thomas

Answers (1)

Answers (1)

Former Member
0 Kudos

I've already implemented method based on this module, si I can mark it as answered.

Former Member
0 Kudos

Hey Rafal,

I am a novice to writing integration using JCos to the BAPIs. Basically i am trying to write some java programs to talk to BAPIs to both create Materials and to build the BOM usign the materials created. Was wondering if you can help me with some sample code if you can. Could you paste some code where you are building some multi-level BOM with more than 2 components. Your help will be greatly appreciated.

Thanks,

Kris