0
votes

I'm having trouble figuring out why two custom fields are not showing up in transaction VA05 (its output to be specific).

Before reading below: I didn't make any changes to the program because I wasn't assigned to this task. One of my colleagues did this change.

I followed this tutorial, which explains how to expand the VA05 output table with custom fields.
I didn't actually followed this guide. I followed this tutorial only to understand what my colleague might have done to achieve what we need and what might be needed to fix the issue.

So, as the tutorial suggests, this is what should be done in short:

  • Go to SE11 and search for VBEP Database table and click display.
  • Click on Append Structure
  • Click on Create Append
  • Insert the name of the append name, in my case it's ZZVBEP_MECC
  • Insert two fields: ZZDELIVERYDATE and ZZREQDELIVERYDATE
  • Save and activate

If you go to VBEP table now, you'll see at the bottom the field .APPEND with the column Data Element set to ZZVBEP_MECC.

Now, following the tutorial, the include program V05TZZMO need to be changed, and here's ours:

***INCLUDE V05TZZMO .
* This form is called in the include LV05TFMO.
FORM MOVE_USERFIELDS USING ZP.
  CASE ZP.
    WHEN 'VBAK'.

    WHEN 'VBAP'.

      CHECK LVBAP-PSTYV NE 'ZRAC'.
      CHECK LVBAP-PSTYV NE 'ZCAC'.     "Escl.acconti
      MOVE LVBAP-KDMAT TO LVBMTV-ZZKDMAT.
      PERFORM OFFENE_AUFTRAGSMENGE.

     SELECT SINGLE * FROM VBKD WHERE VBELN = LVBAP-VBELN.
      IF SUBRC = 0.
      MOVE VBKD-KDGRP TO LVBMTV-ZZKDGRP.
      ENDIF.

    WHEN 'VBEP'.
      MOVE LVBEP-ZZDELIVERYDATE    TO LVBMTV-ZZDELIVERYDATE.
      MOVE LVBEP-ZZREQDELIVERYDATE TO LVBMTV-ZZREQDELIVERYDATE.
  ENDCASE.
ENDFORM.

When I run VA05 however, these two custom fields are not there nor are in the Change Layout screen.

Is it possible that the code in V05TZZMO is not in the right place? Looking at the tutorial's code I saw that they put those statements in WHEN 'VBAK' instead of WHEN 'VBEP'.

Also, the ENHANCEMENT 1 ZZ_SD_VBAK_VA05 is not present in my code.


There might be something I missed. As I said above, I didn't make these changes so I cannot tell exactly what my colleague did.

2
The tutorial doesn't say anything about VBEP. Could you edit and clarify your question pleas?Sandra Rossi
@SandraRossi That's the problem. I don't know whether what my collegue did was a mistake or else. What table should be used? VBAK?Diego

2 Answers

2
votes

Custom fileds also must be included in the structure VBMTVZ.

Regards

0
votes

Finally solved.

Here's the procedure step-by-step we followed in order to fix the issue:

Create an Append Structure

  • Go to TCode SE11 and open database table VBMTVZ
  • Click on Append Structure...(It's in the program's toolbar) - or Goto > Append Structure
  • Create a new Append Structure(There's a button for it)
  • Enter the name of the structure(in our case was ZZVBMTVZ_MECC
  • A new structure is then created. Enter the needed components/fields
  • Save and activate the structure.
  • Note: To check if the structure is actually appended, go back and open table VBMTVZ again. At the end of the list of fields there must be one field called .APPEND with the type set to the name of the structure you created. After this field, there's also all your fields you created on that structure. See the image below for reference.

Append structure reference

Change V05T program

Now you'll need to make some changes to the program linked to the TCode VA05.

To do this:

  • Go to TCode SE80.
  • Select Function Group and insert V05T as the name of the group.
  • Open the sub-folder called Includes and look for V05TZZMO
  • Open this include file in change mode.
  • The file should look like this:
***INCLUDE V05TZZMO .
* This form is called in the include LV05TFMO.
FORM MOVE_USERFIELDS USING ZP.
  CASE ZP.
    WHEN 'VBAK'.
*     header
*     MOVE LVBAK-XXXXX TO LVBMTV-ZZXXXXX.

    WHEN 'VBAP'.
*     item
*     MOVE LVBAP-XXXXX TO LVBMTV-ZZXXXXX.

    WHEN 'VBEP'.
*     schedule line
*     MOVE LVBEP-XXXXX TO LVBMTV-ZZXXXXX.

  ENDCASE.
ENDFORM.

Add the following line of code to the WHEN 'VBEP'. code block.

MOVE LVBEP-name_of_your_field TO LVBMTV-name_of_your_field

You need to add that line for each field you appended.

In my case, the final result was the following:

***INCLUDE V05TZZMO .
* This form is called in the include LV05TFMO.
FORM MOVE_USERFIELDS USING ZP.
  CASE ZP.
    WHEN 'VBAK'.
*     header
*     MOVE LVBAK-XXXXX TO LVBMTV-ZZXXXXX.

    WHEN 'VBAP'.
*     item
*     MOVE LVBAP-XXXXX TO LVBMTV-ZZXXXXX.

    WHEN 'VBEP'.
*     schedule line
*     MOVE LVBEP-XXXXX TO LVBMTV-ZZXXXXX.

  move LVBEP-zzdeliverydate to lvbmtv-zzdeliverydate.
  move LVBEP-zzreqdeliverydate to lvbmtv-zzreqdeliverydate.

  ENDCASE.
ENDFORM.

Save the file and activate the program.

At this point you should be able to see your fields in the output of TCode VA05.


Notes

In order to be able to change the include program V05TZZMO you need an Access Key. Without that you cannot change the program.

If the fields you appended aren't showing even after activating, try:

  • To logout and log back in or
  • reset the buffer with this TCode /$SYNC