Wednesday, February 2, 2011

Adding custom fields to the transaction CS01,CS02 and CS03 (Bill of Materials)

Requirement: Customer wanted to add two new fields Country and Vendor number to Bill of materials header level.

Procedure: We need to add customer specific fields to BOM header level, first we need to add these two fields to BOM header record table i.e. STKO, then create a sub screen two hold these two fields and write the corresponding logic in the Functional exits provided.

The above steps are explained below in Detail.

STEP 1: Create an Append structure for table STKO.

Go to SE11 and provide table name STKO.

Click on button Append structure

Give name for Append structure “ZSTKO”

Add new fields to Append structure. ZZLAND1 and ZZVENDOR

Check and Activate the append structure.

A list of tables adjusted will be displayed.

STEP 2: Find an Enhancement for BOM.

Bill of materials transaction CS01/02/03 is assigned to package “CS”.

We can search for relevant Enhancements in CS package.

Go to transaction SMOD then go to Utilities-> find.

In the search box provide Package name as “CS”

Then Execute. You will get list of available Enhancements for the given package.

With the given short text or the enhancement we can use Enhancement PCSD0003.

To see the Enhancement components press display button.

You can see Functional Module Exits, Function codes, Screen Areas in the next screen.

Select the relevant Enhancement and you can test the enhancement from SMOD transaction main screen.

STEP 3: Create a project for Enhancement.

Go to CMOD(Project management of SAP Enhancements)

In the Initial Screen give any name (ZTEST) for Project.

Then press create

In the Next screen fill description for project and save as local object/ save to a package.

Then Click on the enhancement assignments button

Add the selected enhancement there and enter then save.

Go to back to Attributes of Enhancement project ZTEST screen

Use COMPONENTS button to see the components for the enhancement.

From the above screen you can see Project and enhancement Implementation are in red color and other components also.

Double click on screen exit. It will take you to Screen painter.

Add customer fields to the screen.

Go to screen properties and mark it as sub screen.



Now go back to components.

Click on the function exit then press enter.

In the next screen you can see Function Module EXIT_SAPLCSDI_004

In the function Module you can see a Include ZXCSAU04.

Double click on the include

A warning message appears ignore it and press enter.

Include is ready to implement your code logic.

Double click on the USERDATA structure and

Add an append structure.

Add two customer fields to the Append structure.

Then go back to include and write your code logic.

Save include. Check and activate.

Then go back to components list.

Add code to another function exit.

We have implemented function exits and screen exit.

Then activate project.

When we activate the project red button will turn into green. Components will turn into green.

For change and display transactions change the screen parameters.

STEP 4: check the added fields in CS03 Display Bill of materials.

Go to CS03 and give any material number, Plant and BOM usage press enter.

Select header button to navigate to header window.

There you can see a tab “Customer fields” and two customer fields.




No comments:

Tutorials on SAP-ABAP

Adobe Interactive Forms Tutorials

Business Server Pages (BSP)

Userexits/BADIs

Web Dynpro for ABAP (Step by step procedure for web dynpro,Tutorials on Web Dynpro,)

ALV Tutorials

Blog Archive

goodsites