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

Table control-Checking for duplicate entries in database table

Former Member
0 Likes
851

Hello Experts,

Please help me in below scenerio:

I am using table control to make entries on screen.When user makes entries on the screen accordingly a custom table gets updated.Whenever user makes duplicatte entries(records which are already available in the custom table) it should throw an error message.On screen the remaining records should be in disable mode and duplicate entries should be in enable mode.I am able to throw the error message but not able to disable these records.

Plz suggest.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
532

Hi Divya,

While looping the table control in PBO, call a routine to set the screen input to zero. Some thing like below.

* Loop throug the table control in PBO
 LOOP AT <int_table>INTO <work-area> WITH CONTROL <table-control>
                      CURSOR <indicator>
   <Other than the duplicate entry call the routine to disable the row. Set a condition here>
    module Fill_table_control.

  ENDLOOP.

MODULE FILL_TABLE_CONTROL OUTPUT.

* Loop through the screen elements and disable material and valutaion type
* fields
    LOOP AT screen.
      IF screen-name = <colume-name>
         OR screen-name = <colume-name>.
            screen-input = '0'.
            modify screen.
      ENDIF.
    ENDLOOP.

ENDMODULE.                 " FILL_TABLE_CONTROL  OUTPUT

Regards,

Maddy.

2 REPLIES 2
Read only

Former Member
0 Likes
533

Hi Divya,

While looping the table control in PBO, call a routine to set the screen input to zero. Some thing like below.

* Loop throug the table control in PBO
 LOOP AT <int_table>INTO <work-area> WITH CONTROL <table-control>
                      CURSOR <indicator>
   <Other than the duplicate entry call the routine to disable the row. Set a condition here>
    module Fill_table_control.

  ENDLOOP.

MODULE FILL_TABLE_CONTROL OUTPUT.

* Loop through the screen elements and disable material and valutaion type
* fields
    LOOP AT screen.
      IF screen-name = <colume-name>
         OR screen-name = <colume-name>.
            screen-input = '0'.
            modify screen.
      ENDIF.
    ENDLOOP.

ENDMODULE.                 " FILL_TABLE_CONTROL  OUTPUT

Regards,

Maddy.

Read only

valter_oliveira
Active Contributor
0 Likes
532

Hello.

Are you throwing the error message in a PAI module, between LOOP/ENDLOOP statement, using FIELD statement?

If you want to check more than one field you should use CHAIN/ENDCHAIN too ...

Regards,

Valter Oliveira.