Application Development 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: 

How do we generate a TMG using a custom program?

shan_20
Explorer
0 Kudos

Hi,

Can we achieve TMG recording using BDC? If SE54, then please update me the steps.

I tried recording T-Code se54 but the TMG is not re-generating the view.

Thanks & Regards,

Shan.

18 REPLIES 18

kiran_k8
Active Contributor
0 Kudos

BDC on SE54.

Btw, what is the requirement that necessitates to generate TMGs for Custom tables, in mass.

K.Kiran.

0 Kudos

I tried BDC using SE54 already. But, it is not working.

My requirement is using a view name always. Its structure alone changes based on the T-Code we choose. Hence, we need to regenerate the TMG everytime we read this view.

Hope I am clear to you.

May I know if there is any FM to 'read', 'delete' and 'recreate' the TMG. Thanks again.

Warm Regards,

Shan.

kiran_k8
Active Contributor
0 Kudos

Kindly refer to the reply from Rakshith and see if you are use that program by passing your table name dynamically.

K.Kiran.

Jelena
Active Contributor
0 Kudos

"My requirement is using a view name always" but why? Also what does "using view name always" even mean? Sorry, it's still not clear what exactly are you trying to achieve with this. What are you trying to solve by this, what business value to add?

It still seems like a very odd idea.

0 Kudos

Hi Ms. Jelena,

I want to generate TMG through a custom program. I need to pass dynamic values to the TMG parameters (such as Auth Grp, Function Grp, Maintenance screen and the package).

This is the scenario that I need to achieve. I believe that I am clear to you now.

Sorry for the typo error. My user wants to achieve auto-generation of TMG using a custom program.

1. I created a maintenance view. I add custom fields to this view through a custom program.

2. Whenever I call this custom program, it will read the view, add the custom fields (according to the user req.) to the view, and activate the view.

3. After activation of the view, I have to re-generate the Table maintenance generator. In order to do this, we need to write a custom program where we will pass the dynamic values to generate TMG.

Thanks & Regards,

Shan.

former_member208149
Participant
0 Kudos

Hi,

I would be really interested in knowing the business use case which asked to create a TMG dynamically or through a custom program.

By the way, what is the purpose of a TMG while you can directly update the table using the same custom program.

Regards.

0 Kudos

My requirement is using a view name always. Its structure alone changes based on the T-Code we choose. Hence, we need to regenerate the TMG everytime we read this view.

Hope I am clear to you.

May I know if there is any FM to 'read', 'delete' and 'recreate' the TMG. Thanks again.

Warm Regards,

Shan.

0 Kudos

Sorry, this just seem very bizarre... "Structure changes based on the T-code"? Are you aware that table maintenance view is a development object? After it's generated, it's not supposed to be changed much. If you change the table itself, you may need to re-generate the view, depending on the changes. Again, the table changes should not happen often either. Why would any of this would be "based on T-code"?

Also TMG stands for Table Maintenance Generator. We never "generate TMG". It seems this term somehow creeped up on SCN but it's inaccurate and confusing. TMG is the tool that generates table maintenance screen(s).

But even if we restate your note as "we need to generate maintenance screen every time we read this view" it still makes no sense whatsoever, sorry. It's not how development is done in SAP (or any computer system, really).

I'd suggest to go back to whoever gave you this requirement and try to understand clearly what they're trying to achieve, rather than just taking such "design" at face value.

0 Kudos

Hi Ms. Jelena,

I have achieved my requirement. Thanks for your kind advice. I will take a note of it and try to avoid using such notes.

The design is that - For an existing View ---> Add a custom field to a view ---> activate it and generate the TMG.

Thank you for your comments.

Regards,

Shan.

Sandra_Rossi
Active Contributor

Please choose a meaningful title, as there are thousands of questions about the table maintenance generator.

Why don't you first try, as it takes only 2 minutes to test (SHDB for recording, then run it).

rgore
Advisor
Advisor

Hi,

Check the report program RSVIEWGN for single table/view maintenance generation or RSVIEWMA for mass generation.

Thanks & Regards,

Rakshith Gore

kiran_k8
Active Contributor
0 Kudos

Wow...superb.

Thanks for sharing this info, Rakshith.

K.Kiran.

0 Kudos

Hi Rakshith,

Thanks for the information. I can see only the status details of the view. How should I use this program to read, delete and re-create the TMG? Thanks.

It will be helpful if you can provide me an example.

Warm Regards,

Shan.

kiran_k8
Active Contributor
0 Kudos

Create a test Z table

generate TMG using the program RSVIEWGN

check the generated VIEW using SM30.

Now add one more field in your test ztable.

generate TMG using the program RSVIEWGN

check the generated VIEW using SM30 to see if the new field is showing up in the maintenance view.

This will give you more info on how these standard progs actually work and you can call them in your program passing the table name dynamically.

K.Kiran.

0 Kudos

Hi,

You can use the report RSVIEWGN. Pass the table/view name in the selection screen and check the FCODE values in the program, based on the condition you can pass the FCODE values in the selection screen.

P.S - This report will only creates/delets or regenerates the structure specific modules and not the entire table maintenance generation.

Thanks & Regards,

Rakshith Gore

0 Kudos

Hi,

Yeah, I was noticing the same. I need to regenerate the TMG after addition/deletion of FIELDS in the existing structure.

Thanks & Regards,

Shan.

shan_20
Explorer
0 Kudos

I am able to achieve my requirement using the below FMs

VIEW_MAINTENANCE_CALL - to read the TMG of the view,

VIEW_MAINTENANCE_DELETE - to delete the TMG of the view and

VIEW_MAINTENANCE_GENERATE - to generate the TMG for the view.

But,

Now, these FMs are populating the dialog boxes on the front end. My user does not want to see it. Hence, is there a way to hide them and pass the dynamic values through a custom coding. Please help. Thank you.

Warm Regards,

Shan.

shan_20
Explorer

Hi Sandra,

Sorry, thank you.

Regards,

Shan.