Skip to Content
Author's profile photo Joachim Rees

Appending Tables in S/4HANA – easy?! – MBEW

I recently wrote how I go about Appending MARA (adding custom fields) (in S/4HANA and elsewhere)- as this is kind of the prequel to this blog, you probably want to read it.

 

Now lets do something a little more complicated: Appending MBEW!

SE11, MBEW, Navigate to EMBEW, Append Structure….

 

Create an append, in it create an include with a dummy field.

 

Activate the include;

Activate the append.

 

But what is this? We get an error when activating the append!

 

2016-07-11 14_23_29-S4H_MBEW_error_Popup.jpg

 

Here’s the error:

2016-07-11 14_24_21-S4H (1)MBEW_Error_Log display.jpg

 

 

In SE11 everything looks just fine: the table is active, our field is there:

2016-07-11 17_14_40-S4H (3) se11_MBEW_Append_Field.jpg

 

 

But we had the error on activation, and we also can see that there’s a problem in the application e.g. when trying to call MEBW in SE16n, we get a dump:

2016-07-11 14_35_52-S4H (4) 100 MBEW_ Runtime Error - Description of Exception.jpg

 

So, what is to do now?

 

Note 2242679 kind of helps us on that topic, it tells us to create an EXTEND VIEW

 

But actually, I had to create as many as 4 extend views, just to get that 1 dummy field working (display it in SE16n) in MBEW:

 

extend view mbv_mbew_ext

extend view Mbv_Mbew_Basis

extend view mbv_mbew_case

extend view mbv_mbew

 

(I also noticed, that in the first two I had to give the tablename MBEW.[Fieldname], while in the last two just [Fieldname] worked ).

 

 

I did NOT have to use report NSDM_PROXY_SUBSTITUTION – after I created the 4 append-views, SE16n is working, and when checking MBEW in SE11 I get “No inconsistencies found” -> just like it should be.

 

 

Conclusion:

This really was a lot of work to do, just to add one filed – on the positive side, I think it hepled my understaning of the CDS-paradigm and how it is used in the S/4HANA data model a little.

 

Smal sidenote:

For appending MARC you just need 1 extend view, but there you do utilize report NSDM_PROXY_SUBSTITUTION. Maybe I write more about that some other day.

 

 

Have you already appended some tables or structures, and found strange behavior? Let us know about it!

 

Best

Joachim

Assigned Tags

      18 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Horst Keller
      Horst Keller

      Seems that you stumbled over replacement objects (the term proxy object is also in use but rejected in STERM).

      Using Extras -> Proxy Object in SE11 you can find out whether a CDS view is replacing a database table. If this is the case, Open SQL accesses the CDS view instead of the table itself. That's why after appending the table, you also have to EXTEND the view in order to match the corresponding requirements. In ABAP Release 7.50, the order of the columns in database table and replacement object have to be the same. In ABAP Release 7.51 at least this restriction is suspended.

      But I wouldn't say that this is general for "Appending tables in S/4 HANA" and it isn't the "CDS-paradigm" at all. Replacement objects should rather be an exception, where S/4 HANA application development has decided that it is feasible to use those instead of rewriting all the code in a way that the CDS views are accessed directly.

      Cheers

      Horst

      Author's profile photo Joachim Rees
      Joachim Rees
      Blog Post Author

      Thank you very much for your insight, Horst!

      I knew about the proxy object, and that I have to extend the respective CDS view (a colleague did it with MARC allready). 

      What really surprised me, is that in the case of MBEW I not only had I to extend mbv_mbew but another 3 CDS views it is build upon. Isn't there an easier way?

      Good to learn that from NW 7.51 the order of the columns can be different, so we will then no longer need report NSDM_PROXY_SUBSTITUTION, I guess.

      Also good that you point out that equipping a table with a proxy object is a design decision to be able to have old code work without altering it (to much), and other decisions (rewriting the code to match the new data model e.g. MATDOC) could be taken in the future!

      What I meant to say with " CDS-paradigm” is that a CDS-View (mbv_mbew) is build on top of another one (mbv_mbew) which again is build on top of yet  another one (mbv_mbew_basis) and so on.

      best

      Joachim

      Author's profile photo SW KaoOat
      SW KaoOat

      Hello,

      I need add some field in table 'MARC' but it's error on SE16 / SE16N .

      but I don't know how to create view, and how to run NSDM_PROXY_SUBSTITUTION.

      Author's profile photo Joachim Rees
      Joachim Rees
      Blog Post Author

      Hi supharoek,

      the mentioned Sap-Note https://launchpad.support.sap.com/#/notes/2242679 explains how to create the extend view (using Eclipse).

      Running report NSDM_PROXY_SUBSTITUTION is done with SE38.

      best

      Joachim

      Author's profile photo Ganimede Dignan
      Ganimede Dignan

      Hi,

      have you already try to delete and append to MARC on a S/4 SP2 system?

      I've already add an append with 3 new custom fileds but I want also try to delete...

      Regards.

      Author's profile photo Joachim Rees
      Joachim Rees
      Blog Post Author

      Hi Ganimede,

      no, I have not tried to delete any appends in S/4HANA yet...

      What behaviour do you experience when trying?

      (I guess you also have to delete the extend view, to make it consisten again...)

      best

      Joachim

      Author's profile photo Ganimede Dignan
      Ganimede Dignan

      >(I guess you also have to delete the extend view, to make it consisten again...)

      but... from Hana or from ABAP DDIC?

      Because I see that if I delete the append from MARC table on SE11 the append's fileds are deleted from MARC... but when I check NSDM_V_MARC view the append's fields still exist

      Author's profile photo Joachim Rees
      Joachim Rees
      Blog Post Author

      Again, only guessing:

      - Delete the Append-View in SE11
      AND
      - Delete the Extend-View in Eclipse/AdT*.

      (*I don't like to say "delete from HANA", as I never had to log on to the HANA database directly. With (ABAP-)CDS-View, all is done in AdT (ABAP development Tools -> Eclipse)

      best
      Joachim

      Author's profile photo Former Member
      Former Member

      @Joachim Rees

      Hi.Joachim.  I have a requirement that Add custom field ZZCF to Table MSEG,Include CI_COBL in S/4HANA OP1511.

      When i preview mseg data in se16, the system dumped.
      Error:
      DBSQL_REDIRECT_INCONSISTENCY
      A table could not be redirected.

      I followed the note 2242679 - Redirect inconsistency - Proxy Substitution.
      but I can't create an extend view.

      @AbapCatalog.sqlViewAppendName: 'ZADD_V'
      @EndUserText.label: 'ADD mesg'
      extend view NSDM_E_MSEG with ZADD_E {
          MATDOC.zzcf
      }
      

      The error is "View field ZZCF-NSDM_DDL_MSEG already exists in parent object(DDL source)"

      I confused, What should i do. Please help.
      Best regards.

      Author's profile photo Tom Iwanowski
      Tom Iwanowski

      James,

      did you resolve your CI_COBL in MSEG?

      where is the bug?

      I have to do the same - please help.

      Tom

      Author's profile photo Marius Stoica
      Marius Stoica

      Hi Joachim,

      I'm trying to create a new extended view for MBEW table and I get an error while trying to activate:

      Table name MSEG unknown or shadowed by an alias
      

      Here is my code:

      @AbapCatalog.sqlViewAppendName: 'ZMONEDA_CA_DDL_V'
      @EndUserText.label: 'Extension view for Append ZMONEDA_CA'
      extend view NSDM_E_MSEG with ZMONEDA_CA_DDL_E
      {
          MSEG.valoare as valoare,
          MSEG.moneda as moneda
      };

      Do you have any suggestions ?

      Regards,
      Marius

      Author's profile photo Ami Selarka
      Ami Selarka

      Refer:

      https://zbap.net/abap-s4-append-structure-with-extending-views-772221502093

      Author's profile photo Chale Kassa
      Chale Kassa

      Hey Marius,

      We're facing the same issue while extending Mseg, did you solved it???

       

      Chale.

      Author's profile photo Former Member
      Former Member

      Hi,

      How to identify which views need to be extended. In 1610 system I appended a structure in MARD and added only one field.I created extension for proxy object NSDM_E_MARD in CDS view. T codes SE11,SE16n, MM01/02/03 worked fine but other MM t codes like ME22N started giving dump.

       

      Regards,

      Niketa

       

      Author's profile photo Joachim Rees
      Joachim Rees
      Blog Post Author

      Hi Niketa,

      How to identify which views need to be extended

      I think SAP Note 2242679  should tell you?!

      Hope that helps!

      Joachim

      Author's profile photo Giri Babu Darapaneni
      Giri Babu Darapaneni

      facing relevant issue to extend CDS views

       

      Author's profile photo Mahadevan Venkata
      Mahadevan Venkata

      Hi All, Hi Joachim Rees

      I performing S/4 checks using transaction ATC.

      I get the error  "DB Operation UPDATE found (MARC, see Note(s):0002378796)" when the code contains 'UPDATE MARC'. (screenshots included)

      Apologies, I have not worked with the table MARC or the tables mentioned in the note.

      What does the error mean? How am I supposed to address this?

      Any inputs here highly appreciated.

      Regards

      Dev

       

      Author's profile photo Ankit Maskara
      Ankit Maskara

      Hi Mahadevan,

      Though its too late but as far as I know we don't update any standard tables directly. There are always BAPIs or other FM's which do this to maitain the business consistency of the obect.

      You should consider replacing the Update with BAPI_MATERIAL_SAVEDATA or something similar for S4HANA.

      Reg.