Skip to Content
-1

Custom fields in Material Master to Z table

Nov 01, 2017 at 07:09 AM

125

avatar image
Former Member

Hi,

Is there any way that I can add custom fields in the material master (MM01/MM02) without appending the MARA table ? Can we use ztable instead ?

in the PBO, we call the data from the ztable into the screen fields (ztable-zfield)

in the PAI, we save the data into the ztable from the screen fields.

i tried it but the system is generating the following error, during PBO:

"T_MAKT-" expected, not "ZTHM_MAT-"

thanks,

10 |10000 characters needed characters left characters exceeded

What's wrong with using an append structure?

Why make things more difficult by reinventing the wheel (and a square one at that)?

Edit: removed "In the database they're held as separate tables with the same key." as this apparently isn't the case.

4

"[append structure] In the database they're held as separate tables with the same key."

Really? How do you explain that the native SQL query "SELECT * FROM mara" returns those fields declared in the append structure? (i.e. it's not in the ABAP Dictionary only, it's in the database table)

2

I don't. I just test in HANA and the field is added. I either misremembered, or things have moved on. I suspect the former.

2

I see. So, your statement would be valid for HANA - I never worked with HANA - (is it for all tables or for some of them? Those tables which have "replacement objects" as explained in blog post https://blogs.sap.com/2016/07/11/appending-tables-in-s4hana-easy-mbew/, especially in Horst Keller's comment) So, it could be database-dependent - I didn't know that -

0

No. My original statement is not valid for HANA. I was wrong in my understanding.

1
Former Member

Actually, we are implementing in a large group of companies (12 companies) with different LOBs. We have gone live for the first company and working for the second in the same landscape. There is a requirement of 8 fields to be added in the material master and there would also be the same requirement in future.

The reason for going for ztable is not to make the MARA table so much crowded with the customized fileds of different businesses.

however i was not aware of this:

"In the database they're held as separate tables with the same key."

But when i tested, the system is showing the customized fields in the MARA table. Can u clarify on this ?

thanks for the response

0

Data dictionary presents it as part of MARA. That's all. You understand the difference between "the database" and "data dictionary"?

0
Former Member
Matthew Billingham

sorry Mathew, i mistakenly deleted your comment.

so what should be the solution ? is there any possibility of the above ?

we have the HANA DB.

0

There is no solution as such. It seems I was wrong in believing that seperate tables are created.

However, I still do not see why in your scenario you cannot use append structures anyway.

0

Maybe Muhammad should ask another question under the HANA database tag : "is there any drawback to add 12 * X fields to a table in a HANA database, as there is a large group of companies (12 companies) with different LOBs [explaining more about why you mind about the Large OBjects]"

2
"The reason for going for ztable is not to make the MARA table so much crowded with the customized fields of different businesses."

What exactly is the problem with "crowding"? This reminds me of a popular Russian joke where a guy goes to a doctor and complains that one of his testicles hangs 2 mm lower than the other. When the doctor asks why is this a concern, the guy says: "well, it's just kind of not neat". Same here - is this so important to have a "neat" MARA? :)

Anyways, we can always just weigh in pros and cons to arrive at a decision.

Add fields to MARA. Cons: "crowding" (whatever this means); pros: very little custom ABAP, easy to add to the reports, simple SELECT, use all standard functionality that is available with MARA.

Add Z table. Pros: MARA not "crowded". Cons: have to write your own code for all the updates, locking, etc. Will need to document and constantly remember it's part of material master. Can't use SE16 with MARA, would need a custom view. For archiving, extra work to include Z table. (This part goes on, this is just from the top of my head.)

1
* Please Login or Register to Answer, Follow or Comment.

0 Answers