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

Need help in Table Maintenance Generator

Former Member
0 Likes
4,012

Hi Experts,

I have table maintenance generator and it has four columns like ‘A’,’B’,’C’,’D’ in the table. Now my requirement is, whenever I click on 'New
Entries' (in table maintenance Generator) automatically in column 'C' some default value should get filled(like XYZ), it should not happen when user
clicks ‘save’ or some other action it should happen only when I click on ‘New Entries’ in the table maintenance generator.

Thanks in advance.

Regards,

Chityala.

1 ACCEPTED SOLUTION
Read only

VijayaKrishnaG
Active Contributor
0 Likes
2,195

Hi Shailaja,

We have events in TMG, in those events I think you can use 05 - Creating a New Entry.

This will be triggered when creating a new entry. So, create a routine for this event and fill the required field with default value.

Otherwise create a MODULE in PBO of the screen in which we fill values and fill the required field with default value.

regards,

Vijay

Hi Experts,

I have table maintenance generator and it has four columns like ‘A’,’B’,’C’,’D’ in the table. Now my requirement is, whenever I click on 'New
Entries' (in table maintenance Generator) automatically in column 'C' some default value should get filled(like XYZ), it should not happen when user
clicks ‘save’ or some other action it should happen only when I click on ‘New Entries’ in the table maintenance generator.

Thanks in advance.

Regards,

Chityala.

9 REPLIES 9
Read only

Former Member
0 Likes
2,195

Hi,

Check table maintenance generator Events. That should help.

Hope this link will help.

TABLE MAINTENANCE GENERATOR and ITS EVENTS - ABAP Development - SCN Wiki

Regards

Abhi

Read only

VijayaKrishnaG
Active Contributor
0 Likes
2,196

Hi Shailaja,

We have events in TMG, in those events I think you can use 05 - Creating a New Entry.

This will be triggered when creating a new entry. So, create a routine for this event and fill the required field with default value.

Otherwise create a MODULE in PBO of the screen in which we fill values and fill the required field with default value.

regards,

Vijay

Read only

0 Likes
2,195

Hi All,

Thank you every one for quick replies..

I have tried with events 05, 01, 18, 21, but i am unable to fill that column 'C' with default value.

When I clicked on 'New Entries' that value should be filled but no action should be performed.

Is this possible..???

Thanks in advance..

regards,

Chityala.

Read only

0 Likes
2,195

Hi Shailaja,

Write a Module in PBO of the entries screen. In that write a code like basing on SY-UCOM or OK_CODE.

IF OK_CODE = <ok_code_of_button>.

     LOOP AT SCREEN.

          IF SCREEN-NAME = <field_name>.

               <field_name> = <def_value>.

               MODIFY SCREEN.

          ENDIF.

     ENDLOOP.

ENDIF.

Regards,

Vijay

Read only

0 Likes
2,195

Hi Chityala

Can you please tell us whether do you have one step or two step TMG. If it is one step you will have to code it in PBO based on action of first screen else for two step you will have to assign value in PAI of detailed or PBO of second screen. I dont think using event you will be able to achieve it

Please be careful these screen code tends to get overwritten if you regenerate it

Nabheet

Read only

Former Member
0 Likes
2,195

Hi,

I think you may have to write some piece of code for it.

You can write it either in environ ment -> modification->events( after selecting maintanance generator from se11) or

you may have to write the code in the PBO PAI events of the screen of  your maint . view.

( environment->modification-> source code)

Read only

Former Member
0 Likes
2,195

Hi shailaja,

Please refer the below link for more details on steps for creating Table Maintanence Generator,

http://musicodez.wordpress.com/2010/09/13/custom-validation-on-table-maintenance-generator-sm30/

Here in this link, for your requirement you can make below changes for the form,

DATA lwa_row TYPE <your table Name>.

  LOOP AT total.
  clear lwa_row.
  if <vim_total_struc> is ASSIGNED.
  MOVE-CORRESPONDING <vim_total_struc> to lwa_row. "current row in assigned
  endif.

* Action is 'N' for new entries and this makes sure that is applicable only to new entries
  if <action> EQ 'N'.

   " you can place your code default entry here as lwa_row-row_c = <value>
  endif.
  ENDLOOP.

Read only

former_member821147
Participant
0 Likes
2,195

Hi,

In table maintanance generator click on Environment -> Modification -> Events . It will display the list of events after pressing F4 help on column  ' T '.Then select the event then implement subroutine based on your requirement.

I think event 21 will satisfy u r requirement.

Read only

ThangaPrakash
Active Contributor
0 Likes
2,195

Hello Chityala,

Go to TMG, click on Environment --> Modification --> Events

In the  events column select event 05 and create a routine (where you can make the column C= XYZ as default).

Regards,

Thanga