cancel
Showing results for 
Search instead for 
Did you mean: 

Logic to use to distinguish Stock and Non stock shopping cart line items

Former Member
0 Kudos

Hi All,

Iam asking this question I raise early this week but did not get a resolution.

We have a requirement to prevent our users from not raising stok and non stock line items in the same cart. We would like separate carts for stock only and non stock only.

Stock carts will be subject the auto approval workflow and generated as reservations in the R3 backend system. For this to be possible we need to imply some logic in the check BADI to error when a requisitione attempts to save a cart with mixed stock types.

What logic should we imploy given that Stock items could be pulled in from a catalog not directly from the Internal Products option. Please note that we replicate, HAWA, NLAG, UMBW and Dien materials, service masters and create catalogue items for these to enable easy buying from the requisitioner.

Question.

When a materials are rep;icated as products into SRM, is the the Material type replicated too. If so which table stores this info for in SRM?. I have looked in the COMM_Products table, rthere is no equivalent of a material type.

Any help will be greatly appreciated.

Thanks,

Grace

A

user.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Grace

Just followed your thread and maybe I don't get it right... but:

Isn't it suitable for your needs to customize the backend document determination such as to specify for internal procurement to set "create a reservation if stock available, else external procurement" and in external procurement to set "create purch.req. in case of incomplete item data, else create PO"?

(sorry if wording doesn't correspond exactly, just translated it from a german project document I wrote as I don't have the system in front of me right now)

This could probably also solve the need for you to create separate shopping carts for stock / non stock materials, because non stock materials will never have available stock and thus not a reservation but a PO or purch.req. would be created in your backend.

HTH

Renaud

Former Member
0 Kudos

Renaud,

In customising, we have settled the setting "Create reservation always" for stock whether or not there is stock availabilty in the R3 backend. Stck is antomatically replenished via MRP or manual R3 POs.

I think the soltion the Yann suggested is bar far the best and "safest" where we will implement the BBP_DOC_CHECK_BADI to do a RFC lookup of the backend system to check the material type of a given material based cart item. If the material type is HAWA for example, the logic will be that at save that "stock" cart will be subject to the auto approval workflow. Also if the first line item in a give cart is "stock" the BBP_DOC_CHECK_BADI will prevent the saving of the cart if non stock line items also exist.

I will keep you all informed when this solution is developed.

Thanks,

Grace

Former Member
0 Kudos

Hi Grace,

Renaud proposition is really interesting, but as you want to control the process before the SC approval, you could also call the same logic (META_INTERPRETE_DATA) in the CHECK BADI.

If you want to control the material type, and replicate all your materials in SRM, then follow Disha proposition (read category MAT_ from hierarchy R3PRODSTYP), as the material type is replicated in SRM. This would avoid a RFC call to R/3 for nothing.

Rgds

Christophe

yann_bouillut
Active Contributor
0 Kudos

Hi Grace,

Are all stock items in a specific catalogue ?

If yes, you can use BBP_DOC_CHECK badi and read the catalog ID value at item level to identify the stock items.

Kind regards,

Yann

Former Member
0 Kudos

Yann,

As usuall you have a solution. At the moment there is no separate catalogue for stock items. I will make that happen and as you said use the BBP_DOC_CHECK badi at itam level to identify the stock items using the catlog ID.

Question,

If the stock items are from the option Internal Goods/services and here we will have a mixture of inventory stock (HAWA Materail type) and non stock i.e NLAH material type, what login should we imply in th BBP_DOC_CHECK badi? Iam trying to design a catch all solution.

Thanks,

Grace

yann_bouillut
Active Contributor
0 Kudos

Hi Grace,

From the badi, you can read backend material data and identify stock from non stock items.

I give you this solution as i do not have a system right now to check if material type are available in EBP tables...

Kind regards,

Yann

Former Member
0 Kudos

Yann,

Your solution also sounds good to me,I will get our ABAPER to code both your logics in the Check badi and see how get on.

I will let you know how we get on.

Please when you do get access to a system, please let me know if any tables in SRM exit that record a material master type.

Thanks again.

Grace

yann_bouillut
Active Contributor
0 Kudos

Hi Grace,

to read backend data, you can use function module META_MATERIAL_READ.

Kind regards

Yann

Former Member
0 Kudos

Yann,

Thanks for that function module info.

Grace

Former Member
0 Kudos

hi Grace,

I have implemented a similar kind of reqt where the Product category for the Items added in the SC should be same.

But what we did it is we had to use both the BADi's i..e. BBP_DOC_CHECK_BADI as well as BBP_DOC_CHANGE_BADI.

Also,the material types(product Types) for the Products replicated frm the BAckend are stored in the table view BBPV_F4PR_GEN.

Hope this helps you.

Regards,

Disha.

Former Member
0 Kudos

Disha,

Thanks for your reply. I have looked into table BBPV_F4PR_GEN. The product type mentioned here is not the type the material is based on in R3. I R3 materials must be based on a material type e.g HAWA, NLAG, RAW, DIEN etc etc.

A material based on HAWA is a stock(inventory managed) material. So when if a requisitioner raised a shopping cart fort this item/product, we expect this to convert to a reservation in the r3 backend.

A material based on NLAG is a non stok(not kept in inventory) so when if a requisitioner raised a shopping cart fort this item/product, we expect a PO to be raised in the backend.

So in cut a long story short, iam looking for an SRM table that will hold the replicated material/product and the R3 Material type i.e HAWA, NLAG etc etc.

Thanks

Former Member
0 Kudos

Hi,

In the table view BBPV_F4PR_GEN,for each material(Product),we have two records stored based on the "Hierarchy".

If ur hierarchy is "R3MATCLASS",u get all the products acc to their Product Group/Material grp(in field Category_id) whereas

if ur hierarchy is "R3PRODSTYP",u get all the products acc to their Product type/Material type(in field Category_id).

The product type are stored in the format "MAT_name of mat type" for materials and "SER_name of the servcie type" for Services.

So u just need to find teh characters of ur Materials/Servcie Type in the Category ID field form the table BBPV_F4PR_GEN.

Regards,

Disha.

Former Member
0 Kudos

Hi,

Also what you can do is modify the std Product Search to display only "STOCK "items.

So with this you will not need to implement the BADI also.

Regards,

Disha.