ABAP FM Copy Class Assigment from Reference Material to another Material (BAPI_OBJCL_CREATE)

In this blog post, I will share a very useful function module, which will help you copy material class assigment easliy. It takes a reference material and the class, and copies this assignment to the new material.

I used BAPI_OBJCL_GETDETAIL, BAPI_OBJCL_CREATE standard BAPI’s.

Here is the source code:

ZMA_F_ASSIGN_CLASS_WITH_REF

Import Parameters:

P_MATCFG
TYPE
MARA-MATNR
Reference Material

F_MATNR
TYPE
MARA-MATNR
The Material to Assign Class

OBJECTTABLE
TYPE
BAPI1003_KEY-OBJECTTABLE
Name of database table for object

CLASSNUM
TYPE
BAPI1003_KEY-CLASSNUM
Class number

CLASSTYPE
TYPE
BAPI1003_KEY-CLASSTYPE
Class Type

function zma_f_assign_class_with_ref. *“———————————————————————- *”*“Local Interface: *” IMPORTING *“ REFERENCE(P_MATCFG) TYPE MARA-MATNR *” REFERENCE(F_MATNR) TYPE MARA-MATNR *“ REFERENCE(OBJECTTABLE) TYPE BAPI1003_KEY-OBJECTTABLE *” REFERENCE(CLASSNUM) TYPE BAPI1003_KEY-CLASSNUM *“ REFERENCE(CLASSTYPE) TYPE BAPI1003_KEY-CLASSTYPE *”———————————————————————- data: allocvaluesnum like table of bapi1003_alloc_values_num, allocvalueschar like table of bapi1003_alloc_values_char, allocvaluescurr like table of bapi1003_alloc_values_curr, return like table of bapiret2, objectkey like bapi1003_key-object. move p_matcfg to objectkey. call function ‘BAPI_OBJCL_GETDETAIL’ exporting objectkey = objectkey objecttable = objecttable classnum = classnum classtype = classtype tables allocvaluesnum = allocvaluesnum allocvalueschar = allocvalueschar allocvaluescurr = allocvaluescurr return = return. move f_matnr to objectkey. refresh return. call function ‘BAPI_OBJCL_CREATE’ exporting objectkeynew = objectkey objecttablenew = objecttable classnumnew = classnum classtypenew = classtype tables allocvaluesnum = allocvaluesnum allocvalueschar = allocvalueschar allocvaluescurr = allocvaluescurr return = return. data: ls_bapiret2 type bapiret2. call function ‘BAPI_TRANSACTION_COMMIT’ exporting “wait = ‘X’ wait = ‘X’ importing return = ls_bapiret2. endfunction. http://bit.ly/2hFJTdX #SAP #SAPCloud #AI

3 Ways Technology can Transform Your Company into a Sustainable Business

As the digital age continues to change the way we do business, companies must adapt to rapidly changing times by implementing a way to transform traditional businesses into resilient and financially viable companies.

One way global organizations are trying to achieve longevity and financial viability, no matter what industry they belong to, is by switching to more sustainable practices and processes. This means adopting a business model that reduces environmental impact and boosts operational efficiency, ultimately raising profit and improving the business’s bottom line.

The Role of Technology in Creating a Sustainable Business

Technology plays a vital role in making any type of business sustainable. Whether you’re a retail company, manufacturing company, or even a food company, technology opens doors to innovations that could make the transition to sustainability more feasible. Here are three ways technology can transform your business into an environmentally friendly, operationally efficient and highly profitable company:

1. Use Smart Tech to Cut Down Expenses

Smart technology such as smart lighting, climate control, and power use can help companies lessen their environmental impact while reducing electric consumption. These smart innovations often rely on sensors to determine whether or not space is being used. It can also be controlled remotely, using an app that can be accessed via any gadget.

Moreover, a smart office becomes smarter and more efficient over time, especially as you introduce and connect it to other devices. These types of energy-saving devices ensure that no energy is wasted and that all electronic devices are used optimally.

2. Outsource Your Operations to Streamline Costs and Workload

Although outsourcing also entails the participation of professionals, various software and business intelligence platforms also make it possible to streamline work that’s otherwise expensive when managed or implemented in-house.

By outsourcing some non-core business operations, companies may earn huge savings by cutting down on rentals, overhead costs, payroll and other operational expenses. It is also a practical way to ensure that services are delivered efficiently, using a cost-effective way.

In addition, apart from the common outsourcing services we are familiar with, it is also possible to outsource processes that involve document management and knowledge processing. An example of this is a company called Net Lawman. The company provides access to an online library of high-quality legal document templates and legal information articles that businesses can edit and use, instead of hiring an actual professional, which can turn out to be more expensive.

Outsourcing companies that provide similar services to that of Net Lawman, takes away the legwork from businesses, giving them more time to focus on their core offerings.

3. Invest in Cloud Computing

Cloud computing has been on a steady rise since the concept was introduced by Larry Ellison and his colleagues in the 1990s. As of 2016, the private cloud adoption rate is at 77 percent, while enterprise adoption is at 31 percent, and for a number of good reasons.

Cloud services minimize the use of physical space, as well as other resources that can be a source of both environmental emissions and unnecessary operational costs. Even a study commissioned by Microsoft shows that the IT sector alone can reduce its greenhouse gas emissions to 4.5 megatons if 80 percent of global enterprises powered down their local servers and switched to cloud computing.

Pushing businesses towards a more sustainable direction holds many benefits especially in terms of customer satisfaction, overall operations, environmental impact, and business performance. In addition, although some suggestions may require investing in expensive software or having to pay a fee for various services, it will still be more affordable compared to regularly spending for in-house support and maintenance.

Furthermore, switching to sustainability doesn’t always require purchasing software or technology. Every single person in a company can contribute and practice sustainability in their own little way. It could be by bringing a reusable cup to work or cutting down on paper waste; we all have the capacity to become better employees and business people by choosing to practice a sustainable way of life. http://bit.ly/2hIHHm5 #SAP #SAPCloud #AI