If the user is specifying the the unique index and you want to trap duplicate entries, I recommend checking the database before updating the table to see if the index item already exists. If it does then display an error message. You can't really "trap" the database error because from what I've seen SAP will just crash. Better to check before attempting an update to the database.
 
The key to disabling and/or enabling screen fields is to place the following code in a module in the PBO event.
 

LOOP AT SCREEN.

  IF screen-name = 'XYZ'.

    screen-input = '1'. "This should be 1 to enable, 0 to disable

    MODIFY SCREEN.

  ENDIF.

ENDLOOP

 
You can also define "groups" of fields and enable or disable based on the group. In the screen painter, use the "Attributes" to designate for each field a value for one of the "groups". There are four. So let's say you assign the id '001' to group 1. Then you could use this code to disable or enable all fields with a group 1 value of '001'.
 

LOOP AT SCREEN.

  IF screen-group1 = '001'.

    screen-input = '0'. "This should be 1 to enable, 0 to disable

    MODIFY SCREEN.

  ENDIF.

ENDLOOP

 
Hope this helps,
 
Brett
 


From: Amol Sonaikar [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 30, 2004 2:44 AM
To: [EMAIL PROTECTED]
Subject: [ABAP] Dialog Programming - How to Enable / Disable Input Boxes

Hello Everybody

I have Input Boxes in my dialog screen from where data is inserted in Ztable.
I have an Index Unique created on ID column.
I want to Disable Input Output Box when user tries to enter Duplicate record.
And enable it when another Button is Pressed.

But I want to know 2 things.

1. How to trap the error whenever duplicate record is tried on DB Table.
2. How to Enable / Disable Input Boxes at a particular event.

Regards

Amol Sonaikar
--
India.com free e-mail - www.india.com.
Check out our value-added Premium features, such as an extra 20MB for mail storage, POP3, e-mail forwarding, and ads-free mailboxes!

Powered by Outblaze


To unsubscribe from this list, send a to mail to
[EMAIL PROTECTED] or go to http://groups.yahoo.com/group/ABAP

Comments about the list can be sent to [EMAIL PROTECTED]





To unsubscribe from this list, send a to mail to
[EMAIL PROTECTED] or go to http://groups.yahoo.com/group/ABAP

Comments about the list can be sent to [EMAIL PROTECTED]



Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to