Interfaces validations

Hi ,
As far as i know , Validations are an integral part of interfaces.
Can anybody send me the basic validations that need to be performed on the following interfaces. I need to prepare a HLD for the same.
1) Journal Import Interface
2) Customer Interface
3) Purchasing Open Interface
4)PO REceipts interface
5) Supplier Interface
It would be great if someone forwards me the necessary information.
Regards

hi.....
according to my knowledge in customer interface :
Check if legacy values fetched are valid.
Check if customer address site is already created.
Check if customer site use is already created.
Check is customer header is already created.
Check whether the ship_to_site has associated bill_to_site
Check whether associated bill_to_site is created or not.
Profile amounts validation:
Validate cust_account_id, validate customer status.
Check if the location already exists in HZ_LOCATIONS. If does not exist, create new location.
in Purchasing :
Header:
Check if OU name is valid
Check if Supplier is valid
Check if Supplier site is valid
Check if buyer is valid
Check if Payment term is valid
Check if Bill to and ship to are valid
Check if FOB, freight terms are valid
Lines:
Check if Line_type, ship_to_org, item, uom, ship_to_location_id, requestor, charge_account, deliver_to_location are valid
General:
Check for duplicate records in interface tables
Check if the record already exists in base tables.
and in Journl Import :
Validate SOB, journal source name, journal category name, actual flag
A – Actual amounts
B – Budget amounts
E – Encumbrance amount
If you enter E in the interface table, then enter appropriate encumbrance ID, if B enter budget id.
Check if accounting date or GL date based period name is valid (i.e., not closed).
Check if accounting date falls in open or future open period status.
Check chart of accounts id based on Sob id.
Check if code combination is valid and enabled.
Check if record already exists in GL interface table.
Check if already journal exists in GL application.
Regards,
Dushyant Sethi

Similar Messages

  • Sybase Unwired Platform - User Interface Validations

    Hi,
    Does the Sybase Unwired Platform have a mechanism that enables the developer to integrate User Interface Validations?
    Apple provides a standard way to validate user interfact items: http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/UIValidation/UIValidation.pdf
    Is there an inherent mechanism that is a part of the Sybase Unwired platform that triggers client-side validations to prevent unncessary round-trips for simple validations that can be processed by the client itself?
    Regards,
    Namrata

    Hi,
    For simple validations there is an in-built option in SUP. We can assign rule validations to edit box, this is well explained in [Sybase Infocenter|http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc01284.0152/doc/html/vhu1232730866978.html]. Or else we can also do some custom coding and achieve user interface validations. This is also well explained in the [tutorial for blackerry application development using Device Application Designer|http://infocenter.sybase.com/help/topic/com.sybase.infocenter.dc01210.0152/doc/html/vhu1272906484682.html].
    Regards,
    Rahul Muraleedharan.

  • Interface validation

    Hi
    This is my existing interface ,I need to do a validation on Unique id,which i need to add to custom table ZBACKS_GIPD.
    Check if there is same unique id within the upload file.
    Check from table ZBACKS_GIPD if the same Unique ID already exists ,
    Update log file with error message :"Duplicate record"
    Please let me know where I need to add this validation in the below code.
    REPORT ZBAB005 LINE-SIZE 255
                   LINE-COUNT 58(2)
                   NO STANDARD PAGE HEADING
                   MESSAGE-ID 00.
    TABLES: MARA,        "Material master
            MARC,        "Plant Data for Material
            MBEW,        "Material Valuation
            T001K,       "Valuation area
            t100,        "Messages
            kna1,        "Customer master
            SKB1,        "G/L account
            BKPF,        "FIN doc
            zprdordhdr,  "production order header
            ZSTDLOADING, "BACKS-SAP Interface - Generic ProdOrd costing data
            ZBACKS_GIPD. "BACKS-SAP Interface - Material Consumption
    Short name of the interface name
    DATA: INTFNAME(4) value 'GIPD'. "Good Issues for Prod. Order
    include zbab000. "Common procedures for files handling
    SELECTION-SCREEN BEGIN OF BLOCK 6 WITH FRAME TITLE TEXT-006.
      parameters: p_usafl obligatory default 'E'. "Usgae indicator
      parameters: p_chk_ui as checkbox "check invalid usage ind "UATK922842
                    default space.                              "UATK922842
      parameters: p_chk_pd as checkbox "check period of the posting date
                    default 'X'.                                "UATK923027
    SELECTION-SCREEN END OF BLOCK 6.
    SELECTION-SCREEN BEGIN OF BLOCK 7 WITH FRAME TITLE TEXT-007.
    parameters: fb70mode default 'N'.
    parameters: fb50mode default 'N'.
    SELECTION-SCREEN END OF BLOCK 7.
    SELECTION-SCREEN BEGIN OF BLOCK 8 WITH FRAME TITLE TEXT-008.
    parameters:
      p_nor  radiobutton group rad1, "new posting
      p_rep2 radiobutton group rad1. "report (flag '2')
    select-options:
      recno for zbacks_gipd-recno    "record number
        default '1' obligatory.
    SELECTION-SCREEN END OF BLOCK 8.
    DATA: BEGIN OF TAB OCCURS 1000,
             WERKS(04),  "plant
             AUFNR(25),  "production order number
             MATNR(18),  "material
             ERDAT(10),  "BACKS tx date
             MENGE_as_string(17),  "qty
             USAFL(01),  "consumption/usage indicator
             SAKNR(10),  "G/L account number (this is from user's data file,
                         "use SAKNR_FOR_POSTING to post mat. doc instead)
           EXPCD(02),  "expenses code
             IDNUM(35),  "BACKS Identification number
             kunnr(10),  "customer number
    The below 3 fields have no use in SAP transactions
    however they are included in the data file from BACKS.
    Just store them in ZBACKS_GIPD for future use if required
             USACD(10),  "usage code
             ORDCD(10),  "order code
             LOSTY(03),  "loss type
             COTAX(13),  " like zbacks_gipd-cotax, "consumption tax
             MWSKZ(02),  " like zbacks_gipd-MWSKZ, "tax code
    The below fields are not included in the BACKS incoming data file
    They are only for the processing of this program
             RECNO(10),  "record number in the uploaded data file
             FAILF(01),  "Status flag (0=OK, see documentation for details)
             MSGNR(01),                     "message number
             MSGTX(200),                    "message text
             menge(13) type p decimals 3, "qty as numeric
             BUKRS        like t001-bukrs,  "company code
             PRCTR        like marc-prctr,  "profit center
             matkl        like mara-matkl,  "material group
             unitstdcost  type p decimals 3,"standard cost (per 1 EA)
             matloading   type i,           "material loading
             runum        like zprdordhdr-runum,"prod. order running number
           SAKNR        like zexpense-saknr, "account no.
             KOSTL        like zexpense-kostl, "cost center
             saknr_for_posting like bseg-saknr,"G/L acct after validation
             erdat_raw(10),                    "BACKS tx date (MM/DD/YYYY)
    **>>1104
           post_seq_ORIG like DATATYPE-INTEGER4,
           "(5) type n,          "random number: posting order
           post_seq_RAND like DATATYPE-INTEGER4,
           "(5) type n,          "random number: posting order
    **>>1104
             MATDOC(10),     "material document
             MATDOCITEM(4),  "material document item number
             Direction(1),   "I=Issue, R=Reverse (based on the +/- of MENGE)
             ladra like zbacks_gipd-ladra, "material loading rate
             hdr_SUBPR like zprdordhdr-SUBPR, "Sub-con Prodorder "UATK922842
    the below 2 fields are added to resolve 1-yen issue        "DEVK914235
             STOCKQTY like ZBACKS_GIPD-STOCKQTY,    "total stock (from MBEW)
             SALK3    like ZBACKS_GIPD-SALK3,      "total value before issue
             ISSUESTPRS like ZBACKS_GIPD-ISSUESTPRS,"unit std cost
          END OF TAB.
    data: START_RECNO like ZBACKS_GIPD-recno.
    DATA: BEGIN OF BDCDATA OCCURS 100.
          INCLUDE STRUCTURE BDCDATA.
    DATA: END OF BDCDATA.
    data: begin of msgtab occurs 0.
          INCLUDE STRUCTURE BDCMSGCOLL.
    data: end of msgtab.
      Constants used in A/C & Inv postings                               *
    for JV posting
    CONSTANTS:
      CONST_SAKNR_WIP_LABOUR_OH like BSEG-SAKNR "G/L act: WIP-Labour & O/H
        value '0000141000',
      CONST_SAKNR_WIP_MAT_LOAD like BSEG-SAKNR  "G/L act: WIP Matl. Loading
        value '0000543004',
      CONST_SAKNR_WIP_MAT like BSEG-SAKNR            "G/L act: WIP matl
        value '0000140000',
      CONST_SAKNR_OTHER_INCOME like BSEG-SAKNR       "G/L act: Other income
        value '0000725000', "was: '0000400310',
      CONST_SAKNR_WIP_MAT_SUB_CON like BSEG-SAKNR    "G/L act: Mat supplied
        value '0000126001'.                          "to subcontractor
    for material movement (inventory posting)
    CONSTANTS:
       CONST_LGORT like mseg-LGORT      "storage location
         value 'STR1',
       CONST_CHARG like mseg-charg      "batch number
         value 'BACKS'.
    for AR customer invoice for sub-contractor
    CONSTANTS:
       CONST_TAX_RATE     type p decimals 2 value '0.05',     "i.e. 5%
       CONST_PENALTY_RATE type p decimals 2 value '0.2'.      "i.e. 20%
      Structures & internal tables for BAPI - Material movement          *
    Header segment with control information
    DATA: BEGIN OF GOODSMVT_HEADER OCCURS 0.
          INCLUDE STRUCTURE BAPI2017_GM_HEAD_01.
    DATA: END OF GOODSMVT_HEADER.
    DATA: BEGIN OF GOODSMVT_CODE OCCURS 0.
          INCLUDE STRUCTURE BAPI2017_GM_CODE.
    DATA: END OF GOODSMVT_CODE.
    DATA: BEGIN OF GOODSMVT_ITEM OCCURS 0.
          INCLUDE STRUCTURE BAPI2017_GM_ITEM_CREATE.
    DATA: END OF GOODSMVT_ITEM.
    DATA: BEGIN OF REMSG OCCURS 0.
          INCLUDE STRUCTURE BAPIRET2.
    DATA: END OF REMSG.
    DATA: BEGIN OF GOODSMVT_HEADRET OCCURS 0.
          INCLUDE STRUCTURE BAPI2017_GM_HEAD_RET.
    DATA: END OF GOODSMVT_HEADRET.
    *DATA: MATDOC LIKE BAPI2017_GM_HEAD_RET-MAT_DOC.
    DATA: DOCYEAR LIKE BAPI2017_GM_HEAD_RET-DOC_YEAR.
      Structures & internal tables for BAPI - Account Doc Posting        *
    DATA: DOCUMENTHEADER like BAPIACHE08.
    DATA: BEGIN OF ACCOUNTGL occurs 0.
          include structure BAPIACGL08.
    DATA: END OF ACCOUNTGL.
    DATA: BEGIN OF CURRENCYAMOUNT occurs 0.
          include structure BAPIACCR08.
    DATA: END OF CURRENCYAMOUNT.
    DATA: BEGIN OF RETURN occurs 0.
          include structure BAPIRET2.
    DATA: END OF RETURN.
      Misc. internal tables and variable for error logging               *
    DATA: BEGIN OF ERRTX OCCURS 0,
          MSGTX(110).
    DATA: END OF ERRTX.
    DATA: ERR(1) TYPE C.
        TTLQTY(12) TYPE P,
        SUCQTY(12) TYPE P,
        FALQTY(12) TYPE P.
      Calculation variables for sub-contractor                           *
      data: ar_amt_vendor   type p decimals 0.
      data: ar_amt_penalty  type p decimals 0.
      data: ar_amt_total    type p decimals 0.
      data: ar_amt_tax      type p decimals 0.
      data: ar_amt_vendor_as_text(13).
      data: ar_amt_penalty_as_text(13).
      data: ar_amt_total_as_text(13).
      data: ar_amt_tax_as_text(13).
    data: last_werks like tab-werks. "plant
    data: last_matnr like tab-matnr. "to avoid locking problem -> Sleep if
                               "the current p/n is the same as the last one
    data: last_direction.
    DATA: FI_DOC_TEXT(50).   "contains: 1-35:  BACKS ID
                             "          36-50: Quantity
    data: begin of tab_by_matnr occurs 0.
          include structure tab.
    data: end of tab_by_matnr.
    data: MATDOC_AND_ITEM(16). "to put in reference fields
      Data for mat doc item rearrangement                                *
    *Max. no. of items in a single material doc.
    *This number must be less than the half of the FI doc. item limit (999)
    constants:
      c_max_mat_doc_items type i value '400'.
    last flag to indicate if a break is required
    data: l_last_matnr     like tab-matnr.     "last material
    data: l_last_direction like tab-direction. "last direction (+ or -)
    data: l_last_werks     like tab-werks.     "last plant
    count the no. of items (to check against the max. no. of item limit)
    data: l_matnr_counter type i.
      Start and End date of the allowed posting priod                    *
    data: g_period_start_date like sy-datum. "first date of current period
    data: g_period_end_date   like sy-datum. "end date of current period
      Stock info before Goods issue (to solve 1-yen issue)               *
    data: G_SALK3(16) type p decimals 0. "total stock value
    data: G_LBKUM like mbew-lbkum.      "total stock qty
         T O P   O F   P A G E
    TOP-OF-PAGE.
    CALL FUNCTION 'Z_PRINT_REPORT_HEADING'
         EXPORTING
                I_WERKS = 'IHK1'
                I_LINSZ = SY-LINSZ
                I_CPROG = SY-CPROG
                I_TITLE = SY-TITLE.
    WRITE: /1(006)  'Plant'                color 1,
             (025)  'Production Order No'  color 1,
             (018)  'Material'             color 1,
             (010)  'CreDate'              color 1,
             (015)  'Qty'                  color 1,
             (010)  'Usage Ind.'           color 1,
             (010)  'G/L Acct.'            color 1,
             (025)  'BACKS ID'             color 1,
             (010)  'Cust.No.'             color 1,
             (001)  'Fail Flag'            color 1,
             (100)  'Message'              color 1.
    ULINE.
      START - OF - SELECTION                                             *
    START-OF-SELECTION.
    if p_chk_pd = 'X'. "check preiod is needed    "UATK923027
      perform start_end_date_of_period.  "calculate period start/end date
      if   g_period_start_date is initial     "if the start/end date is not
        or g_period_end_date   is initial.    "determined, stop the program
        write: / 'Period start/end date not determined, program stopped.'.
        stop.
      endif.
    endif.
    if p_nor = 'X'.
      PERFORM COMMON_SETUP_FILENAMES. "auto setup filenames by current date
      PERFORM COMMON_UPLOAD_FILES.    "upload input files: TXT and FLG
      PERFORM CONVERSION_DATA.
    elseif p_rep2 = 'X'.
      perform read_data_from_GIPD.
    endif.
    PERFORM CHECK_DATA.
    PERFORM MAIN_UPDATE.
    PERFORM PRINT_OUTPUT.
    PERFORM COMMON_DOWNLOAD_FILES.  "download the log & status file
      FORM READ_DATA_FROM_GIPD                                         *
    form read_data_from_GIPD.
      select * from zbacks_gipd
        where failf = '2'
          and recno in recno.
        clear tab.
        clear result_total. "reset the record counter
        tab-werks = zbacks_gipd-WERKS.         "plant
        tab-aufnr = zbacks_gipd-AUFNR.         "production order no.
        tab-matnr = zbacks_gipd-MATNR.         "material
        tab-erdat = zbacks_gipd-BUDAT.         "transaction date
        tab-recno = zbacks_gipd-recno.
        TAB-MENGE = zbacks_gipd-menge.         "qty
        TAB-USAFL = zbacks_gipd-usafl.         "usage/consumption ind.
             TAB-EXPCD            "Expenses code
        TAB-SAKNR = zbacks_gipd-saknr.         "G/L account number
        TAB-IDNUM = zbacks_gipd-idnum.         "BACKS identification no.
        TAB-KUNNR = zbacks_gipd-kunnr.         "Customer Number
        TAB-USACD = zbacks_gipd-usacd.         "usage code
        TAB-ORDCD = zbacks_gipd-ordcd.         "order code
        TAB-LOSTY = zbacks_gipd-losty.         "loss type
        TAB-COTAX = zbacks_gipd-cotax.         "consumption tax
        TAB-MWSKZ = zbacks_gipd-mwskz.         "tax code
        tab-runum = zbacks_gipd-runum.         "running number
        tab-failf = zbacks_gipd-failf.     "failure flag
        tab-msgnr = zbacks_gipd-failf.     "failure flag
        tab-matdoc = zbacks_gipd-docm1.    "material doc
        tab-msgtx = 'Repost 2nd step'.
       tab-erdat_raw = tab-erdat. "keep the MM/DD/YYYY format
       CONCATENATE TAB-ERDAT6(4) TAB-ERDAT0(2) TAB-ERDAT+3(2)
              INTO TAB-ERDAT.
         concatenate tab-erdat+4(2) '/'
                     tab-erdat+6(2) '/'
                     tab-erdat+0(4)
                   into tab-erdat_raw.
    *Process only a particular set of usage indicator first
        if tab-usafl = p_usafl.
          APPEND TAB.
          result_total = result_total + 1. "Increase the record counter
        endif.
      endselect.
      write: / 'Re-processing records for usage indicator', p_usafl.
    endform.
      FORM CONVERSION_DATA                                               *
    FORM CONVERSION_DATA.
      data: saknr_len type i. "field length of GL acct
      data: kunnr_len type i. "field length of cust no.
      describe field tab-saknr length saknr_len.
      describe field tab-kunnr length kunnr_len.
      clear result_total. "reset the record counter
      LOOP AT STR_TXT.
         CLEAR TAB.
         SPLIT STR_TXT-SLINE AT '|'
          INTO TAB-WERKS            "plant
               TAB-AUFNR            "production order no.
               TAB-MATNR            "material
               TAB-ERDAT            "transaction date
               TAB-MENGE_as_string  "qty
               TAB-USAFL            "usage/consumption ind.
             TAB-EXPCD            "Expenses code
               TAB-SAKNR            "G/L account number
               TAB-IDNUM            "BACKS identification no.
               TAB-KUNNR            "Customer Number
               TAB-USACD            "usage code
               TAB-ORDCD            "order code
               TAB-LOSTY            "loss type
               TAB-COTAX            "consumption tax
               TAB-MWSKZ            "tax code
         tab-erdat_raw = tab-erdat. "keep the MM/DD/YYYY format
         CONCATENATE TAB-ERDAT6(4) TAB-ERDAT0(2) TAB-ERDAT+3(2)
                INTO TAB-ERDAT.
         tab-menge = tab-menge_as_string. "convert to numeric field
    *set tab-msgnr to 1 for invalid usage indicator
    *so that the error records will be included in the error log
         if p_chk_ui = 'X'.
           perform check_usage_indicator.
         endif.
    *Process only a particular set of usage indicator first
    *{Gary Tang 02/10/2003 UATK922842 also include MSGNR=1 (invalid usage
    *incicator records
         if tab-usafl = p_usafl "this is the target usage indicator
            or tab-msgnr = '1'. "this is 1 because of invalid usage ind.
    *}Gary Tang 02/10/2003 UATK922842
    add leading zero to numeric GL acct no.
    e.g. data file: 230330 --> convert to: 0000230330
           CALL FUNCTION 'Z_PURE_NUMERIC_ADD_LEADING_0'
             EXPORTING
               INPUT_FIELD        = tab-saknr
               TARGET_LEN         = saknr_len
             IMPORTING
               OUTPUT_FIELD       = tab-saknr
    add leading zero to numeric cust num
    e.g. data file: 3100001 --> convert to: 0003100001
    e.g. data file: NEC-JP  --> no conversion: NEC-JP
           CALL FUNCTION 'Z_PURE_NUMERIC_ADD_LEADING_0'
             EXPORTING
               INPUT_FIELD        = tab-kunnr
               TARGET_LEN         = kunnr_len
             IMPORTING
               OUTPUT_FIELD       = tab-kunnr
           APPEND TAB.
           result_total = result_total + 1. "Increase the record counter
         endif.
      ENDLOOP.
      write: / 'Processing records for usage indicator', p_usafl.
    ENDFORM.
      FORM CHECK_DATA                                                    *
    FORM CHECK_DATA.
       if p_nor = 'X'.
         PERFORM GET_NEXT_RECNO.
       endif.
       LOOP AT TAB.
          perform check_data_on_period."record date must in current period
          perform check_data_on_zprdordhdr. "production order header
          perform check_data_on_mara.  "material master (general)
          perform check_data_on_marc.  "material master (plant)
          perform check_data_on_t001k. "company code vs plant
          perform check_data_on_mbew.  "Material Valuation
          perform check_usage_indicator. "usage indicator
          perform check_sub_contract.  "must have customer number
          perform check_data_on_kna1.  "customer number
          perform check_data_on_skb1.  "G/L account
          perform check_menge.         "quantity
        perform check_expense.       "for eXpenses
          perform calculate_materail_loading.
        perform gen_random_posting_sequence.
          if p_nor = 'X'.
            PERFORM INSERT_TABLE_ZBACKS_GIPD.
          endif.
          MODIFY TAB.
      endloop.
      if p_nor = 'X'.
    print the last record number for reference
      write: / 'ZBACKS_GIPD record number (RECNO) to   :',
                ZBACKS_GIPD-RECNO.
      skip 1.
      endif.
    endform.
      FOMR Gen_random_posting_sequence                                   *
    *form gen_random_posting_sequence.
    tab-post_seq_ORIG = SY-TABIX.
    if tab-msgnr = '1'. "no need to go further if already rejected
       tab-post_seq_RAND = 0.
    else.
       CALL FUNCTION 'RANDOM_I4'
         EXPORTING
           RND_MIN         = 1
           RND_MAX         = 50000
         IMPORTING
           RND_VALUE       = tab-Post_seq_RAND
    endif.
    *endform.
      FOMR CHECH_MENGE                                             *
    form check_MENGE.
      if tab-menge > 0.      "Issue qty > 0
        tab-direction = 'I'. "Issue (i.e. decrease the inventory)
      elseif tab-menge < 0.  "Issue qty < 0
        tab-direction = 'R'. "Reverse (i.e. increase the inventory
      elseif tab-menge = 0.  "Issue qty = 0 ==> Strange case, error!
        TAB-MSGNR = '1'.
        tab-msgtx = 'Qty is 0. Nothing to post!'.
      endif.
    endform.
      FOMR CHECH_USAGE_INDICATOR                                         *
    form check_usage_indicator.
      case tab-usafl.
        when 'I'. "Inhouse production
        when 'E'. "External procurement
        when 'X'. "Expense
        when 'T'. "transfer to sub-contractor
        when 'S'. "sale to sub-contractor
        when 'C'. "consign to sub-contractor
      when '?'. "add new usage indicator here if needed!
        when others. "illegal value! reject the record
          TAB-MSGNR = '1'.
         concatenate 'Invalid usage indicator'
           into tab-msgtx separated by space.
          tab-msgtx = 'Invalid usage indicator'.
      endcase.
    endform.
    *form check_expense.
    check not tab-msgnr = '1'. "no need to go further if already rejected*
    check tab-usafl = 'X'. "only for expense
    SELECT SINGLE ZEXPENSE~SAKNR
                   ZEXPENSE~KOSTL
       into (TAB-SAKNR,
             TAB-KOSTL)
       FROM ZEXPENSE
       WHERE ZEXPENSE~WERKS = TAB-WERKS
         AND ZEXPENSE~EXPCD = TAB-EXPCD.
    IF SY-SUBRC <> 0.
       TAB-MSGNR = '1'.
       TAB-MSGTX = 'Expense code not found (ZEXPENSE)'.
    endif.
    *endform.
      FOMR CALCULATE_MATERIAL_LOADING                                    *
    form calculate_materail_loading.
      check not tab-msgnr = '1'. "no need to go further if already rejected
    *Material loading is calculated for all records
    *Though posting only required for usage 'E'
    check tab-usafl = 'E'. "only for External procurement need to post
      select single ZSTDLOADING~LADRA  "loading %
        into ZSTDLOADING-LADRA         "loading %
        from ZSTDLOADING               "standard loading info.
        where WERKS = tab-werks        "plant
          and MATGP = tab-matkl+0(2)   "customer code
        and LADTY = tab-usafl.       "usage code
          and LADTY = 'P'.             "material loading
      if ( sy-subrc <> 0 ).
       or ( zstdloading-LADRA is initial ). "DEVK909574
        TAB-MSGNR = '1'.
        TAB-MSGTX = 'Mat. loading % not found or = 0% (ZSTDLOADING)'.
      else.
        tab-ladra = zstdloading-ladra. "store the loading rate into table
    *{Gary Tang 02/10/2003                                     "UATK922842
    round the qty*stdcost to integer before multiplying the loading rate
        tab-matloading         "type is integer (result will be rounded off)
          = tab-menge          "qty
    tab-unitstdcost.   "std cost (of 1 EA)
         * ZSTDLOADING-LADRA "material loading percentage (%)
         / 100.              "because material loading is in %
       tab-matloading         "type is integer (result will be rounded off)
          = tab-matloading
    ZSTDLOADING-LADRA "material loading percentage (%)
           / 100.              "because material loading is in %
    *}Gary Tang 02/10/2003                                     "UATK922842
      endif.
    endform.
      FORM CHECK_DATA_ON_SKB1                                            *
    form check_data_on_SKB1.
      data: saknr_as_numeric(10) type n. "for leading zero
      check not tab-msgnr = '1'. "no need to go further if already rejected
      case tab-usafl.
      when 'I' or 'E' or 'C'.
        if not tab-saknr is initial.
          TAB-MSGNR = '1'.
          concatenate 'G/L Account no. should be blank for usage indicator'
            tab-usafl into tab-msgtx separated by space.
        else.
          tab-saknr_for_posting = CONST_SAKNR_WIP_MAT.
        endif.
      when 'T' or 'S'.
        if not tab-saknr is initial.
          TAB-MSGNR = '1'.
          concatenate 'G/L Account no. should be blank for usage indicator'
            tab-usafl into tab-msgtx separated by space.
        else.
          tab-saknr_for_posting = CONST_SAKNR_WIP_MAT_SUB_CON.
        endif.
      when 'X'. "G/L acct is required for eXpense
        if tab-saknr is initial.
          TAB-MSGNR = '1'.
          concatenate 'G/L Account no. is REQUIRED for usage indicator'
            tab-usafl into tab-msgtx separated by space.
        else.
          CATCH SYSTEM-EXCEPTIONS CONVT_NO_NUMBER = 4.
            SAKNR_AS_NUMERIC = TAB-SAKNR.
          endcatch.
          if sy-subrc = 4.
            TAB-MSGNR         = '1'.
            TAB-MSGTX         = 'Invild G/L acct no. (should be numeric)'.
          endif.
          select single skb1~saknr
            into skb1-saknr
          from skb1
          where skb1~bukrs = tab-bukrs
            and skb1~saknr = saknr_as_numeric. " tab-saknr.
          if sy-subrc = 0.
            tab-saknr_for_posting = saknr_as_numeric. " tab-saknr.
          else.
            TAB-MSGNR = '1'.
            TAB-MSGTX = 'G/L Account no. not found (SKB1)'.
          endif.
        endif.
      endcase.
    endform.
      FORM CHECK_DATA_ON_PREIOD                                          *
    form check_data_on_period.
      check p_chk_pd = 'X'.      "check period option is selected
      check not tab-msgnr = '1'. "no need to go further if already rejected
      if   tab-erdat < g_period_start_date "record in past period, reject!
        or tab-erdat > g_period_end_date.  "record in future period, reject!
        TAB-MSGNR = '1'.
        TAB-MSGTX = 'Record date is not in open period.'.
      endif.
    endform.
      FORM CHECK_DATA_ON_MBEW                                            *
    form check_data_on_mbew.
      data: local_stprs like mbew-stprs. "std price
      data: local_peinh like mbew-peinh. "price unit
      check not tab-msgnr = '1'. "no need to go further if already rejected
    *Standard cost is checked for all records
    *Though calculation is only required for usage 'E'
    check tab-usafl = 'E' "for External procurement
        or tab-usafl = 'T' "for Transfer to sub-contractor
        or tab-usafl = 'S'."for Sale to sub-contractor
      select single stprs              "std price
                    peinh              "price unit
              into  (local_stprs,      "std price
                     local_peinh)      "price unit
        from mbew                      "material valuation
        where matnr = tab-matnr        "material
          and bwkey = tab-werks.       "plant
      if ( sy-subrc <> 0 )             "record not round
        or ( local_stprs = 0 ).        "std cost = 0 (should not happen)
        TAB-MSGNR = '1'.
        TAB-MSGTX = 'Standard cost not found or = 0 (MBEW)'.
      else.                            "calculate the cost of 1 EA
        tab-unitstdcost = local_stprs / local_peinh * 100.
      endif.
    endform.
      FORM CHECK_DATA_ON_ZPRDORDHDR                                      *
    form check_data_on_zprdordhdr.
      check not tab-msgnr = '1'. "no need to go further if already rejected
    Production order is not required for usage indicator 'T' or 'S'
    Even the number is provided, it may or may not exist in ZPRDORDHDR
    Therefore, all checking on production order can be skipped for T & S
    (11/11/2002, confirmation from Stephen Chung, Miura-san, Sato-san)
      check tab-usafl <> 'T'  "Transfer to sub-contract
        and tab-usafl <> 'S'  "Sales to sub-contract
    Confirmed by Miura-san on 11/30/2002
    Production order no. is also not required for 'X' (Expense)
        and tab-usafl <> 'X'. "Expenses
      if tab-aufnr is initial.
        TAB-MSGNR = '1'.
        TAB-MSGTX = 'Production order number is missing'.
        exit.
      endif.
      select single zprdordhdr~aufnr
        into zprdordhdr-aufnr
        from zprdordhdr
        where zprdordhdr~werks = tab-werks
          and zprdordhdr~aufnr = tab-aufnr.
      if sy-subrc <> 0.
        TAB-MSGNR = '1'.
        TAB-MSGTX = 'Production order number not found (ZPRDORDHDR)'.
      else.
        select max( zprdordhdr~runum )
          into tab-runum
          from zprdordhdr
          where zprdordhdr~werks = tab-werks
            and zprdordhdr~aufnr = tab-aufnr.
       if tab-runum is initial.
         TAB-MSGNR = '1'.
         TAB-MSGTX = 'Production order number not found (ZPRDORDHDR)'.
       else.
          select single
             stats   "production order status
             SUBPR   "Sub-contracting Production Order
            into (zprdordhdr-stats,
                  tab-hdr_SUBPR)    "save into internal table TAB directly!
            from zprdordhdr
            where zprdordhdr~werks = tab-werks
              and zprdordhdr~aufnr = tab-aufnr
              and zprdordhdr~runum = tab-runum.
          if ( zprdordhdr-stats <> 'O' )
            and ( zprdordhdr-stats <> 'C' ).
            TAB-MSGNR = '1'.
            concatenate 'No tx is allowed, production order in status'
            zprdordhdr-stats into tab-msgtx separated by space.
          endif.
       endif.
      endif.
    endform.
      FORM CHECK_DATA_ON_MARA                                            *
    form check_data_on_mara.
      check not tab-msgnr = '1'. "no need to go further if already rejected
    get cost center that is from profit center in MARC
      SELECT SINGLE MARA~MATKL                   "material group
        into MARA-MATKL                          "material group
        FROM MARA                                "Material master
        WHERE MATNR = TAB-MATNR.                 "material
      IF SY-SUBRC = 0.
        TAB-MATKL = MARA-MATKL.                  "material group
      ELSE.
        TAB-MSGNR = '1'.
        TAB-MSGTX = 'Material not found (mat.gp./cust code missing) (MARA)'.
      ENDIF.
    ENDFORM.
      FORM CHECK_DATA_ON_MARC                                            *
    form check_data_on_marc.
      check not tab-msgnr = '1'. "no need to go further if already rejected
    get cost center that is from profit center in MARC
      SELECT SINGLE PRCTR
        into MARC-PRCTR
        FROM MARC  "Plant Data for Material
        WHERE MATNR = TAB-MATNR  "material
          AND WERKS = TAB-WERKS. "plant
      IF SY-SUBRC EQ 0.
        TAB-PRCTR = MARC-PRCTR.  "profit center
      ELSE.
        TAB-MSGNR = '1'.
        TAB-MSGTX =
          'Mat. not found in plant. (Profit center missing) (MARC)'.
      ENDIF.
    ENDFORM.
      FORM CHECK_DATA_ON_KNA1                                            *
    form check_data_on_kna1.  "customer number
    data: kunnr_as_numeric(10) type n.
    data: kunnr_as_string(10).
      check not tab-msgnr = '1'. "no need to go further if already rejected
      check not tab-kunnr is initial.
    IF NOT TAB-KUNNR CA 'ABCDEFGHIJKLMNOPQRSTUVWXYZ.,-_#'.
       kunnr_as_numeric = tab-kunnr.
       kunnr_as_string = kunnr_as_numeric.
    else.
       kunnr_as_string = tab-kunnr.
    ENDIF.
      select single kna1~kunnr
        into kna1-kunnr
        from kna1
      where kunnr = kunnr_as_string. " tab-kunnr.
        where kunnr = tab-kunnr. "customer no. (w/ leading zero if numeric)
      if sy-subrc <> 0.
        TAB-MSGNR = '1'.
        concatenate 'Customer number' tab-kunnr 'not found (KNA1)'
          into tab-msgtx separated by space.
      ENDIF.
    endform.
      FORM CHECK_Sub_contract                                            *
    form check_sub_contract.
      check not tab-msgnr = '1'. "no need to go further if already rejected
      if tab-kunnr is initial.
        if ( tab-usafl = 'T' )
          or ( tab-usafl = 'S' ).
          TAB-MSGNR = '1'.
          concatenate 'Cust number should not be blank for usage indicator'
            tab-usafl into tab-msgtx separated by space.
        endif.
      else.
        if ( tab-usafl <> 'T' )
          and ( tab-usafl <> 'S' ).
          TAB-MSGNR = '1'.
          concatenate 'Cust. number should be blank for usage indicator'
            tab-usafl into tab-msgtx separated by space.
        endif.
      endif.
    endform.
      FORM CHECK_DATA_ON_t001k                                           *
    form check_data_on_t001k.
      check not tab-msgnr = '1'. "no need to go further if already rejected
      select single * from t001k  "Valuation area
        where bwkey = tab-werks.  "plant
      if sy-subrc = 0.
        tab-bukrs = t001k-bukrs.  "company code
      else.
        TAB-MSGNR = '1'.
        concatenate 'Company code not found for plant'
                    tab-werks '(T001K)'
          into tab-msgtx separated by space.
      endif.
    endform.
      FORM POST_GOODS_ISSUE                                              *
    form post_goods_issue.
      perform UPDATE_GI_FOR_COST_CTR.
    clear FI_DOC_TEXT.
    FI_DOC_TEXT+0(35) = tab-idnum.
    write: tab-menge to FI_DOC_TEXT+35(15) right-justified.
    write: / '**', tab-matdoc, '**'.
    endform.
      FORM MAIN_UPDATE                                                   *
    FORM MAIN_UPDATE.
    data: current_lock_matnr like mara-matnr.
    *>>1104
    sort tab by post_seq_RAND ascending.
    *>>1104
    Direction: I=Issue, R=Reverse
    Do reverse first since it will increase invenotry
      sort tab by direction  descending "R first, then I
                  werks      ascending
                  matnr      ascending. "Sort by plant and then material
      if p_nor = 'X'. "new posting first step
    read the first record into the last flag to avoid problem when
    processing the 1st record
        loop at tab where msgnr <> '1'. "skip the rejected records
          last_matnr = tab-matnr.
          last_direction = tab-direction.
          last_werks = tab-werks.
          exit.
        endloop.
      loop at tab where msgnr <> '1'. "skip the rejected records
        if ( tab-werks <> last_werks )
          or ( tab-matnr <&

    Yes I had solved this

  • Customer Item Open Interface Validation

    Hi Folks,
    I have to write package for customer item open interface ,
    can anyone let me know what are the validation required or if any one have package written ,please share it with me .[email protected]
    Waiting for your kind response.
    Thanks in advance....
    Regards
    RP

    Hi
    Please find the code below for Customer Item Interface
    HTH
    Dinesh
    declare
         ex_not_ok     exception          ;
         Cursor      cur_cust_item  is
         select     b.*,rowid from btl_cust_item b      ;
         rec_cur_cust_item     cur_cust_item%rowtype;
         vc_rowid          varchar2(50);     
         vc_error_desc          varchar2(2000);
         vc_org_code          varchar2(20)     :='F02';
         vc_org_id          varchar2(20)     ;
         vc_inv_item          number          ;
         vc_cust_id          varchar2(50)     ;
         vc_create_by          number;
         vc_last_updated_by     number;
         vc_user_name          varchar2(100);
         vc_login_name          varchar2(30)     := '&1';
         vc_master               number;
    begin
         vc_org_id := &2 ;
      vc_master := &3;
         begin
              select      user_id          ,last_updated_by      ,user_name 
              into     vc_create_by     ,vc_last_updated_by     , vc_user_name     
              from      fnd_user
              where      user_name = vc_login_name;
         end;
         open     cur_cust_item;          -- open cursor
         loop
              begin 
              fetch     cur_cust_item
              INTO     rec_cur_cust_item;
              vc_rowid     := rec_cur_cust_item.rowid;
              exit when cur_cust_item%NOTFOUND;
              -- perform the mandatory validations
              -- 1. Check the validity of the customer
              begin
                   select      count(*)
                   into     vc_cust_id
                   from      ra_customers
                   where     upper(customer_number) = upper(rec_cur_cust_item.customer_number);
                   if      vc_cust_id > 0 then
                        null;
                   else
                        vc_error_desc := rec_cur_cust_item.customer_number||' '|| rec_cur_cust_item.customer_name ||' - Customer Number  Does not Exist in Ra_customers';
                        raise     ex_not_ok;
                   end if;                
                   exception
                        when no_data_found then
                        update      btl_cust_item
                        set     process_flag = 'E',
                             error_message = 'XREF-  Customer Does not exist '||vc_error_desc
                        where     rowid     = vc_rowid;
              end ;
              -- 2. Check that the Customer Item Is not Null
              begin
                   if     rec_cur_cust_item.customer_item_number is not null then
                        null;
                   else
                        vc_error_desc := rec_cur_cust_item.Customer_Number ||' - '|| rec_cur_cust_item.customer_item_number || ' - Customer Item has no value    ';
                        raise ex_not_ok;
                   end if;
              end;
              -- 3. Validate the Inventory Item
              begin
                   select      count(*)
                   into     vc_inv_item
                   from      mtl_system_items  a, org_organization_definitions b
                   where     a.organization_id            = b.organization_id
                   and     rec_cur_cust_item.inventory_item = segment1
                   and     a.organization_id             = vc_org_id;
                   if     vc_inv_item != 0 then
                        null;
                   else
                        vc_error_desc := 'Inventory Item '|| rec_cur_cust_item.inventory_item ||'  is not valid/exist in mtl_system_item ';
                        raise ex_not_ok;
                   end if;
              end;
        rec_cur_cust_item.commodity_code := 'MISC';
              insert into mtl_ci_interface (               
                        PROCESS_FLAG          ,
                        PROCESS_MODE          ,
                        TRANSACTION_TYPE     ,
                        CUSTOMER_NUMBER          ,
                        CUSTOMER_NAME          ,
                        CUSTOMER_ITEM_NUMBER     ,
                        ITEM_DEFINITION_LEVEL     ,
                        COMMODITY_CODE          ,
                        INACTIVE_FLAG          ,
                        LOCK_FLAG          ,
                        LAST_UPDATE_DATE     ,
                        LAST_UPDATED_BY          ,
                        CREATION_DATE          ,
                        CREATED_BY          ,
                        --LAST_UPDATE_LOGIN     ,
                        ERROR_CODE          ,
                        ERROR_EXPLANATION               
              values
                        '1'                                ,     --PROCESS_FLAG
                        '1'                                ,     --PROCESS_MODE
                        'CREATE'                     , -- TRNASACTION_TYPE
                        rec_cur_cust_item.customer_number     ,     --CUSTOMER_NUMBER          
                        rec_cur_cust_item.customer_name           , --CUSTOMER_NAME          
                        rec_cur_cust_item.customer_item_number, --CUSTOMER_ITEM_NUMBER     
                        '1'                          , --ITEM_DEFINATION_LEVEL
                        rec_cur_cust_item.commodity_code      , --COMMODITY_CODE
                        '2'                          , --INACTIVE_FLAG
                        'N'                          ,     --LOCK_FLAG
                        sysdate                      , --LAST_UPDATE_DATE
                        vc_last_updated_by                    , --LAST_UPDATED_BY
                        sysdate                          , --CREATION_DATE
                        vc_create_by                     , --CREATED_BY
                        --'10'                          , --LAST_UPDATE_LOGIN
                        'N'                          , --ERROR_CODE
                        ' '                             --ERROR_EXPLANATION
              Insert into mtl_ci_xrefs_interface (
                        PROCESS_FLAG          ,
                        PROCESS_MODE          ,
                        TRANSACTION_TYPE     ,
                        CUSTOMER_NUMBER          ,
                        CUSTOMER_NAME          ,
                        CUSTOMER_ITEM_NUMBER     ,
                        ITEM_DEFINITION_LEVEL     ,
                        INVENTORY_ITEM          ,
                        MASTER_ORGANIzATION_ID     ,
                        PREFERENCE_NUMBER     ,
                        INACTIVE_FLAG          ,
                        LOCK_FLAG          ,
                        LAST_UPDATE_DATE     ,
                        LAST_UPDATED_BY          ,
                        CREATION_DATE          ,
                        CREATED_BY          ,
                        --LAST_UPDATE_LOGIN     ,
                        ERROR_CODE          ,          
                        ERROR_EXPLANATION
              Values
                        '1'                    ,      --PROCESS_FLAG          
                        '1'                    ,      --PROCESS_MODE          
                        'CREATE'               ,      --TRNSACTION_TYPE          
                        rec_cur_cust_item.customer_number,     --CUSTOMER_NUMBER          
                        rec_cur_cust_item.customer_name     ,      --CUSTOMER_NAME          
                        rec_cur_cust_item.customer_item_number, --CUSTOMER_ITEM_NUMBER     
                        '1'                    ,     --ITEM_DEFINATION_LEVEL     
                        rec_cur_cust_item.inventory_item,     --INVENTORY_ITEM
                        vc_master               ,      --MASTER_ORGANISATION_ID
                        '1'                    ,     --PREFERENCE_NUMBER
                        '2'                    ,     --INACTIVE_FLAG     
                        'N'                    ,     --LOCK_FLAG     
                        sysdate                    ,     --LAST_UPDATE_DATE     
                        vc_last_updated_by          ,     --LAST_UPDATED_BY          
                        sysdate                    ,     --CREATION_DATE          
                        vc_create_by               ,     --CREATED_BY          
                        --'10'                    ,     --LAST_UPDATE_LOGIN     
                        'N'                    ,     --ERROR_CODE                    
                        ' '                         --ERROR_EXPLANATION     
    --dbms_output.put_line( ' Inserting into reference table - done');
              exception
                   when ex_not_ok then
                        update      btl_cust_item
                        set     process_flag = 'E',
                             error_message = 'XREF-'||vc_error_desc
                        where     rowid     = vc_rowid;                    
              end ;
         end loop;
         commit;
         begin
               dbms_application_info.set_client_info(' ');     
         end;
         dbms_output.put_line ( ' End time ' || to_char( sysdate, 'DD-MON-YYYY HH24:MI:SS'));
         exception
              when others then
                   dbms_output.put_line( Sqlcode || ' ' || Sqlerrm );
    end ;
    /

  • Forms and validations - here's some of my ideas, what are yours?

    One of the big things still missing from the JFX space (especially where JEE is concerned) is forms and form validations. Maybe you guys have been luckier but at least 80% of the screens I've had to build in my career have been boring old forms - enter data in the fields, validate them and hit submit.
    So, I've been hacking around on this to try and get a pattern and hopefully some reusable classes for doing this in JavaFX. I have something that works but the code is verbose and less than elegant. I'm hoping some of you guys might want to kick around some ideas on this with me here. If we can come up with something that works, I'd like to either include it in [url http://www.zenjava.com/jfx-flow/]JFX Flow, or put it out as a separate open source project (whichever makes more sense).
    What I think needs to be supported:
    * Map between a normal Java bean and the fields on a form
    * Validate the data, i.e. specifying the constraints on a field and then checking those constraints
    * Show a validation summary at the top of the form
    * Highlight individual fields if they have validation errors
    * Support auto-validation, i.e. the validation highlights and messages will instantly update as the user types
    Some extra restrictions:
    * The data input will ideally be a normal bean and so it won't have observable values on it. In most projects I use, the beans are coming from the server and sometimes may be shared between desktop client and a jsp/web client, or even be a third party API so they can't be changed. End result: we don't want any JFX complexities or dependencies in our server code (design leak). This rule could be bent but only as a last resort.
    * The validations must be defined relative to the normal data bean not a JFX model or controller, etc. This is so the bean can be validated on the server as well as the client. The server must do validation to prevent dodgy data getting in (never trust a client). Ideally we don't want to be specifying the validations in two places (i.e. once for the client and once for the server) as this creates maintenance problems and weakens the integrity of the system over time.
    * Ideally the validation mechanism will be based on [url http://java.dzone.com/articles/bean-validation-and-jsr-303]JSR 303 - Bean Validations as this is quite nice. This is flexible however if there is a suitable alternative that integrates better.
    To give us something to reference in conversation, I've created a small working sample. This is only meant to be a rough starting point (at best) and I'd really like to get feedback on both the code (i.e. should we have a 'presentation model', how could bindings be better used, etc) and the general way I'm representing errors (i.e. should we use tooltips to show errors, or actually show the errors next to the field, should we use border colours or put a little exclamation mark over the field, should the fields be auto-validated or only validated on submit, etc).
    The example is a single form for editing a person. It has three fields, first name, last name and gender. When the form is blank, auto-editing is off. When the user submits the form it is validated and from that point on auto-validating is on. Error fields are highlighted with a style change, and a tooltip is added with details (I think we can do better - what's your ideas?).
    I have used all plain Java to keep thngs simple, but I'd be looking for the end result to translate to FXML as well. I've also coded everything into the one class but the eventual goal would be to have the common stuff moved out to reusable base classes, etc.
    Here's a workspace with some example code in it: http://code.google.com/p/jfxee/source/browse/trunk/jfxforms/
    Here's a running deploy of that code: http://zenjava.com/demo/form/forms.html
    (edit: I've moved the code to its own project and changed the url for the launch - the values above are the new, correct ones)
    Looking forward to hearing some thoughts on this topic.
    Edited by: zonski on 01-Dec-2011 13:41

    At Devoxx I did some straw man prototype that you might find useful (or hopeless, I'm not sure which, I did it in a hurry :-)). I followed some principles that I was influenced by years back by JGoodies, but I haven't looked at the JGoodies stuff in forever and know it isn't all the same. But anyway, like I said, I'm not sure it is actually useful but maybe there is something genius hidden in there.
    I have a Validator, which is just a simple SAM:
    import javafx.scene.control.Control;
    * @author Richard
    public interface Validator<C extends Control> {
        public ValidationResult validate(C control);
    }The idea is that it is given a Control, it will validate that control, and then return a ValidationResult. ValidationResult is actually only needed in cases of errors, since returning null indicates success, so the following is somewhat of a crock but you could rename it ValidationError or something and remove the "SUCCESS" type and there you are.
    public class ValidationResult {
        public enum Type { ERROR, WARNING, SUCCESS }
        private final String message;
        private final Type type;
        public ValidationResult(String message, Type type) {
            this.message = message;
            this.type = type;
        public final String getMessage() {
            return message;
        public final Type getType() {
            return type;
        }For good measure I threw in a ValidationEvent.
    import javafx.event.Event;
    import javafx.event.EventType;
    * @author Richard
    public class ValidationEvent extends Event {
        public static final EventType<ValidationEvent> ANY =
                new EventType<ValidationEvent>(Event.ANY, "VALIDATION");
        private final ValidationResult result;
        public ValidationEvent(ValidationResult result) {
            super(ANY);
            this.result = result;
        public final ValidationResult getResult() { return result; }
    }Because Control's don't presently have the notion of validation built in, I created a ValidationPane which is like a specialized StackPane, where there is a bottom layer, the control, and a glass pane layer. And from CSS you can style it however you like. The ValidationPane has a CSS style class set in case of errors / warnings. So without augmenting controls, the idea is that a ValidationPane subclass would exist to wrap each type of control you needed to validate. It did this because somebody has to wire up the listeners to the control to react on text input etc, and so I thought I'd like that encapsulated in something reusable, and there it was.
    import javafx.beans.DefaultProperty;
    import javafx.beans.property.ObjectProperty;
    import javafx.beans.property.ReadOnlyObjectProperty;
    import javafx.beans.property.ReadOnlyObjectWrapper;
    import javafx.beans.property.SimpleObjectProperty;
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.event.EventHandler;
    import javafx.scene.control.Control;
    import javafx.scene.layout.Region;
    * @author Richard
    @DefaultProperty("content")
    public abstract class ValidatorPane<C extends Control> extends Region {
         * The content for the validator pane is the control it should work with.
        private ObjectProperty<C> content = new SimpleObjectProperty<C>(this, "content", null);
        public final C getContent() { return content.get(); }
        public final void setContent(C value) { content.set(value); }
        public final ObjectProperty<C> contentProperty() { return content; }
         * The validator
        private ObjectProperty<Validator<C>> validator = new SimpleObjectProperty<Validator<C>>(this, "validator");
        public final Validator<C> getValidator() { return validator.get(); }
        public final void setValidator(Validator<C> value) { validator.set(value); }
        public final ObjectProperty<Validator<C>> validatorProperty() { return validator; }
         * The validation result
        private ReadOnlyObjectWrapper<ValidationResult> validationResult = new ReadOnlyObjectWrapper<ValidationResult>(this, "validationResult");
        public final ValidationResult getValidationResult() { return validationResult.get(); }
        public final ReadOnlyObjectProperty<ValidationResult> validationResultProperty() { return validationResult.getReadOnlyProperty(); }
         *  The event handler
        private ObjectProperty<EventHandler<ValidationEvent>> onValidation =
                new SimpleObjectProperty<EventHandler<ValidationEvent>>(this, "onValidation");
        public final EventHandler<ValidationEvent> getOnValidation() { return onValidation.get(); }
        public final void setOnValidation(EventHandler<ValidationEvent> value) { onValidation.set(value); }
        public final ObjectProperty<EventHandler<ValidationEvent>> onValidationProperty() { return onValidation; }
        public ValidatorPane() {
            content.addListener(new ChangeListener<Control>() {
                public void changed(ObservableValue<? extends Control> ov, Control oldValue, Control newValue) {
                    if (oldValue != null) getChildren().remove(oldValue);
                    if (newValue != null) getChildren().add(0, newValue);
        protected void handleValidationResult(ValidationResult result) {
            getStyleClass().removeAll("validation-error", "validation-warning");
            if (result != null) {
                if (result.getType() == ValidationResult.Type.ERROR) {
                    getStyleClass().add("validation-error");
                } else if (result.getType() == ValidationResult.Type.WARNING) {
                    getStyleClass().add("validation-warning");
            validationResult.set(result);
            fireEvent(new ValidationEvent(result));
        @Override
        protected void layoutChildren() {
            Control c = content.get();
            if (c != null) {
                c.resizeRelocate(0, 0, getWidth(), getHeight());
        @Override
        protected double computeMaxHeight(double d) {
            Control c = content.get();
            return c == null ? super.computeMaxHeight(d) : c.maxHeight(d);
        @Override
        protected double computeMinHeight(double d) {
            Control c = content.get();
            return c == null ? super.computeMinHeight(d) : c.minHeight(d);
        @Override
        protected double computePrefHeight(double d) {
            Control c = content.get();
            return c == null ? super.computePrefHeight(d) : c.prefHeight(d);
        @Override
        protected double computePrefWidth(double d) {
            Control c = content.get();
            return c == null ? super.computePrefWidth(d) : c.prefWidth(d);
        @Override
        protected double computeMaxWidth(double d) {
            Control c = content.get();
            return c == null ? super.computeMaxWidth(d) : c.maxWidth(d);
        @Override
        protected double computeMinWidth(double d) {
            Control c = content.get();
            return c == null ? super.computeMinWidth(d) : c.minWidth(d);
    }And finally the TextInputValidatorPane instance good for any TextInputControl. I think.
    import javafx.beans.InvalidationListener;
    import javafx.beans.Observable;
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.scene.control.TextInputControl;
    * @author Richard
    public class TextInputValidatorPane<C extends TextInputControl> extends ValidatorPane<C> {
        private InvalidationListener textListener = new InvalidationListener() {
            public void invalidated(Observable o) {
                final Validator v = getValidator();
                final ValidationResult result = v != null ?
                    v.validate(getContent()) :
                    new ValidationResult("", ValidationResult.Type.SUCCESS);
                handleValidationResult(result);
        public TextInputValidatorPane() {
            contentProperty().addListener(new ChangeListener<C>() {
                public void changed(ObservableValue<? extends C> ov, C oldValue, C newValue) {
                    if (oldValue != null) oldValue.textProperty().removeListener(textListener);
                    if (newValue != null) newValue.textProperty().addListener(textListener);
        public TextInputValidatorPane(C field) {
            this();
            setContent(field);
    }This should also be usable as is from FXML since you can easily wrap a TextInputValidatorPane around a TextField, and CSS does all the styling, so I think it all just works. You probably need to have some library of sophisticated Validators which know how to read text from a TextField and compare against the validation annotations, but otherwise it should work well enough. Anyway, in the actual implementation I think I would omit the ValidationPane stuff completely and just build that part into the controls / skins. Like I said, this was a quick hack but seemed to get the "how do I visualize validation errors" part of the problem solved.
    Richard

  • Custom Annotation :: inject object at runtime

    I would like develop a custom annotation to inject object at runtime. The annotation will work as follows
    1. develop ValidatorClass annotation on type.
    2. If annotated on a type object will be created at runtime and injected to the object. e.g. in class A it will inject validatorimpl object to vald object/
    Please let me know how to implement that.
    package com.debopam.validate
    public interface validator{
    public String validate();
    package com.debopam.validate
    public class validatorimpl implements validator{
    public String validate(){
       return "true";
    pckage com.debopam
    public class A{
    @ValidatorClass(name="com.debopam.validate.validatorimpl")
    validator vald;
    }

    yogeshd,
    It might be that the .class file for the annotation that you are compiling against is the one you have given us the source code for above, but when you run the program, the class file for the annotation is not the same, and is one that was compiled before you added the static field.
    This can happen if your classpath is wrong. (and would explain why the problem only occurs sometimes - because it is only failing when the classpath is wrong).
    If you run the following program with the Fully qualified name of your annotation as the argument, and with the same classpath as you run your program, it can tell you where it is finding the annotation class file. Check that this is the same one that you are compiling to.
    class WhereLoaded {
        public static void main(String[] args) {
            Class theClass=null;
            if(args.length > 0) {
                try {
                    theClass=Class.forName(args[0]);
                } catch (Exception e) {
                    e.printStackTrace();
                    theClass=Object.class;
            } else {
                System.out.println(
                    "The first argument should be a fully qualified class name," +
                    " using java.lang.Object instead"
                theClass=Object.class;
            String name=theClass.getName();
            name=name.substring(name.lastIndexOf(".")+1) + ".class";
            System.out.println(name + " loaded from " + theClass.getResource(name));
    }regards
    Bruce

  • Need to send a mail from a specific From mail ID thorgh specific Mail serve

    Hi,
    If any errors occured in my interface validation program(plsql) I need to send mail to some mail ids,
    But I need to use specific from mail id and mail server.
    I have no idea of Shell scripting, I tried it with plsql itself but not worked. My Application server is different from DB server.
    Please let me know if any one has the code or any thoughts.
    Thanks

    Please see these links.
    https://forums.oracle.com/forums/search.jspa?threadID=&q=UTL_SMTP&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Send+AND+email+AND+PL%2FSQL&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Email+AND+PL%2FSQL&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Invoice in iSupplier without PO

    We have a requirement in iSupplier that says "Vendor should be able to submit online invoice without a PO". But, looks like in iSupplier, vendor can add PO lines to an invoice and submit the invoice to Payables.
    Please can anyone let me know if there is a possibility of vendor submitting online invoice without a PO.
    Thanks.

    looks like you have this question in multiple threads..
    here is how it goes..
    there is no standard functionality to do this. but if u look at customization, the standard interface validation does not work. you need to call for a custom interface validation and invoice import program. however, most of the business practices does not encourage this as invoices are imported into system without reference to purchase information.
    if you have a specific requirement like this, check for customizing portal screens, and the reference interface package.

  • Some plz help a poor student

    Hi
    I'm a student stuck on a really crappy course my teacher has taught me nothing about java and CORBA and given me a coursework on it :(
    I just want 2 use this program client/server type with CORBA, it checks a users ID and username against those held in a database
    Can any1 help me do that please??
    import javax.swing.JOptionPane;
    import java.sql.*;
    public class log
    public static void main(String[] args)
    //client
    String UserId;
    String Password;
    UserId = JOptionPane.showInputDialog("Eneter your UserID"); // were the user eneters his User
    Password = JOptionPane.showInputDialog("Eneter your Password");//were the user eneters his Password
    //server
    try {
    //have to be in a try catch block
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    //setting up the database
    String dataSourceName = "cw2";
    String dbURL = "jdbc:odbc:" + dataSourceName;
    Connection con = DriverManager.getConnection(dbURL, "","");
    //setting up the database
    Statement stmt = con.createStatement();
    String query = "SELECT Username , password FROM LOG"; // find the values and printen them out
    ResultSet rs = stmt.executeQuery(query);
    String s, n;
    boolean flag = false;
    while(rs.next())
    s = rs.getString("UserName");
    n = rs.getString("password");
    if(s.equals(UserId) && n.equals(Password))
    flag = true;
    System.out.println( " access allowed " );
    //grant access
    break;
    } //if
    } //while
    if(flag == false)
    System.out.println( " access refused " );
    //deny access
    catch (Exception err) {
    System.out.println("ERROR: " + err);
    System.exit(0);
    idl file
    module myapp
    interface validator
    boolean validate_user(in wstring username, in string password);

    Why not take a look at the tutorials?
    http://java.sun.com/j2se/1.4.1/docs/guide/idl/index.html
    http://java.sun.com/j2se/1.4.1/docs/guide/corba/index.html
    You could adapt the Hello World IDL from the tutorial from
    module HelloApp
    interface Hello
    string sayHello();
    oneway void shutdown();
    to something like
    module Security
    interface ClientVerifier
    boolean allowAccess(in wstring name, in wstring password);

  • IdL big time help needed

    I have a program and I would like 2 split it into a client-server system using IDL, I would appreciate any tips given (I�m very new to IDL). At the moment it takes input from the user, in the form of a user name and password, and check against a database. I would like to have the input on the client and the check of the database on the server, with eather an accept or refuse message sent back to the user.
    import javax.swing.JOptionPane;
    import java.sql.*;
    public class log
    public static void main(String[] args)
    //client
    String UserId;
    String Password;
    UserId = JOptionPane.showInputDialog("Eneter your UserID"); // were the user eneters his User
    Password = JOptionPane.showInputDialog("Eneter your Password");//were the user eneters his Password
    //server
    try {
         //have to be in a try catch block
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    //setting up the database
    String dataSourceName = "cw2";
    String dbURL = "jdbc:odbc:" + dataSourceName;
    Connection con = DriverManager.getConnection(dbURL, "","");
    //setting up the database
    Statement stmt = con.createStatement();
    String query = "SELECT Username , password FROM LOG"; // find the values and printen them out
    ResultSet rs = stmt.executeQuery(query);
    String s, n;
    boolean flag = false;
    while(rs.next())
    s = rs.getString("UserName");
    n = rs.getString("password");
    if(s.equals(UserId) && n.equals(Password))
    flag = true;
    System.out.println( " access allowed " );
    //grant access
    break;
    } //if
    } //while
    if(flag == false)
    System.out.println( " access refused " );
    //deny access
    catch (Exception err) {
    System.out.println("ERROR: " + err);
    System.exit(0);

    You might want to take a look at the examples in
    http://java.sun.com/j2se/1.4.1/docs/guide/idl/index.html
    and adapt one of the IDL interfaces to your needs.
    Something like
    module myapp
    interface validator
    boolean validate_user(in wstring username, in string password);
    Note that this won't have any security for your password on the wire.
    I just did a quick search to see if I could find a happy IDL tutorial, but I guess I usually use the main CORBA spec, actually.
    http://www.omg.org/technology/documents/formal/corba_iiop.htm
    - Everett

  • Erreur -1073807195

    bonjour,
    j utlise la version 7.1 de labview et je voudrais commander un system par le port serie,j ai les drivers mais lorsque je lance mon appl, j ai le l erreur -1073807195....avec type d interface valide, mais le numero d interface specifie n est pas configure?
    Quel est ce numero d interface? lka sub adresse de mon systeme a comander?
    merci

    French to English (Thanks to google)
    hello,
    j utlise version 7.1 labview and I would like to order a system by the serial port, I drivers but when I run my appl, I l error -1,073,807,195 .... type of interface with valid, but the number of specifies interface is not configured?
    What is the number of interface? lka sub address of my system a command? 
    thank you

  • Item Interface error - "The Cost of Sales Account specified is not a valid"

    A week back we migrated from 11.5.10 to 12.1.3
    Since then, many items are failing in Item Interface with the error "The Cost of Sales Account specified is not a valid account or has expired in organization ITEM MASTER INV."
    Item Master being the 'Inventory master organization'. I checked the cost of sales account & sales account. and they are Valid also their corresponding segments are valid in their respective value sets.
    Log message for 'Item Import'
    Import Items
    Argument 1 (ORG_ID) = 167
    Argument 2 (ALL_ORG) = 1
    Argument 3 (VAL_ITEM_FLAG) = 1
    Argument 4 (PRO_ITEM_FLAG) = 1
    Argument 5 (DEL_REC_FLAG) = 1
    Argument 6 (PROCESS_SET) = 77
    Argument 7 (MODE) = 2
    Argument 8 (Gather Stats) = 1
    TRANSACTION ID : 42878726
    ORGANIZATION ID : 174
    TABLE NAME : MTL_SYSTEM_ITEMS_INTERFACE
    COLUMN NAME : COST_OF_SALES_ACCOUNT
    MESSAGE NAME : INV_IOI_ERR
    ERROR MESSAGE : The Cost of Sales Account specified is not a valid account or has expired in organization ITEM MASTER INV.
    TRANSACTION ID : 42878726
    ORGANIZATION ID : 174
    TABLE NAME : MTL_SYSTEM_ITEMS_INTERFACE
    COLUMN NAME : SALES_ACCOUNT
    MESSAGE NAME : INV_IOI_ERR
    ERROR MESSAGE : The Sales Account specified is not valid or has expired for the organization ITEM MASTER INV.
    Please help.

    The Cost_of_sales_account & Sales_account as defined in the MTL_PARAMETERS are different from those in MTL_SYSTEM_ITEMS_B for the corresponding item. The values for these accounts in the interface tables are same as that in the MTL_SYSTEM_ITEMS_B table and hence not same as those defined in MTL_PARAMETERS.
    Actually we have a Custom trigger on the MTL_SYSTEM_ITEMS_B table which updates these accounts, once the item is created in the Master Organization.
    To verify this issue, I updated the accounts on the MTL_SYSTEM_ITEMS_INTERFACE table to match with that of MTL_PARAMETERS. Ran the 'Item Import', now those records are processed.
    Does this means that, the Interface is validating the cost_of_sales_account & sales_account to match with that of the 'Organization' ??.
    But we never had this issue in 11i. Is this a part of R12??

  • "The interface name given does not specify a valid and existing interface."

    Hi nice guys,
     I'm trying to use the XNET APIs to set Master task to Slave with LIN protocol. As I have no Experience before, there's something problem like the Interface of the NI USB-8476S can't be detected. The prompted windows presents following infomation:
    Error -1074384758 occurred at XNET Create Session (Signal Output Single-point).vi:1
    Possible reason(s):
    NI-XNET: (Hex 0xBFF6308A) The interface name given does not specify a valid and existing interface. Solution: Use a valid and existing interface. These can be obtained using MAX, XNET system properties, or the LabVIEW XNET Interface IO name. If you are using CompactRIO, refer to the topic "Getting Started with CompactRIO" in the NI-XNET Hardware and Software Help.
    but in the NI MAX, the device is detected as "LIN0". Even the interface input control in the NI examples shows the error. But if I take the CAN Frame API, it works well.
    Does anyone have some idea. I'm so preciate. Tanks in advance.
    best regards
    Melo

    Melonetern,
    When do you receive these errors?  Does this happen when you try to run your code or our examples?  On top of that, does this error happen immediately or does it take a while?  Is this happening in LabVIEW or another interface?
    If you could give us the versions of software you are using as well as the XNET driver versions that would be very helpful.
    Matt J
    Professional Googler and Kudo Addict
    National Instruments

  • I need validation code for cycle count open interface

    Hi friends i require the validation code for the
    cycle count open interface .
    can anybody help me .......
    Message was edited by:
    user506929

    Hi David
    I want to know the procedure for cycle count open interface i.e.
    1> How the data from flat file is uploaded in oracle INV
    How many Tables are needed?
    2>What validations are required ?
    3>How these validations are performed ?
    If you have any document pls send it to me at :
    [email protected]
    thanks for ur responce ......

  • Validating an XML message from Outbound Interface.

    Hi All,
    I hav an xml generated from an outbound interface and is to be validated against a BC Schema that hav been specifically created from the sample XML docs.I'm strucked at how to validate the XML in XI against the xsd file. Can anyone pls help me out in this regard.It's a bit urgent.

    Hi Anil,
    When you create a dataType by yourself, then XI generates the XSD.
    Instead, you could create the dataType by importing a XSD. Two ways:
    1. While creating a new dataType, Goto Tools->'Import XSD' and select your XSD file.
    2. You can import your XSD as 'External Definitions'
    In these 2 cases, the dataType will be as per your XSD. Then use this dataType for receiving the data into XI.
    XI validates against that dataType XSD, which is your XSD.
    Hope this helps!
    regards,
    Pops V

Maybe you are looking for