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: 

Table maintenance generator is not updating existing entries, even after showing changes saved msg.

Former Member
0 Kudos
3,310

Hi,

I have created a table maintenance generator for a custom table,This table is getting populated from an IDOC.  while changing an existing entry in the table it shows data saved msg and new data appears in edit mode , But As soon as we come out of edit mode and check table entries it still remains the old one. I have tried regenerating TMG it didnt worked.

18 REPLIES 18

nishant_krishen3
Explorer
0 Kudos
511

Hi Vinod,

Is there any Custom Module you have put in Screen of TMG. If there is any Module than may be Modify statement is not working properly may be.

Regards

Nishant

satyabrata_sahoo3
Contributor
0 Kudos
511

Add COMMIT WORK  after data update in table.

Former Member
0 Kudos
511

Hi Vinod,

Check the event you used for update.

In that event after value modifying, move the internal table to the actual internal table used in TMG.

Thanks and Regards

Srimanta

Former Member
0 Kudos
511

Thanks for Your suggestions but none of them worked,

There are no events/custom module in TMG, and strange thing is if i try to create a data manually and edit it later, its working fine, But the data coming from IDOC into this table are not getting edited, even after msg 'DATA WAS SAVED'. I want to know is there any setting or something for the table which prevents it from updating.

Regards,

Vinod

0 Kudos
511

Hi Vinod,

Goto SE93  and enter the T Code for you TABLE and click on DISPLAY.There at the bottom you will find the DEFAULT VALUES.Please check whether it exist as shown below.

Please check if UPDATE  X is maintained or not.

Please revert me back if this is not the issue.

Thanks,

S.Rajendranath Raparthi.

0 Kudos
511

hi Rajendranath,

I am not using any T code till now for this, I am trying to edit data directly from SM30.

0 Kudos
511

Hi Vinod ,

Please read the below statements , I think your problem will be solved.

Difference bt MODIFY & UPDATE

Modify:

If the value of key fields in the internal table matches with the key fields values in database table,modify will update the existing entry.Otherwise,it will insert new entry.

Update:

To update db table,it is mandatory that the value of key fields in internal table should match with database table.

As you are using MODIFY statement , read which doesn't matches the key fields in the db table and getting created a new entry

Thanks,

S.Rajendranath Raparthi.

raymond_giuseppi
Active Contributor
0 Kudos
511

This table is getting populated from an IDOC.

Can you elaborate, are you using a FM like VIEW_MAINTENANCE_SINGLE_ENTRY or just an OPEN-SQL, and in this case do you check validity of records, may some incoherent data disturb the dialog maintenance ?

Regards,

Raymond

0 Kudos
511

Hi,

I am just using modify statement to populate the data in this table, through inbound IDOC FM.

0 Kudos
511

What do you mean really. A Table maintenance generator is for manually changing entries, e.g. with SM30. So what do you mean when this get updated from IDoc ??

The table maintenance generator has nothing to do with that, like I said that is for manual changes with sm30.

I guess you wrote a program to update this table from the content of an IDoc. How did you read the IDoc data ? With a function module ?

Can you share some of the code ? Especially around the modify / update statement.

0 Kudos
511

So what if the data received in IDOC is wrong, like a primary key field not respecting a foreign key relation ?

0 Kudos
511

Hi peter,

I have a custom inbound IDOC, in which i have written code to update this Z table through a simple modify statement.

reading data from IDOC segment into a internal table t_tab.

Read IDOC data

  LOOP AT idoc_data INTO w_edidd.

    CASE w_edidd-segnam.

      WHEN c_segnam.

        CLEAR g_data.

        g_data            = w_edidd-sdata.

        w_tab-z_trguid    = g_data-trguid.      

        w_tab-z_posguid   = g_data-posguid.     

        w_tab-etenr       = g_data-line_no.     

        w_tab-brrrun      = g_data-brrrun.      

        w_tab-z_filter    = g_data-filtervariant.

        w_tab-kunnr       = g_data-kunnr.       

        w_tab-vbeln       = g_data-vbeln.       

        w_tab-matnr       = g_data-matnr.       

        w_tab-posnr       = g_data-posnr.       

        w_tab-edatu_alt   = g_data-edatu_old.   

        w_tab-edatu_neu   = g_data-edatu_new.   

        w_tab-wmeng       = g_data-reqqty.      

        w_tab-bmeng_alt   = g_data-oldcnfqty.   

        w_tab-bmeng_neu   = g_data-newcnfqty.   

        w_tab-vrkme       = g_data-meins.       

        w_tab-z_time      = g_data-z_time.       

        APPEND w_tab TO t_tab.

        CLEAR: w_tab, w_edidd.

    ENDCASE.

  ENDLOOP.

      

modify Ztable  from table t_tab.

But I have created TMG for this Z table as well, when i try to edit data via SM30, which is coming into this Z table through above code, it is not getting edited.

0 Kudos
511

That is strange indeed.

What kind of change are you performing ?

Maybe you are trying to put something in the field that is not allowed according to the data element / domain definition.  (your guid fields maybe ?)

Or are you trying to (e.g.) put zeroes in front (leading zeroes), and then in display mode the conversion exit is passed, so the leading zeroes SEEM to have disappeared again.

Those are two possibilities I can come up with now.

0 Kudos
511

Hii vinod,

check the sy-subrc after modify stament like

modify Ztable  from table t_tab.

if sy-subrc eq 0.

     message 'Table modified successfully' type 'S'.

else.

     message 'Modification fialed' type 'E'.

endif.

Then debugg the code.

You will get the idea where it's failing. or control reaching to this modify statemnet or not.

check it with update statement aslo whether working or not

like

update ztable

set <field name>

where <field name>.

check sy-subrc .

regards

Syed

former_member201364
Participant
0 Kudos
511

Hi Vinod,

Are there any alpha numeric key fields that got updated through your idoc with lower case? If the lower case check box is not selected in the domain of that key field, when you are trying to modify the entries from SM30, it converts it into uppercase, tries to find that entry in the table for updating and it fails.

If you convert it into uppercase while creating the records from idoc and try to modify it from SM30, it will get updated.

Regards,

Poornima

Former Member
0 Kudos
511

Hi,

If there is some change in table definition after the table maintenance generated you must adjust the table in database.

Utilities - Database Utility - Activate and Adjust database.

and in Table maintenance Generator

Generates Objects - change - select particular objects that got changed and save it.

even after that you are not able to update the content please copy table to another table , delete and re-generate again. 

Former Member
0 Kudos
511

Hi,

Check whether the field name in table and the screen name for that field is same. If it is different, then data will be displayed but while saving it won't update.

Regards,

DPM

0 Kudos
511

hi joshi & d mallick

                              its year old thread dont reply

with regards,

vikas