Introduction

This document explains how to display a customer field in the BOM transactions CS01, CS02, CS03, CS11, CS12, and CS13 in ECC 6.0 EHP 5. The requirement is to display a custom field from the MARA table, ZZ_OLD_MATERIAL.

CS11

First, let’s look at CS11. The program for CS11 is RCS11001. The ALV Grid is displayed in the output of CS11 by a call to FM REUSE_ALV_GRID_DISPLAY in Subroutine CS11_ALV of program RCS11001.

/wp-content/uploads/2014/05/a1_453094.png

Note the t_outtab parameter in TABLES is assigned alv_stb. Also, the it_fieldcat parameter in EXPORTING is assigned stb_fields_tb.

In order to add ZZ_OLD_MATERIAL to CS11 we need to do three things:

  1. Add ZZ_OLD_MATERIAL to the output table alv_stb
  2. Populate ZZ_OLD_MATERIAL in alv_stb with values from MARA
  3. Add ZZ_OLD_MATERIAL to the field catalog table stb_fields_tb

1. Add ZZ_OLD_MATERIAL to the output table alv_stb

Internal table alv_stb is defined as follows:

/wp-content/uploads/2014/05/b1_453125.png

Structure STPOX_ALV has a means of adding customer fields to it in Include structure CI_STPO.

/wp-content/uploads/2014/05/c1_453126.png

Double-click CI_STPO to create the structure. Enter ZZ_OLD_MATERIAL as a Component.

/wp-content/uploads/2014/05/d1_453127.png

Check and Activate Structure CI_STPO. This may take some time as CI_STPO is used in many tables.

Now ZZ_OLD_MATERIAL is a field in alv_stb.

2. Populate ZZ_OLD_MATERIAL in alv_stb with values from MARA

The alv_stb table is populated from internal table stb in the following lines of code from subroutine CS11_ALV:

/wp-content/uploads/2014/05/e1_453128.png

If you check how stb is defined you will notice that ZZ_OLD_MATERIAL is available to us.

Click the Enhance icon, then select menu option Edit>Enhancement Operations>Show Implicit Enhancement Options.

/wp-content/uploads/2014/05/f1_453129.png

Right click on the “”””””” and select Enhancement Operations>Create Implementation.

/wp-content/uploads/2014/05/g1_453130.png

Click Declaration for Type of Enhancement.

/wp-content/uploads/2014/05/h1_453131.png

Click the Create Enhancement Implementation icon.

/wp-content/uploads/2014/05/i1_453132.png

Enter a name for the Enhancement Implementation and Short Text. I entered Z_RCS11001_1.

/wp-content/uploads/2014/05/j1_453133.png

Select your Enhancement Implementation

Enter the following code between ENHANCEMENT and ENDENHANCEMENT:

/wp-content/uploads/2014/05/k1_453134.png

Save, Check, and Activate the Enhancement.

This will populate stb- ZZ_OLD_MATERIAL which will get passed to alv_stb- ZZ_OLD_MATERIAL in PERFORM alv_stb_prep.

3. Add ZZ_OLD_MATERIAL to the field catalog table stb_fields_tb

The field catalog, stb_fields_tb, is set in subroutine stb_fields_tb_prep. We need to enhance the subroutine so that CS11 will display ZZ_OLD_MATERIAL. The following screenshot shows the place for the Implicit Enhancement at the end of FORM stb_fields_tb_prep.

/wp-content/uploads/2014/05/l1_453135.png

 

Right click on the “”””””” and select Enhancement Operations>Create Implementation.

Click Declaration for Type of Enhancement.

You can use the same Implementation created earlier. This will be Enhancement 2. Enter the following code between ENHANCEMENT and ENDENHANCEMENT:

/wp-content/uploads/2014/05/m1_453136.png

Save, Check, and Activate the Enhancement.

Now our custom field is in the field catalog to be displayed in column 5.

Execute CS11 to see the new field.

CS12 and CS13

You will need to do the same Enhancements for CS12 and CS13. CS12 uses program RCS12001. The FORMs to Enhance are called CS12_ALV and STB_FIELDS_TB_PREP. CS13 uses program RCS13001 and the FORMs are CS13_ALV and STB_FIELDS_TB_PREP. When you Enhance STB_FIELDS_TB_PREP in RCS12001 and RCS13001, make note of the fields that are displayed because they are different than RCS11001.

CS01, CS02, and CS03

After making the changes above for CS11, CS12, and CS13 I executed CS03 and noticed ZZ_OLD_MATERIAL on the standard screen of the Material tab (screen 0152) to the right of the Group (Grp) field. I thought I would have to use Enhancement PCSD0002 to display my custom field in CS03. PCSD0002 is the Enhancement to add your own BOM item fields. But I didn’t like that PCSD002 would display my custom field on a new tab other than Material. This field was for display purposes only so I didn’t need to worry about changing the field value. Now I just needed to populate it.

In Function Group CSDI, open Include LCSDIFFK. There you will see FORM STPOB_LESEN with a call to function module CS_BT_STOB_READ.

/wp-content/uploads/2014/05/n1_453143.png

Note the FM returns structure STPOB. STOB already has ZZ_OLD_MATERIAL as a field.

Create an Implicit Enhancement at the end of the FORM. Enter the following code between ENHANCEMENT and ENDENHANCEMENT:

/wp-content/uploads/2014/05/o1_453144.png

Save, Check, and Activate the Enhancement.

Still need to Activate Enhancement PCSD0002.

For some reason we still have to Activate PCSD0002. Actually, it’s because of the line 85 below in FORM D0150_INIT_02 in Include LCSDIF3Z:

/wp-content/uploads/2014/05/p1_453145.png

If PCSD0002 is not Active, the program will not fill field <D0152-FS1> (our custom field) from stpob-ZZ_OLD_MATERIAL in the subsequent lines of the form.

Activating PCSD0002

Go to CMOD and create a Project. Add Enhancement PCSD0002. We have to create screen 1000 so go to the Components.

/wp-content/uploads/2014/05/q1_453149.png

Double click screen 1000. All that is needed is a Short Description and to change the Screen Type to Subscreen.

Save, Check, and Activate the screen.

Different original and logon languages

You may now get several pop-up messages regarding different original and logon languages.

/wp-content/uploads/2014/05/r1_453150.png

At the ‘Different original and logon languages’ pop-up click Change orig. language.

/wp-content/uploads/2014/05/r2_453151.png

Click Continue.

/wp-content/uploads/2014/05/r3_453152.png

Click the green check.

/wp-content/uploads/2014/05/r4_453153.png

Click the green check.

/wp-content/uploads/2014/05/r5_453154.png

Finally, click Yes.

Activate the Project.

You do not need to place any code in the EXIT FMs. This custom field is for display only.

ExecuteCS01, CS02, CS03 and you should see your custom field populated on the standard screen of the Material tab.

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Kyoung-Joon Chu

    I would like to ask you some following things.

    Plz share your excellent knowledge~ 🙂

    1. After “Activating PCSD0002”, as you mentioned,

       Can’t we still show customer tab for item?

    2. We need to maintain some customer fields(CI_STPO), so we add customer tab for item

        via PCSD0002. and there is no problem using CS01,2,3.

        additionally we use some enh.spot to hide customer tab in some cases(ex. each plat).

        as you know, it has different screens for item between BDC(CS01) and CS01.

        How can we hide customer fields info when we execute BDC(CS01) in some cases?

        we can’t find any enh.spot for this. 🙁

    Thanks in advance.

    (0) 

Leave a Reply