How can I validate a UDF field in SP_PostTransactionNotification

Dear Experts,
For some reasons, I have a UDF "U_DocNum", and I will like to run a duplicate validation on this document number field everytime before the marketing document is posted.
Can anyone provide me with the codes I should put in the SP_PostTransactionNotification for this validation (I hope im correct of this SP name).
Much Thanks in Advance for your help!
Warmest Regards,
Chinho

For invoice you can use this
IF @transaction_type IN ('A','U') AND @object_type = '13' 
BEGIN
if exists
(Select CardCode from [dbo].[OINV] T0
    Where T0.DocEntry!=@list_of_cols_val_tab_del
      and T0.U_DocNum=
  (select U_DocNum From OINV
    Where DocEntry=@list_of_cols_val_tab_del) )
begin
     SELECT @error = 1, @error_message = 'Duplicate value !'
end
END
For every other transaction type you can insert a similar code
(Insert this in your  SBO_SP_TransactionNotification stored procedure after the line
--     ADD     YOUR     CODE     HERE )

Similar Messages

  • How can I validate a date field in Portal Forms

    I have a date field in portal forms that I want to perform validation on to make sure it's in the proper format before being accepted (mm/dd/yyyy). How can I validate against that field?

    Hi Ben,
    I took the time to test and revise. This is code that will validate a date entry (format MM/DD/YYYY). Just paste this in the "Before the start of the form..." window of the Additional PL/SQL code section of the form. Then add validateDate(); into the onBlur event window of the field in question. Replace the CYCLE_END_DATE with the field name in question.
    HTP.P('
    <SCRIPT LANGUAGE=javascript>
    function validateDate() {
    var ddObj;
    var mmObj;
    var yyObj;
    var day;
    var mon;
    var year;
    var field_val;
    var field_name;
    for (var j=0; j < document.forms[0].elements.length; j++) {
    field_name = document.forms[0].elements[j].name;
    field_val = document.forms[0].elements[j].value;
    if (field_name.substring(field_name.indexOf(''DEFAULT.'') + 8, field_name.lastIndexOf(''.01'')) == ''CYCLE_END_DATE'') {
    var delimPos = field_val.search(/\//i);
    if (delimPos < 0)
    alert(''Invalid date entry! Please enter in MM/DD/YYYY format. '' +
    ''e.g, Dec 21, 2003 would be entered as 12/21/2003'');
    else
    if (field_val.length != 10)
    alert(''Invalid date entry! Please Please enter in MM/DD/YYYY format. '' +
    ''e.g, Jan 1, 2003 would be entered as 01/01/2003'');
    else {
    month = field_val.substring(0, field_val.indexOf(''/''));
    day = field_val.substring(field_val.indexOf(''/'') + 1, field_val.lastIndexOf(''/''));
    year = field_val.substring(field_val.lastIndexOf(''/'') + 1, 10);
    /* Need to subtract 1 from value because in Javascript, January begins with 0
    and ends with 11 for December */
    month = month - 1;
    ddObj = new Date(year, month, day);
    mmObj = new Date(year, month, day);
    yyObj = new Date(year, month, day);
    if (ddObj.getDate(ddObj.setDate(day)) != day)
    alert(''Invalid day!'');
    if (mmObj.getMonth(mmObj.setMonth(month)) != month)
    alert(''Invalid month!'');
    if (mmObj.getYear(mmObj.setYear(year)) != year)
    alert(''Invalid year!'');
    </SCRIPT>
    ');

  • How can i validate  the field directline under personal information of ESS?

    Hi all,
    How can i validate the field directline under personal information--> communication data  of ESS?The thing is we don't have NWDI setup in our organization.Is there any possibility of doing it under SPRO trn.
    Thanks and Regards,
    sam

    Hi,
    This is probably a wrong forum that you have posted your question to.
    Regards,
    Siddhesh

  • How can i validate input number into a Field of  type char in oracle form?

    hi.....
    can any one help me.....please...!!!?!!
    How can i validate input number into a Field of type char in oracle form?

    i have tried doing that, but still the field except numbersthere was an error in that code. it should have been
    var_num:=to_number(var_char);however, it appears that you want the entry NOT to be a number. if this is the case then try
    begin
      if to_number(:block.item) = 0 then null; end if;
      message('The entry cannot be numeric');
      raise form_trigger_failure
    exception
      when value_error then
       /* this is where you put the code you want to be run when the
          entry is non-numeric */
    end;

  • How can I get the "text" field from the actionEvent.getSource() ?

    I have some sample code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.ArrayList;
    public class JFrameTester{
         public static void main( String[] args ) {
              JFrame f = new JFrame("JFrame");
              f.setSize( 500, 500 );
              ArrayList < JButton > buttonsArr = new ArrayList < JButton > ();
              buttonsArr.add( new JButton( "first" ) );
              buttonsArr.add( new JButton( "second" ) );
              buttonsArr.add( new JButton( "third" ) );
              MyListener myListener = new MyListener();
              ( (JButton) buttonsArr.get( 0 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 1 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 2 ) ).addActionListener( myListener );
              JPanel panel = new JPanel();
              panel.add( buttonsArr.get( 0 ) );
              panel.add( buttonsArr.get( 1 ) );
              panel.add( buttonsArr.get( 2 ) );
              f.getContentPane().add( BorderLayout.CENTER, panel );
              f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              f.setVisible( true );
         public static class MyListener  implements ActionListener{
              public MyListener() {}
              public void actionPerformed( ActionEvent e ) {
                   System.out.println( "hi!! " + e.getSource() );
                   // I need to know a title of the button (which was clicked)...
    }The output of the code is something like this:
    hi! javax.swing.JButton[,140,5,60x25,alignmentX=0.0,alignmentY=0.5,
    border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@1ebcda2d,
    flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,
    disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,
    right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,
    rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=first,defaultCapable=true]
    I need this: "first" (from this part: "text=first" of the output above).
    Does anyone know how can I get the "text" field from the e.getSource() ?

    System.out.println( "hi!! " + ( (JButton) e.getSource() ).getText() );I think the problem is solved..If your need is to know the text of the button, yes.
    In a real-world application, no.
    In a RW application, a typical need is merely to know the "logical role" of the button (i.e., the button that validates the form, regardless of whether its text is "OK" or "Save", "Go",...). Text tends to vary much more than the structure of the UI over time.
    In this case you can get the source's name (+getName()+), which will be the name that you've set to the button at UI construction time. Or you can compare the source for equality with either button ( +if evt.getSource()==okButton) {...}+ ).
    All in all, I think the best solution is: don't use the same ActionListener for more than one action (+i.e.+ don't add the same ActionListener to all your buttons, which leads to a big if-then-else series in your actionPerformed() ).
    Eventually, if you're listening to a single button's actions, whose text change over time (e.g. "pause"/"resume" in a VCR bar), I still think it's a bad idea to rely on the text of the button - instead, this text corresponds to a logical state (resp. playing/paused), it is more maintainable to base your logic on the state - which is more resilient to the evolutions of the UI (e.g. if you happen to use 2 toggle buttons instead of one single play/pause button).

  • How can i validate on ALV grid for the user

    Dear Freinds,
                     I have developed one custom report using ALV Grid program , as per the requirement i have to enter on the
    data and when i press the value save the program sumits the data into my custom table . Till here every thing is fine
    but one particular field i have declared as Char1 in my internal table , on the ALV output it is allowing me to enter
    more than one character   eg : it is allowing me to enter as Hyderabad .........even though i have declared as char 1 in the internal table ....however it is saving in the database table as H only that is correct.......but it is giving confusion to user
    i want to validate that user shouldnt allow to enter more than one character in the alv output of the input field .
    Please could any one let me know how can i validate.
    regard
    divya

    Hi,
    check  that field length in the final internal table .
    might be that filed lenth in final internal table declartion is more than 1 char.
    regards,
    Rama reddy
    Edited by: ram reddy on Jul 15, 2009 7:57 AM

  • How can I program the text fields in my email forum to have rounded corners

    How can I program the text fields in my email forum to have rounded off edges or corners. 
    this is the code im using.
    // insert code here// insert code here// prepare email field
    var email = sym.$("email")
    email.html("Enter your Email: ");
    inputEmail = $('<input />').attr({'type':'text', 'value':'', 'id':'email'});
    inputEmail .css ('font-size', 14);
    inputEmail .css ('width', 350);
    inputEmail .css ('background-color', '#4e4e4e');
    inputEmail .appendTo(email);
    // prepare topic field
    var topic = sym.$("topic");
    topic.html("Topic: ");
    inputTopic = $('<input />').attr({'type':'text', 'value':'', 'id':'topic'});
    inputTopic .css ('font-size', 14);
    inputTopic .css ('width', 350);
    inputTopic .css ('background-color', '#4e4e4e');
    inputTopic .appendTo(topic);
    // prepare message field
    var message = sym.$("message");
    message.html("Message: ");
    inputMessage = $('<textarea />').attr({'type':'textarea','rows':'10', 'cols': '25','value':'', 'id':'message'});
    inputMessage .css ('font-family',"Arial,Helvtica,sans-serif");
    inputMessage .css ('color',"#ffffff");
    inputMessage .css ('font-size', 14);
    inputMessage .css ('background-color', '#4e4e4e');
    inputMessage .css ('box-shadow', '#4e4e4e');
    inputMessage .css ('width', 350);
    inputMessage .css ('height', 150);
    inputMessage .appendTo(message);
    var submitBtn = sym.$("btn");
    submitBtn.html("Submit");
    submitBtn.css("text-align", "center");
    submitBtn.css("font-size",14);
    submitBtn.css("font-weight","bold");
    submitBtn.css("color","#ffffff");

    Try this: inputEmail.css ('border-radius', '25px');
    attachment
    more details

  • How can we change the input field on a view stop showing zeros

    Hello,
           To make screen look consistent with other character input field. How can we change the input field on the view stop displaying zeros even though the data type is NUMC and data type should not be change?
    Edited by: sap_learner on Mar 25, 2010 5:44 PM
    Edited by: sap_learner on Mar 25, 2010 5:49 PM
    Edited by: sap_learner on Mar 25, 2010 5:55 PM

    hello Manas Dua,
                           Thanks for your help. I am able to resolve my problem.
    My code will help  the future comers to resolve this kind of issues.
    *The code is applied to method WDDOINIT of the default view.
      DATA lo_nd_terms_input    TYPE REF TO if_wd_context_node.
      DATA lo_nd_terms_input_i TYPE REF TO if_wd_context_node_info.
      DATA lv_zeros             TYPE wdy_attribute_format_prop.
      lv_zeros-null_as_blank = 'X'.
      lo_nd_terms_input = wd_context->get_child_node( name = wd_this->wdctx_input ).
      lo_nd_terms_input_i = lo_nd_terms_input->get_node_info( ).
      lo_nd_terms_input_i->set_attribute_format_props(
        EXPORTING
          name              = `ENTER THE ATTRIBUTE NAME`
          format_properties = lv_zeros     ).
    Edited by: sap_learner on Mar 26, 2010 5:02 PM

  • How can we read the screen field values from the report selection screen wi

    Hi expart,
    How can we read the screen field values from the report selection screen with out having an ENTER button pressed  .
    Regards
    Razz

    use this code...
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_posnr.
    **Read the Values of the SCREEN FIELDs
    CALL FUNCTION 'DYNP_VALUES_READ'

  • How can I share a static field between 2 class loaders?

    Hi,
    I've been googling for 2 days and it now seems I'm not understanding something because nobody seems to have my problem. Please, somebody tell me if I'm crazy.
    The system's architecture:
    I've got a web application running in a SunOne server. The app uses Struts for the MVC part and Spring to deal with business services and DAOs.
    Beside the web app, beyond the application context, but in the same physical server, there are some processes, kind of batch processes that update tables and that kind of stuff, that run once a day. Theese processes are plain Java classes, with a main method, that are executed from ".sh" scripts with the "java" command.
    What do I need to do?
    "Simple". I need one of those Java processes to use one of the web app's service. This service has some DAOs injected by Spring. And the service itself is a bean defined in the Spring configuration file.
    The solution is made-up of 2 parts:
    1. I created a class, in the web app, with a static method that returns any bean defined in the Spring configuration file, or in other words, any bean in the application context. In my case, this method returns the service I need.
    public class SpringApplicationContext implements ApplicationContextAware {
         private static ApplicationContext appContext;
         public void setApplicationContext(ApplicationContext context) throws BeansException {
              appContext = context;
         public static Object getBean(String nombreBean) {
              return appContext.getBean(nombreBean);
    }The ApplicationContext is injected to the class by Spring through the setApplicationContext method. This is set in the Spring configuration file.
    Well, this works fine if I call the getBean method from any class in the web app. But that's not what I need. I need to get a bean from outside the web app. From the "Java batch process".
    2. Why doesn't it work from outside the web app? Because when I call getBean from the process outside the web app, a different class loader is executed to load the SpringApplicationContext class. Thus, the static field appContext is null. Am I right?
    So, the question I need you to please answer me, the question I didn't find in Google:
    How can I share the static field between the 2 class loaders?
    If I can't, how can I load the SpringApplicationContext class, from the "Java batch process", with the same class loader my web app was started?
    Or, do I need to load the SpringApplicationContext class again? Can't I use, from the process, the class already loaded by my web app?
    I' sorry about my so extensive post...
    Thank you very much!

    zibilico wrote:
    But maybe, if the web service stuff gets to complicated or it doesn't fulfill my needs, I'll set up a separate Spring context, that gets loaded everytime I run the "Java batch process". It'll have it's own Spring configuration files (these will be a fragment of the web app's config files), where I'll define only the beans I need to use, say the service and the 2 DAOs, and also the DB connection. Additionally, I'll set the classpath to use the beans classes of the web app. Thus, if the service and DAOs were modified in the app server, the process would load the modified classes in the following execution.You'll almost certainly have to do that even if you do use RMI, Web services etc. to connect.
    What I suggest is that you split your web project into two source trees, the stuff that relates strictly to the web front end and the code which will be shared with the batch. The latter can then be treated as a library used by both the batch and web projects. That can include splitting Spring configuration files into common and specific, the common beans file can be retrieved from the classpath with an include. I regularly split web projects this way anyway, it helps impose decoupling between View/Controller and Model layers.
    On the other hand, you might consider running these batch processes inside the web server on background threads.

  • How can i make a search field in my app using applescript?

    I am making an app and i would like to learn how can i add a search field, that will search the content of a window. BTW i am using xcode and applescript

    Like pretty much all of the Cocoa documentation you will need to convert from Objective-C, but take a look at the Search Fields documentation.

  • How can I create a custom field in contacts and have it appear in ICal?

    How can I create a custom field in contacts (death date) and have it appear in calendar?
    Birthdays seems to work fine but I'd like to do the same for a custom field called Date of Death

    By default, iTunes convert files to type AAC which has an extension of .m4a
    For iTunes to recognize them as Audiobook files, the extension needs to change from .m4a to .m4b
    This can be done a number of different ways. Here are 2 (beginner and advanced)
    . simply, by renaming each file from windows explorer
    . more complex, by using Start/Run/cmd to get a "DOS" type window,
    using the command "cd" to change to the directory that your files are in
    and entering "ren *.m4a *.m4b"

  • I paid for exportpdf and everytime i try to use tool on pdf, it asks me to subscribe. i have to log into website EVERY time. not acceptable.  how can i export only form fields that were filled in?

    i paid for exportpdf and every time i try to use tool on pdf, it asks me to subscribe. i have to log into website EVERY time. not acceptable. Some forms can't be saved so having to log in and only use webtool to upload a saved pdf won't work.
    as well, how can i export only form fields that were filled in if I can get pdf to save to computer?

    Hi kstine,
    I can see why that would be frustrating! Have you tried selecting Stayed Signed In underneath the Adobe ID and Password boxes when you try to log in?
    What did you use to create the PDF form? If you used FormsCentral, form data is saved to your online FormsCentral account. If you have Acrobat, you can export form data as described  here: Adobe Acrobat X Pro * Manage form data files
    Best,
    Sara

  • How can i add STORAGE LOCATION field which is not...............

    hi,
    sap gurus,
    good morning to all,
    how can i add STORAGE LOCATION field which is not in the standard tables namely
    KOMP, KOMK, and KOMG.
    how to include it in our FIELDS FROM FIELD CATALOGUE.
    if we include this field is there any impact on the standard tables.
    plz let me know this.
    bcz
    we are selling our products in two ways
    (1). one is straight from factory ie direct sales from factory
    if customer asks for excise invoice then we will sell thru factory and keeping freight in mind we will
    deliver him which ever is economical either rail or road.
    before coming to second case of selling the goods
    we will do STOCK TRANSPORT ORDER from plant to different storage locations.
    if we did STO thru road we have to sell the goods thru road only.
    if we did STO thru rail we have to sell the goods thru rail route only.
    (2). if the customer is not asking any excise invoice then we will send the goods thru depo/storage
    location which is not registered under excise.
    if the goods came by road then it will be delivered by road only.
    if the goods came by rail then it will be delivered by rail only.
    my logic here is
    basing on the
    storage location, transportation types, and distance i want to create condition record
    that captures exact frieght at the sales order level.
    confirm whether i am right or wrong.
    regards,
    balaji.t
    09990019711.

    Hi,
    It is not recommended to add new fields to any SAP standard tables. It disturbs the whole SAP functionality.
    But if you have no choice expcept to change the standard tables to meet your requirement -  then you need an access key to modify the object, which is available from the market place.
    Nevertheless, the better option is to create a 'Z' table with the required fields and use that accordingly.
    Changing standard tables will have serious impact when you apply patches or do an upgrade on the existing functionality.
    REWARD POINTS IF HELPFUL
    Regards
    Sai

  • How Can I Set the Search Field in iTunes?

    In applescript...
    In another app - I have copied a song title to the clipboard...
    Q: Now - How Can I Set the Search Field in iTunes to the clipboard contents?
    Q: Also how can I also open the main library itunes window?

    Hi Rev Dave,
    Q: Now - How Can I Set the Search Field in iTunes to
    the clipboard contents?
    Unfortunately the only way I can think to achieve this involves the use of "UI Scripting". The other previous posters have given you the preferred method you should consider using. If you want to script iTunes so that you visually see the search take place in iTunes you'll need to use the method shown in the script I've posted below.
    Q: Also how can I also open the main library itunes
    window?
    Cyclosaurus has given you the answer to this part of your question already.
    Here is a script that (though ugly IMHO) should achieve what you are asking for:set theSearch to (the clipboard) as string
    tell application "iTunes"
    activate
    set allPlaylists to playlists
    repeat with aList in allPlaylists
    if name of aList is not "Library" then
    set view of front browser window to aList
    exit repeat
    end if
    end repeat
    set LibList to playlist "Library"
    set view of front browser window to LibList
    end tell
    tell application "System Events"
    tell process "iTunes"
    if "iTunes" is not in name of windows or ¬
    focused of window "iTunes" is false then ¬
    keystroke "1" using command down
    keystroke tab
    keystroke theSearch
    end tell
    end tellIn order for the above script to work you need to have "Enable access for assistive devices" enabled in the "Universal Access" section of the "System Preferences" application.
    If you have any further questions about the above script feel free to ask.
    Hope this helps...
    iBook G4 1GHz   Mac OS X (10.4.3)   640 MB RAM

Maybe you are looking for

  • Most Mail is Going To Junk Folder... Even From Apple. Any Thoughts?

    I feel like maybe I'm missing something obvious, but anyone know why much of my mail is going directly into my junk folder? I have three .mac accounts and even mail sent from one to the other goes into my junk folder. Also the weekly iTunes update ju

  • How to get First line item in Table control for BDC.

    Hi, I have a requirement while creating the return order from the reference Sales order for BOM. Once I compare the line items and delete the items not to be returned, I want to read the first line item which in fact is header, to make some changes.

  • Help with Adobe Bridge CS6

    Before my Mac was updated my Bridge was working fine.  Now it won't open all the pictures I select for editing.  What can I do to fix the problem?

  • Kernel panic due to logic

    Please Help: When i try to open logic pro 7, i'm getting what i'm told is a "kernel panic". It hasnt done this before but now it's doing it everytime i try to open logic. I've tried a disk utility and taking out all usb plug ins and restarting but it

  • Reconciliation of MSSQL Server

    When we are reconciling the connected resource (SQL Server), under situation analysis we are getting the list of users who are CONFIRMED and UNMATCHED. In our case the reconciliation process is displaying the UNASSIGNED users under UNMATCHED. What is