In this document a step-by-step guide for adding customer (Z-) fields to Purchase Orders that are displayable and modifiable either in header level or in item level.

  • We start by adding enhancement MM06E005 to a project in transaction CMOD and activating it.

/wp-content/uploads/2015/09/pic1_800746.png

/wp-content/uploads/2015/09/pic4_800749.png

  • We create structures CI_EKKODB (header level) and/ or CI_EKPODB (item level) by double-clicking on the corresponding line under “Include tables”, and add to them the fields that are of interest to us, e.g. ZZFIELD1 and ZZFIELD2 respectively. We save and activate.

Pic2.png

/wp-content/uploads/2015/09/pic3_800750.png

  • We create screens SAPLXM06 0101 (header level) and/ or 0111 (item level) by double-clicking on the corresponding line under “Screen exit”,  and add the customer fields defined in the previous step using the structures CI_EKKODB/ CI_EKPODB (and NOT EKKO/ EKPO), e.g. CI_EKKODB-ZZFIELD1/ CI_EKPODB-ZZFIELD2. We save and activate.

/wp-content/uploads/2015/09/pic5_800751.png

  • Using SE38 we go to include LXM06TOP  (main program SAPLXM06) and double-click on include ZXM06TOP in order to create it.

/wp-content/uploads/2015/09/pic6_800752.png

  • We add the following variable declarations that will be used for holding the information whether we create/ change/ display a purchase order:

For item level:

TABLES: ci_ekpodb.
DATA
: gw_aktyp.

For header level:

TABLES: ci_ekkodb.
DATA
: gw_trtyp.

/wp-content/uploads/2015/09/pic7_800753.png

  • We now want to implement the transfer of information from the purchase order to our newly created customer screen and store activity type (i.e. create/ change/ display). To achieve that in CMOD we double-click on EXIT_SAPMM06E_006 (header level)/ EXIT_SAPMM06E_016 (item level), and double-click on include ZXM06U36/ ZXM06U41, respectively, in order to create it. Then, we add the following code:

For item level:

MOVE-CORRESPONDING i_ci_ekpo TO ci_ekpodb.
gw_aktyp = i_aktyp.

For header level:

MOVE-CORRESPONDING i_ci_ekko TO ci_ekkodb.
gw_trtyp = i_trtyp.

/wp-content/uploads/2015/09/pic8_800754.png

  • We now want to implement the transfer of information from our newly created customer screen to the purchase order. To achieve that in CMOD we double-click on EXIT_SAPMM06E_008 (header level)/ EXIT_SAPMM06E_018 (item level), and double-click on include ZXM06U37/ ZXM06U40, respectively, in order to create it. Then, we add the following code:

For item level:

MOVE-CORRESPONDING ci_ekpodb TO e_ci_ekpo.

For header level:

MOVE-CORRESPONDING ci_ekkodb TO e_ci_ekko.

  • Finally on the PBO of the newly created customer screens we add a module with the following code in order to render non-modifiable the Z-fields when the purchase order is being displayed (and not changed/ created). A new include is created for the PBO module.

gw_trtyp is used for header level and gw_aktyp for item level:

IF gw_trtyp EQ ‘A’. “gw_aktyp = ‘A’.

  LOOP AT SCREEN.

    screeninput = ‘0’.

    MODIFY SCREEN.

  ENDLOOP.

ENDIF.

/wp-content/uploads/2015/09/pic9_800755.png


/wp-content/uploads/2015/09/pic10_800777.png

Now we are ready to check our new field under the tab “Customer Data”:

/wp-content/uploads/2015/09/pic11_800783.png

To report this post you need to login first.

Be the first to leave a comment

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

Leave a Reply