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

Problem with table maintenance - Entry alread exists

Former Member
0 Likes
5,214

Dear experts,

i am facing a problem with my generated table maintenance-dialogue.

My table consists of Client, a charlike key-field and 3 flag-fields.

i generated the maintenance dialogue and converted the three flag-columns into radiobuttons and defined a RB-Group.

the radiobuttons work fine, if i set flag 2 1 and 3 are Initial and so on... but, if i click new entries all lines inside my dynpro are checked, not only the ones i changed. So the second line with an initial key is marked and i get message SV 009 "An entry already exists with the same key".

In my opinion this has to be a general issue with the table maintenance. i searched the OSS for 90 minutes by now, maybe someone already faced this problem and solved it.

regards

Jan Martin Müller

14 REPLIES 14
Read only

Former Member
0 Likes
3,598

i am wondering if you have a NULL entry saved....and this is causing your problem.

Check if that's the case using se16 /se16n and remove if necessary.

use a required field is one simple way of preventing that occurring again, if that's the case - just change the table control module screen as you need.

Read only

0 Likes
3,598

Hi Steve,

thanks for your quick answer!

SE16(N) tells me, that there is no entry in my table...

if i mark te column of my key-field as required in the generated dynpro, im forced to enter a value for every line displayed in SM30...

i already thought i could do my own Z-Module and call SAP-Standard funcktionality depending on the value of my key-field, but SAP decided to code directly inside their modules.

Since it is a generated dialogue i want to minimize changes on it...

Maybe you got another idea?

regards

Jan Martin

Read only

0 Likes
3,598

is the function group 1:1 for that table only?

Read only

0 Likes
3,598

no it is not.

The Problem is, that my table "EXTRACT" has 50 similar entries, that are checked for duplicate keys.

Read only

0 Likes
3,598

ok, well it is hard to diagnose as I don't know what steps you have taken when adding the entries in SM30, what - if any, bespoke coding you undertaken, for example in a table event or the screen flow and what the data in your extract table looks like - blanks? or, valid looking data?.

The behaviour you describe is normal if you do have duplicated entries - but how you have got to that situation only you know right now. Normally, you would enter the data and save, but prevented from further saving for any duplicates and you would be forced to back out if you cant change them.

I take it that when you test SM30 you completely restart the transaction each time after any changes - merely going back to the front screen is not enough to pick up your coding/gen changes.

Read only

0 Likes
3,598

All I did was creating a table in SE11:

mandt X(key) X(Initial) mandt

key      X        X            char10( just an example)

flag1                             flag

flag2                             flag

flag3                             flag

i then generated the maintenance dialogue.

editet the created dynpro as follows:

marked flag1, flag 2 and flag 3 -> right click ->convert ->Radio button

right click -> Radio button Group -> define

then i activated the dynpro.

Other "EXTRACT2-Tables in other Screens are "prefilled" too in PAI so thats not the Problem, but somehow MODULE set_update_flag and MODULE liste_update_liste react quite differently. This i think is triggered by my key and Radiobutton-only configuration..

regards

Jan Martin


Read only

0 Likes
3,598

I deactivated a line in the flowlogic:

    CHAIN.

      FIELD struc-key.

*      FIELD struc-flag1.

      FIELD struc-flag2.

      FIELD struc-flag3.

      MODULE set_update_flag ON CHAIN-REQUEST.

    ENDCHAIN.

Now the dialogue reacts as wanted, but i wont get any update, if i change an entry from flag 2 to 3...

It seems, that the automatic prefill of radiobutton-flag1 marks the line as "changed".

Read only

0 Likes
3,598

you may need to define your own module for your own checks for the radio buttons then call the standard set_update_flag once all your own checks are coded. You need to activate the right includes in the Func Group main prog - as in bold below and put your module logic in there.

---------------------------------------------------------------------*
*    generated viewmaintenance function pool
*   generation date: 09.06.2014 at 13:51:24 by user SC4
*   view maintenance generator version: #001407#

*---------------------------------------------------------------------*

*******************************************************************
*   System-defined Include-files.                                 *
*******************************************************************

  include lzv_t005_regtop.                   " Global Data
  include lzv_t005_reguxx.                   " Function Modules

*******************************************************************
*   include-files generated by view maintenance tool              *
*******************************************************************
*      view related include-files   (never change, please)        *
  include lzv_t005_regf00                         . " subprograms
  include lzv_t005_regi00                         . " PAI modules

*      general include-files        (never change, please)        *
  include lsvimfxx                                . " subprograms
  include lsvimoxx                                . " PBO modules
  include lsvimixx                                . " PAI modules

*******************************************************************
*   User-defined Include-files (if necessary).                    *
*******************************************************************

INCLUDE LZV_T005_REGF01.                   " Subprograms
INCLUDE LZV_T005_REGO01.                  " PBO-Modules
INCLUDE LZV_T005_REGI01.                   " PAI-Modules

Read only

0 Likes
3,598

OK, i hacked it..

copied MODULE set_update_flag. wrapped it all into an IF key IS NOT INITIAL - ENDIF.

Now it works, until someone wants to Regenerate the whole dialogue.

Imho it is only a Workaround, but i guess to have live with that...

Thank you Steve, i tried to avoid hacking my dynpro, but i guess this time it is a feature and not a bug...

regards

Jan Martin

Read only

0 Likes
3,598

well IF and when someone does a complete regen - just uncomment those includes - the coding already exists as you created them in your own Z namespace- so in effect you just 'plug' it back in.

I guess you have a doco folder somewhere to make a note of it...?

it is not really a hack. The tab main you develop is in customer name space. And the ability to add your own module coding and Tabl Maint events is by design, provided by the guys at SAP!

good luck and thanks

Read only

3,598

Hi Steve,

If SAP wants to deliver a good solution with the maintenance-generator AND Radiobutton-Groups are allowed in table controls, their standard-include has to react correctly on my usecase. thats why i think its a bug. Somewhere inside the code they are comparing the "old" data with the actual data to determine, if each line has been updated. So when the "old"-data table has to be modified, whenever the radiobutton-Group-Feature modifies the table-control. This is imho a legit usecase for maintenance views and has to be implemented. If i remove the radiobutton-Group the whole thing works, but with the usability of "round" checkboxes...

regards,

Jan Martin

Read only

0 Likes
3,598

yes, you have a strong argument, but of course radio buttons are intrinsically peculiar in that a 'default' exists upfront i.e. one of the buttons must be checked - which as you say is not handled well on creation.

may I suggest you close thread...

Read only

prakashjasti
Contributor
0 Likes
3,598

Hi

Your issue will be resolved if you Just add three more fields to your table like username and date entered and time entered and make them as mandatory and mark those fields also in key combination.

Regards,

Prakash

Prakash J
Read only

0 Likes
3,598

Hi Prakash,

if i wanted to have my table more fields, i would have added them...

Thanks anyways!

Regards,

Jan Martin