Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding Table Maintenance Generator querry

Former Member
0 Likes
1,071

Hi Friends,

Can anybody pls tell me how stop the custom code from overwriting in overview screen from overwritng upon re-generation of TMG?

Thanks in advance.

Hi Friends,

Can anybody pls tell me how stop the custom code from overwriting in overview screen from overwritng upon re-generation of TMG?

Thanks in advance.

7 REPLIES 7
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
996

What ??

Read only

vinod_vemuru2
Active Contributor
0 Likes
996

Hi,

If i understand correctly, you have coded some thing after TMG is generated. Now if you delete the TMG your code is also deleted. When you recreate the TMG, you need to code it again. No other way.

Also this question is more appropriate in ABAP dictionary forum.

Thanks,

Vinod.

Read only

0 Likes
996

Hi,

It's not abt deletion.

I have put one module on field for calculation part in i.,e when u double click on overview screen of single step in table maint.generator.When one new field is added to table and I'm regenerating table maint generator.At that time prev.code written by me is gone.

I'm asking how we can stop that when regenerating TMG for altered structure.Hope it's clear now.

Read only

0 Likes
996

Hi,

Can anybody reply on this....

There ia always a tendency to overwrite whenever you do changes from either screen painter ditrectly for your TMG screen.

When you make change in screen or code and then you come and refresh changes are gone and it will again have the originals.

Mine quarry was Is there a way to prevent from overwriting upon refreshing/new changes done.

Thanks in advance.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
996

When you made changes to the TMG did you not get a warning "do not makes changes to standard SAP program"

Anyways if you add a new field to the table you have to re-generate the overview screen & your custom code will be overwritten.

That is why it is advised to code in the TMG events to prevent this type of problem.

BR,

Suhas

Read only

0 Likes
996

Hi,

What do you mean by come and refresh? Is it refering to regenerating the TMG? If yes, the simple answer for your question is NO. There is no way you can get back your code or changes to screen painter.

Thanks,

Vinod.

Read only

vimalv
Active Participant
0 Likes
996

Hello there.

You can play around with field exits to control regeneration Table Maintanance screens.

Choose one of the fields on the TMG screen, say BRGRU.

Run report RSMODPRF for BRGRU, and choose an exit number (between 1 to 9).

Execute this and it generates a function module which is a field exit and will be triggered when the TMG is called.

Within this Function module, you can write code to restrict regeneration.

For example:

 
function field_exit_brgru_1.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(INPUT)
*"  EXPORTING
*"     REFERENCE(OUTPUT)
*"----------------------------------------------------------------------
  field-symbols: <f_tabname> type any.

  assign ('(SAPMSVIM)VIMDYNFLDS-VIEWNAME') to <fg_tabname>.
  if sy-subrc = 0.
    if sy-ucomm = 'DLFU' or sy-ucomm = 'RESE' or sy-ucomm = 'SAVE'.
      if <f_tabname> eq 'Z_MYTABLE'           " Field Exit Added for object
         message e017(z_msgclass) with <f_tabname>.
      endif.
    endif.
  endif.

  output = input.

endfunction.

This means for, Z_MYTABLE, if someone tries to regenerate the TMG, it ends with an error .

Hope this helps.