cancel
Showing results for 
Search instead for 
Did you mean: 

How can I add a new field in the MB52

shahad009
Participant
0 Kudos

Hi Experts,

My requirement is that I have to add a new field named "Supplier batch" to the MB52 which is a standard program.

Now, it is my first time working in a standard program. When I tried to open the source code in change mode it's asking for an access key.

What Should I do?

Ho can I achieve my requirement?

Regards

venkateswaran_k
Active Contributor

Hi shahad009

You cannot directly change any standard code. As per your requirement , if you want to enhance the stndard code MB52, the procedure is to go for Enhancement.

There is one blog that explains the steps to do it. Please go through this .

https://blogs.sap.com/2022/02/01/how-to-add-customer-specific-fields-into-mb52/#:~:text=*%20Adding%2....

Regards,

Venkat

shahad009
Participant
0 Kudos

hi venkateswaran.k,

I went through the blog even before asking the question.. but i could not undersatand....

shahad009
Participant
0 Kudos

hi venkat,

any suggestions?

venkateswaran_k
Active Contributor
0 Kudos

Hishahad009

The blog which I sent you is one of the example.

Do you have any idea / experience on any enhancements done so far. Because it is more of enhancing the standard object. It is not difficult but to be done carefully.

Please let me know the gap where you want the assistance.

shahad009
Participant
0 Kudos

pls check inbox.

shahad009
Participant

hi venkateswaran.k,,

I tried to add the field as per the blog link u shared... but its not working.

First, I created an enhancement to the bestand structure to add the field and then

I tried to populate the field in the list_output routine as per described in the blog.

I am attaching two files here ... mb52.jpgmb521.jpg

venkateswaran_k
Active Contributor
0 Kudos

Okay,, I did it right,

Now you need to add this field to the field catalog.

Then it will come to the output.

shahad009
Participant
0 Kudos

u did it right? what?

Could not undersatnd?

Also,, where should i write the code for filedcat?

regards

venkateswaran_k
Active Contributor

What I said was, so far you did correct in enhancement implementation.

Now to bring the column to the output, in that program you find there is a place called

FORM field_catalog.

In that, you will see the line """""" for creating enhancement code.

Insert the code to have this new column also

Accepted Solutions (1)

Accepted Solutions (1)

venkateswaran_k
Active Contributor
0 Kudos

Hi shahad009

To complete this enhancement you need to the following

1. Enhance the portion - structure BESTAND - to include your new field - you have done..

2. Enhance the portion to populate the value this field - you have done

3. Now you need to add this field to the output - which is Field Catalog ( normally you do it for ALV) -

for that you do as below in the section - ( Put enhancement code here as below )

  fieldcat-fieldname     = 'YOUR NEW FIELD'.
  fieldcat-tabname       = 'BESTAND'.
  fieldcat-ref_tabname   = 'CHARG'.
  fieldcat-no_out        = ''.
  APPEND fieldcat.

and make sure you activated all the enhancement codes.

After that Execute the MB52 - you can see the column in output.

Regards,

Venkat

venkateswaran_k
Active Contributor
0 Kudos

Hi shahad009

I just noticed now, you are asking about the Batch number column. This is already present in the standard report MB52. What is the new column that differs from this?

Please confirm

Answers (1)

Answers (1)

shahad009
Participant
0 Kudos

hi venkat,

The batch number already in the mb52 report is SAP standard batch number means in which batch material is being received and vendor batch/ supplier batch is in which i tried to add in the mb52 is the batch number u get from the vendor.

So, these two batch numbers are two different things.

venkateswaran_k
Active Contributor
0 Kudos

shahad009 Okay,

Did you try with field catalog as I mentioned above

shahad009
Participant
0 Kudos

hi venkat,

yes I tried... the column vendor batch is showing in hidden fields in the mb52 repot.

venkateswaran_k
Active Contributor
0 Kudos

shahad009

Okay, These are all the options.

1. You bring the column to the layout and save the layout as /default or some other name and inform the use to use that layout.

2. Else, in Field catalog of that Column - make sure the NO_OUT is marked as blank. It should not be 'X'.

Regards,

Venkat

shahad009
Participant
0 Kudos

Hi venkat,

got ur point... thanks mate.

venkateswaran_k
Active Contributor
0 Kudos

Hi shahad009

Is your enhancement completed for MB52 ?

shahad009
Participant
0 Kudos

yes, it is completed.