Error handling in Table records

hai to everyone ,
i have one table  in  madatory field  is there , enter records 5 records in 5 of 3 records are not entered mandatory records.
i written message  for incase not entered filed.
but here problem is , It showing  for each record  showing message that is 3 lines are coming.
instead of 3 lines we can make in single line which are records are not given madatory fileds.
is it possible  in message pool..
below is i written code .
if(TableElement.getClientName()!=null&&TableElement.getClientName()!="")
wdThis.wdGetTaskManagerCompController().insertClient(clientName,region,vertical);
else{
     wdComponentAPI.getMessageManager().reportException(TableElement.getClientName()+ ":ClientNames"+"fields are mandatory",false); 

Hi Eswar,
As I understand from you question is that you have a table in which 5 records can be entered. Out of these 5 records 3 records are mandatory, what you want is if these 3 mandatory record are left empty then one line of exception should be raised saying 3 records are empty.
What you can do is on your action copy the mandatory fields into a new node, and find out the size of the new node (if the size is 0 that means all the records are empty) then you can iterate over the new node to find out which attribute is empty.
You may use the following code:
suppose DisplayRow is your new node with attributes as attributes1, attributes2 and attributes3 and node1 is your node with which the 5 records are maaped. ROWS_SELECTED is the message constant.
wdContext.nodeDisplayRow().invalidate();
IPrivateFlightList.IRowsSelectedElement element = wdContext.nodeRowsSelected().createRowsSelectedElement();
    for(int i = 0; i < wdContext.node1().size(); i ++)
String str1 = wdContext.node1().getnode1ElementAt(i).getAttribute1();
String str2 = wdContext.node1().getnode1ElementAt(i).getAttribute2();
String str3 = wdContext.node1().ggetnode1ElementAt(i).getAttribute3();
if(str1 != null)          
element.setAttribute1(str1);
if(str2 != null)
element.setAttribute2(str2);
if(str3 != null)
element.setAttribute3(str3);
wdContext.nodeRowsSelected().addElement(element);
int listSize = wdContext.nodeRowsSelected().size();
String size = String.valueOf(listSize);
IWDMessageManager msmgr = wdComponentAPI.getMessageManager();
msmgr.raiseMessage(IMessage<ComponentName>Component.ROWS_SELECTED,new Object[],true);
Edited by: Aishwarya Sharma on Oct 10, 2008 7:41 AM

Similar Messages

  • Error Handling in table control for line item.

    Hi,
    Please how to do error handling in table control for line item in bdc,i have used format_message for header but i don't no fill decamps internal tabled and  how to do background processing in call transaction.
    Thanks

    Background processing is not possible using call transaction method.
    You can create an executable program which can have CALL TRANSACTION BDC code. And this can be run in background.
    What do you exactly mean by Error handling for Items in table control. Can you give some more details.

  • Error Handling in tables using ABap Webdynpro

    Hi All,
    I am new to this ABAP webdynpro programming. I have a small question. I am using a table control in one of my iview. I need to check some validations on some columns of this table. Let's say I have a table with 3 columns A,B and C. 
    Case 1 : Whenever any user enters values in C which is greater than A i want to raise an error message saying "The Value is greater than A". The user shouldn't be allowed to enter anyother inputs before correcting the same.
    OR
    Case 2: If the user enters 10 rows in the table and the 5th row contains the error. How can i highlight that row or field which contains the error.
    Your inputs will be valuable to me.
    Regards,
    Pravesh.

    Hi,
    Get the elements of the node for which you table is bound.
    Loop through the context element set.
    get the record for that context attribute and check the column A and column B value and throw
    the error using the report_error_element_message when there is error.
    Check this sample code -
      DATA:
        lt_attr_list type STRING_TABLE,
        ls_attr_list type string.
      ls_attr_list = column name.
      append ls_attr_list to lt_attr_list.
      clear ls_attr_list.
      ls_attr_list = column name.
      append ls_attr_list to lt_attr_list.
      clear ls_attr_list.
    DATA: lit_elementset type WDR_CONTEXT_ELEMENT_SET,
    lis_element type ref to IF_WD_CONTEXT_ELEMENT,
    ls_data type <<strucure type>>.
        CALL METHOD <<nodename>>->GET_ELEMENTS
          RECEIVING
            SET = lit_elementset.
        LOOP AT  lit_elementsetINTO  lis_element.
    lis_element->get_static_atributes->
    importing = ls_data.
    if ls_data-columnC GT ls-data-columnA.
    lr_msg_manager->report_element_error_message->
    message_text = 'Column C canot be gretaer than column A'
    element = lis_element
    attributes = lt_attr_list <<Populate the attributes table for which errors are to be shown>>
    endif.
    clear: ls_data, lis_element.
    ENDLOOP.
    Regards,
    Lekha.

  • Error Handling in info-package strangely doesn't work

    Dear All,
    I'm trying to load master-data from R3 containing time-dependent attributes which, I know, are sometimes overlapping. As I still want to load the correct part of data, i've set Processing - via PSA and Error Handling - "Updating valid records, reporting possible" with number of errors more than the dataset itself. However, the load still fails and what is more interesting, all records in PSA are marked as "green" whereas the errors are reported in a log.
    And what makes me wonder even more is that the same info-package from the same DS is loaded in a test system OK - with errors handled and "trashed" in PSA and remaining updated in Info-Object MD.
    Does anybody can help to resolve this strange problem as i can't honestly see the difference in global settings of test and productive systems that could allow this...
    Thank you in advance

    Hi,
    Here you are extracting data for master data with one of the attribute as time dependent . So there are two more fileds are neccessary in extraction ,i.e, 'from date' and 'to date'.
    And it seems there is overlapping of this range for two records. Make sure it in PSA with record numbers. And make sure there will be no overlapping.
    With rgds,
    Anil Kumar Sharma .P

  • Error Handling on procedure based forms

    Hi all,
    I have seen examples of error handling on table based forms like
    the following:
    begin
    doInsert;
    exception
    when others then
    --redirect to some error page
    I have tried the same with a procedure based form by wrapping
    the doSubmit procedure, but when the procedure returns an
    exception, it doesn't execute my exception handling code.
    Any ideas on why this is happening or at least how I can catch
    these exceptions with my own exception handler?
    Thanks,
    Curt

    Chetan, Antonio,
    I opened a TAR on this issue with Oravle and they got the same
    results. Thay suggested a work around of creating an error table
    that gets written to and then dispaly and new page to retrieve
    the error from the table.
    What I ended up doing is creating a dummy procedure that does
    nothing (NULL). The form based on the dummy procedure allows me
    to get the values I need from the user.
    The procedure always returns succesful since it doesn't do
    anything. So in the form success code area I call the real
    procedure, check the return value, and now I can redirect back
    to the orignal form on error, or direct to another paqe on
    success.
    Not the most elegant solution, but it is working for now.
    Curt

  • How to handle the failed records from the table when using DB Adapter

    Hi,
    I am reading some records from table using DB Adapter inside my synchronous BPEL process. Say like reading 100 records from table in between after successful reading of 90 records an error occured in 91st record due some various reasons(like DB down, Connection interrupted etc.). Then how to handle this situation, whether i have to read all the records from the begining and is there any option to continue from where it stopped reading.
    Can please anybody help me out in the regard?
    Thanks in advance
    Regards,
    Aejaz

    we had the same requirement some time ago and had two option:
    1. ask the R/3 development team add a deletion indicator in the table (and thus not actually deleting the record). this deletion indicator could then be used like for any other standard datasource
    this option was however refused, due to huge data volume after a while
    2. at the end of the load we copied the ZTABLE1 to ZTABLE2. then in the begin of the load (day after) we compare the data of table1 to table2. entries available in table2 but not in table1 are deleted, and we put a 'D'. in deletion indicator; as we only keep the deleted entries for one day, the volume of the new table is acceptable.
    M.

  • OWB Error handling through error tables

    I have a mapping, which i want to implement error handling through error table, the table is created (error) and i have supplied it in the error table propertis in the target table. But i have tried testing if this is working by changing the data type of one column in my target database, but the whole mapping is failing to run with no error rerded in the error table. And i tried testing the this through sql and suprisingly the errors are being captured. How do i get the whole mapping to run and record the errors if any in the error table without it failing.

    When you say 'the whole mapping is failing to run' what do you mean? Can you deploy the mapping? If not what is the error? When you run the mapping what happens?
    If you look at the DML statement (the INSERT, MERGE or whatever) generated by OWB does it include the LOG ERRORS INTO statement in it?
    There is a blog post below for OWB 11gR2;
    http://blogs.oracle.com/warehousebuilder/entry/owb_11gr2_dml_error_logging
    And an older one here which was based on OWB 10gR2
    http://blogs.oracle.com/warehousebuilder/entry/set_based_errors_dml_error_log
    Cheers
    David

  • ORA-06502 error with external table having long records

    I'm getting a strange error with the oci driver that I don't get with the thin driver.
    The basic situation is that we using external tables and both the oci and thin drivers have been working until we tested with a table that had longer records than the previous tables. The new table has 1800 byte records.
    The thin driver still works fine with the new table. However, the oci driver generates the following error with the new table:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    I suspect that with oci driver the oci DLLs are reading the external file and the DLLs can't handle the longer record length.
    Particulars
    - Oracle DB Server is 10.2.0.1 on SunOS 5.9
    - OCI Instant Client instantclient_10_2 on Windows XP
    - OCI client code from DB server installation running on DB server
    - Works with thin driver from Windows XP and on DB server machine for all record lengths
    - Works with both OCI drivers for records < 1800 bytes (don't know actual limit)
    - Fails with both OCI drivers for records = 1800 bytes.
    Does anyone out there have any thoughts.
    Thanks in advance.

    Your access parameters are in the wrong order. External tables are a bit fussy like that. Refer to the access_parameters section in the Utilities manual and follow the order there. From memory it will go something like this:
    RECORDS DELIMITED...
    LOG/BAD/DISCARDFILE...
    FIELDS TERMINATED...LDRTRIM
    MISSING FIELD VALUES...
       fields...
    )Regards...

  • Error handling function: ORA-20001: get_dbms_sql_cursor error:ORA-00942: table or view does not exist  is not trapped. Why?

    Why APEX 4.1 Error handling function does not trap  the error of missing table?
    Say, I create simple application with single IR report page and I also assign standard simple error handling function.
    Function works perfectly, except but this case:
    If I just drop a table used by report page and then refresh the page I am getting usual APEX error message:
    ORA-20001: get_dbms_sql_cursor error ORA-00942: table or view does not exist
    and error handling function is not invoked at all.
    Is this a feature or a bug?

    Hi,
    Check the corrections given in the note 990764:
    Reason and Prerequisites
    Up to now, using a characteristic with its own master data read class as the InfoProvider was not supported. This is now released but it is not available for all modelings. Using the attributes in the query is not supported for characteristics that have their own master data read class. Using the attributes in the query causes a termination. The following errors may occur in this case:
    ORA-00942: table or view does not exist
    Fehler in CL_SQL_RESULT_SET  Include NEXT_PACKAGE
    RAISE_READ_ERROR in CL_RSDRV_VPROV_BASE
    Solution
    SAP NetWeaver 2004s BI
               Import Support Package 11 for SAP NetWeaver 2004s BI (BI Patch 11 or SAPKW70011) into your BI system. The Support Package is available once Note 0914305 "SAPBINews BI 7.0 Support Package 11", which describes this Support Package in more detail, has been released for customers.
    In urgent cases you can implement the correction instructions.
    The correction instructions contain the tightened inspection for characteristics.
    Regards,
    Anil Kumar Sharma .P

  • DML error table intermittently fails to generate error handling in package

    Hi!
    In OWB 11gR2 (11.2.0.1), we're seeing an issue when setting the DML Error table name on a target table. Sometimes, mostly on older and complex mappings, the error handling logic does not get generated when we deploy the mapping, and nothing is populated in the error tables for error conditions, though the errors display as warnings in the OWB UI.
    When I create a new mapping that is very simple - one table loading another - setting the DML Error table name always results in errors being put in the error table. That's great, but that doesn't help us with our more-complex mappings that aren't logging errors.
    We can't determine the cause of the issue. I can't see a difference in the configuration of the mappings that work and don't work. Generation Mode is All Operating Modes. Default Operating Mode is Set based fail over to row based. We've generated the error table using DBMS_ERRLOG.CREATE_ERROR_LOG. The target tables do not have primary keys.
    I've tried synchronizing the target table operator in the mapping as another forum thread suggested. No change.
    Has anyone else seen this issue or know of a workaround?
    Thanks,
    Jayce

    Which logic did you talk about ?
    For the version 10, you will find the error table more on the insert statement such as:
    INSERT INTO "TSALES"
      ("PROD_ID",
      "SALES"."AMOUNT_SOLD" "AMOUNT_SOLD"
    FROM
      "SALES"  "SALES"
    LOG ERRORS INTO TSALES_ERR (get_audit_detail_id) REJECT LIMIT 50;Come from here:
    http://blogs.oracle.com/warehousebuilder/2007/08/set_based_errors_dml_error_log.html
    Then check the insert SQL generated.
    Cheers
    Nico

  • How to perform Error Handling in this Bdc Code

    Hi,
    I had created this BDC for the tcode MB1B and i want to know how to perform the ERROR HANDLING in it ..
    Plzz provide me guidelines for doing it . here's d code:-
    report ZBDC_MB1B
           no standard page heading line-size 255.
    include bdcrecx1.
    data: begin of record OCCURS 0,
          WERKS_001(004),     "Plant
          MATNR_002(018),     "ItemId
          ERFMG_003(013),     "Quantity in Unit of Entry
          ERFME_004(003),     "Unit of Entry
          LGORT_005(004),     "Storage Location
          CHARG_006(010),     "BatchId
          KDAUF_007(010),     "Sales Order Number
          KDPOS_008(006),     "Item Number in Sales Order
          end of record.
    PARAMETERS : P_FILNAM LIKE RLGRAP-FILENAME.
      initialization.
      CTUMODE = 'A'.
      CUPDATE = 'A'.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILNAM.
      CALL FUNCTION 'WS_FILENAME_GET'
       EXPORTING
         MASK                   = ',. '
         MODE                   = 'O'
         IMPORTING
         FILENAME                 = P_FILNAM
       EXCEPTIONS
         INV_WINSYS             = 1
         NO_BATCH               = 2
         SELECTION_CANCEL       = 3
         SELECTION_ERROR        = 4
         OTHERS                 = 5
      IF SY-SUBRC <> 0.
            MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    start-of-selection.
    CALL FUNCTION 'WS_UPLOAD'
       EXPORTING
         FILENAME                      = P_FILNAM
         FILETYPE                      = 'DAT'
        TABLES
          DATA_TAB                     = RECORD
       EXCEPTIONS
         CONVERSION_ERROR              = 1
         FILE_OPEN_ERROR               = 2
         FILE_READ_ERROR               = 3
         INVALID_TYPE                  = 4
         NO_BATCH                      = 5
         UNKNOWN_ERROR                 = 6
         INVALID_TABLE_WIDTH           = 7
         GUI_REFUSE_FILETRANSFER       = 8
         CUSTOMER_ERROR                = 9
         NO_AUTHORITY                  = 10
         OTHERS                        = 11
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT RECORD.
      BEGIN OF SCREEN 1
    perform bdc_dynpro      using 'SAPMM07M' '0400'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RM07M-SOBKZ'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    *perform bdc_field       using 'MKPF-BLDAT'
                                 '22.12.2008'.
    *perform bdc_field       using 'MKPF-BUDAT'
                                 '22.12.2008'.
    perform bdc_field       using 'RM07M-BWARTWA'
                                  '411'.
    perform bdc_field       using 'RM07M-SOBKZ'
                                  'E'.
    perform bdc_field       using 'RM07M-WERKS'
                                  RECORD-WERKS_001.             "Plant
    perform bdc_field       using 'XFULL'
                                  'X'.
    perform bdc_field       using 'RM07M-WVERS2'
                                  'X'.
      BEGIN OF SCREEN 2
    perform bdc_dynpro      using 'SAPMM07M' '0421'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSEG-CHARG(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MSEG-MATNR(01)'
                                  RECORD-MATNR_002.             "ITEMID
    perform bdc_field       using 'MSEG-ERFMG(01)'
                                  RECORD-ERFMG_003.             "QTY.
    perform bdc_field       using 'MSEG-ERFME(01)'
                                  RECORD-ERFME_004.             "UOM
    perform bdc_field       using 'MSEG-LGORT(01)'
                                  RECORD-LGORT_005.             "ST.LOC
    perform bdc_field       using 'MSEG-CHARG(01)'
                                  RECORD-CHARG_006.             "BATCHID
    perform bdc_field       using 'MSEGK-MAT_KDAUF'
                                  RECORD-KDAUF_007.             "S.O.
    perform bdc_field       using 'MSEGK-MAT_KDPOS'
                                  RECORD-KDPOS_008.             "S.O.LINE ITEM
    perform bdc_field       using 'DKACB-FMORE'
                                  'X'.
      BEGIN OF SCREEN 3
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_field       using 'DKACB-FMORE'
                                  'X'.
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_dynpro      using 'SAPMM07M' '0421'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSEG-ERFMG(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    perform bdc_field       using 'DKACB-FMORE'
                                  'X'.
      BEGIN OF SCREEN 4
    perform bdc_dynpro      using   'SAPLKACB' '0002'.
    perform bdc_field       using      'BDC_OKCODE'
                                                '=ENTE'.
    perform bdc_transaction using 'MB1B'.
    ENDLOOP.

    hi,
    check this code in bold letters.
    INCLUDE BDCRECX1.
    TABLES : MARC.
    TYPES : BEGIN OF TY_UPLOAD,
            MATNR TYPE MARA-MATNR,
            WERKS TYPE MARC-WERKS,
            STEUC TYPE MARC-STEUC,
            END OF TY_UPLOAD.
    TYPES : BEGIN OF TY_MARC,
            MATNR TYPE MARA-MATNR,
            WERKS TYPE MARC-WERKS,
            END OF TY_MARC.
    TYPES : BEGIN OF TY_MTART,
            MATNR TYPE MARA-MATNR,
            MTART TYPE MARA-MTART,
            END OF TY_MTART.
    DATA : T_MARC TYPE STANDARD TABLE OF TY_MARC,
         : T_UPLOAD TYPE STANDARD TABLE OF TY_UPLOAD,
         : T_BASIC TYPE STANDARD TABLE OF TY_UPLOAD,
         : T_SALES TYPE STANDARD TABLE OF TY_UPLOAD,
         : T_ERROR TYPE STANDARD TABLE OF TY_UPLOAD.
    DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
           IT_BDCDATA_VIEW LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
           IT_DATA(3200) OCCURS 0 WITH HEADER LINE,
           IT_FIELD(3200) OCCURS 0 WITH HEADER LINE,
           IT_BDCMSG TYPE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA GI_MSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA : CHAR1(500),
          CHAR2(500),
          CHAR3 TYPE STRING,
          V_SELECTION TYPE STRING.  " For View Selection
    DATA : W_MARC TYPE TY_MARC,
           WA_UPLOAD TYPE TY_UPLOAD,
           WA_BASIC TYPE TY_UPLOAD,
           WA_SALES TYPE TY_UPLOAD,
           WA_ERROR TYPE TY_UPLOAD,
           WA_MTART TYPE TY_MTART.
    DATA : VAR TYPE N,
           VAR1 TYPE STRING.
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.   "SELECTION SCREEN
    PARAMETERS: P_FNAM LIKE RLGRAP-FILENAME.
    PARAMETERS: P_BAS LIKE RLGRAP-FILENAME.
    PARAMETERS: P_SAL LIKE RLGRAP-FILENAME.
    PARAMETERS: P_ERR LIKE RLGRAP-FILENAME.
    SELECTION-SCREEN : END OF BLOCK B1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAM.
      PERFORM SEARCH USING P_FNAM.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_BAS.
      PERFORM SEARCH USING P_BAS.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_SAL.
      PERFORM SEARCH USING P_SAL.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_ERR.
      PERFORM SEARCH USING P_ERR.
    *&      Form  SEARCH
          text
         -->PFNAME     text
    FORM SEARCH USING PFNAME.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          STATIC    = 'X'
        CHANGING
          FILE_NAME = PFNAME.
    ENDFORM.                    "SEARCH
    START-OF-SELECTION.
      PERFORM UPLOAD_PROCESS USING P_FNAM.
      PERFORM OPEN_GROUP.
      PERFORM PROCESS.
      PERFORM CLOSE_GROUP.
      IF NOT T_BASIC[] IS INITIAL.
        PERFORM DOWNLOAD TABLES T_BASIC[] USING P_BAS .
      ENDIF.
      IF NOT T_SALES[] IS INITIAL.
        PERFORM DOWNLOAD TABLES T_SALES[] USING P_SAL .
      ENDIF.
      IF NOT T_ERROR[] IS INITIAL.
        PERFORM DOWNLOAD TABLES T_ERROR[] USING P_ERR.
      ENDIF.
    *&      Form  PROCESS
          text
    FORM PROCESS.
      LOOP AT T_UPLOAD INTO WA_UPLOAD.
        PERFORM CONV_ROUTINE  USING WA_UPLOAD-MATNR
                            CHANGING WA_UPLOAD-MATNR.
        SELECT COUNT(*) FROM MARA WHERE MATNR = WA_UPLOAD-MATNR.
        IF SY-SUBRC NE 0.
          MOVE-CORRESPONDING  WA_UPLOAD TO WA_BASIC.
          APPEND WA_BASIC TO T_BASIC.
          CLEAR WA_BASIC.
          CONTINUE.
        ENDIF.
        SELECT COUNT(*) FROM MARC WHERE MATNR = WA_UPLOAD-MATNR
                                        AND WERKS = WA_UPLOAD-WERKS
                                        AND PSTAT LIKE '%V%'.
        IF SY-SUBRC NE 0.
          MOVE-CORRESPONDING  WA_UPLOAD TO WA_SALES.
          APPEND WA_SALES TO T_SALES.
          CLEAR WA_SALES.
          CONTINUE.
        ENDIF.
        CLEAR : WA_MTART.
        SELECT SINGLE MATNR MTART FROM MARA INTO WA_MTART WHERE MATNR = WA_UPLOAD-MATNR.
        PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '0060'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RMMG1-MATNR'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=AUSW'.
        PERFORM BDC_FIELD       USING 'RMMG1-MATNR'
                                      WA_UPLOAD-MATNR.
        CALL FUNCTION 'MATERIAL_BTCI_SELECTION_NEW'     " Function module
        EXPORTING
          MATERIAL                  = WA_UPLOAD-MATNR  " Material number
          MATERIALART               = WA_MTART-MTART          " Material Type
          SELECTION                 = 'V'              "
          TCODE                     = 'MM02'           " Tcode where view's are called.
        TABLES
          BTCI_D0070                = IT_BDCDATA_VIEW
        EXCEPTIONS
          MATERIAL_NOT_FOUND        = 1
          MATERIAL_NUMBER_MISSING   = 2
          MATERIAL_TYPE_MISSING     = 3
          MATERIAL_TYPE_NOT_FOUND   = 4
          NO_ACTIVE_DYNPRO_SELECTED = 5
          NO_AUTHORITY              = 6
          OTHERS                    = 7.
        READ TABLE IT_BDCDATA_VIEW WITH KEY FVAL  = 'X'.
        IF SY-SUBRC = 0.
          V_SELECTION = IT_BDCDATA_VIEW-FNAM.
        ELSE.
          CONTINUE.
        ENDIF.
        VAR = IT_BDCDATA_VIEW-FNAM+17(2).
        VAR = VAR + 3.
        CONCATENATE 'MSICHTAUSW-KZSEL(' '0' VAR ')' INTO VAR1.
        PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '0070'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'MSICHTAUSW-DYTXT(06)'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=ENTR'.
        PERFORM BDC_FIELD       USING VAR1
                                       'X'.
        CLEAR VAR.
        CLEAR VAR1.
       PERFORM BDC_FIELD       USING 'MSICHTAUSW-KZSEL(06)'
                                     'X'.
        PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '0080'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RMMG1-VKORG'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=ENTR'.
        PERFORM BDC_FIELD       USING 'RMMG1-WERKS'
                                      WA_UPLOAD-WERKS.
        PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '4004'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=BU'.
       PERFORM BDC_FIELD       USING 'MAKT-MAKTX'
                                     'MTI_ESE_HALB_01'.
        PERFORM BDC_FIELD       USING 'MARC-STEUC'
                                      WA_UPLOAD-STEUC.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'MARC-HERKR'.
        PERFORM BDC_FIELD       USING 'MARC-HERKL'
                                      'IN'.
        PERFORM BDC_FIELD       USING 'MARC-HERKR'
                                      'MAH'.
        PERFORM BDC_TRANSACTION USING 'MM02'.
    move the error record into seperate internal table nad down load it ****
        IF MESSTAB-MSGTYP = 'E'.
          MOVE-CORRESPONDING WA_UPLOAD TO WA_ERROR.
          APPEND WA_ERROR TO T_ERROR.
          CLEAR WA_ERROR.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "PROCESS
    *&      Form  UPLOAD_PROCESS
          text
         -->PFNAME     text
    FORM UPLOAD_PROCESS USING PFNAME.
      DATA : PFNAME1 TYPE STRING.
      PFNAME1 = PFNAME.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME            = PFNAME1
          FILETYPE            = 'ASC'
          HAS_FIELD_SEPARATOR = 'X'
        TABLES
          DATA_TAB            = T_UPLOAD[].
      IF SY-SUBRC <> 0.
      ENDIF.
    ENDFORM.                    "UPLOAD_PROCESS
    *&      Form  CONV_ROUTINE
          text
         -->P_INPUT    text
         -->P_OUTPUT   text
    FORM CONV_ROUTINE   USING    P_INPUT
                     CHANGING P_OUTPUT.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          INPUT  = P_INPUT
        IMPORTING
          OUTPUT = P_OUTPUT.
    ENDFORM.                    "CONV_ROUTINE
    *&      Form  DOWNLOAD
          text
         -->GI_FINAL   text
         -->PFNAME     text
    FORM DOWNLOAD TABLES
                  GI_FINAL
                         USING  PFNAME .
      DATA : FNAME TYPE STRING.
      FNAME = PFNAME.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                        = FNAME
          FILETYPE                        = 'DAT'
         WRITE_FIELD_SEPARATOR           = 'x'
            HEADER                          = '00'
          IMPORTING
            FILELENGTH                      =
        TABLES
          DATA_TAB                        =  GI_FINAL[]
          FIELDNAMES                      = GI_FIELDNAMES[]
      IF SY-SUBRC = 0.
        MESSAGE 'FILE DOWNLOADED SUCCESSFULLY' TYPE 'I'.
      ENDIF.
    ENDFORM.                    " DOWNLOAD
    Regards
    Siva Prasad

  • Error Handling in Forms

    Dear all,
    we are using oracle developer suite 10g r2 with oracle database 10g r2 against windows server 2003.
    Error handling is a very big issue.
    i try to do the following, just correct me, or make the trigger more efficient.
    i face unexpected messages, like a message two time displayed, sometime important message never displayed.
    i just set the :system.message_level =20 in the when-new-form-instance trigger.
    and create on-error trigger like below
    declare
    errcode number:=error_code;dbmserrcode number;dbmserrtext varchar2(200);
    formtxt varchar2(200);
    errtype varchar2(3);
    begin
    --------- user defined database exceptions errors raised by --RAISE_APPLICATION_ERROR
    IF DBMS_ERROR_CODE in (-20738,.......) then
    raise form_trigger_failure;
    end if;
    if error_code=50017 then
    message('duration must be between 0 and 23');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    elsif
    error_code=40202 then
    clear_message;
    message('please provide the required fields.');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    elsif error_code=50022 then
    clear_message;
    message('time must be in the correct format.');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    end if;
    if error_code in (40509,40508) then
    dbmserrcode:=dbms_error_code; dbmserrtext:=dbms_error_text;
    if dbmserrcode=-1438 then
    clear_message;
    message('your number is too large.try again.');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    elsif dbmserrcode=-1400 then
    clear_message;
    message('your forgot to provide a value.try again.');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    elsif dbmserrcode=-2291 then
    clear_message;
    message('header is not found for this insertion.');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    elsif dbmserrcode=-1 then
    clear_message;
    message('record already exists');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    else
    clear_message;
    message(error_code||' : '||error_text);message(' ',no_acknowledge);
    raise form_trigger_fialure;
    end if;
    else
    clear_message;
    message(error_code||' : '||error_text);message(' ',no_acknowledge);
    raise form_trigger_fialure;
    end if;
    exception
    when others then
    if dbms_error_code=-20738 then
    clear_message;
    message('Error: absent or later record errror from the database trigger.);
    raise form_trigger_failure;
    elsif .....
    esle
    clear_message;
    message(error_code||' : '||error_text);message(' ',no_acknowledge);
    raise form_trigger_fialure;
    end if;
    end;any suggession?
    Regards

    i must come with a plsql code which handle every error and suppress unnecessary messages.Good luck with that. No matter how well thought out or planned, you're not going to be able to take all scenarios into account. The design of an exception handler takes time to address all possible scenarios you want handled and even then, you're not likely to handle every situation in the beginning.
    could we implement the oracle ebusiness error handling procedures here in our application?if yes, then where could we find that procedure?>
    I've dug through that code and it is not a thorough as you think it is. It handles specific situations and then defaults the rest. It is a good model for your own exception handler, however. That is what I used it for. :) I don't recall which library it is in, but I'll look around and if I find it, I'll post it.
    I agree with Andreas's comment...
    Simply remove your ON-ERROR-trigger, then you have a default. That's nothing better or worse than what apex has.I'm not too familiar with Apex; I've worked with it, but it's been a little while. Even with Apex, you're going to have to develop a customized Exception Handler so more intuitive or application specific messages are displayed in response to an exception.
    As to Andreas's comment...
    For your own error-handling... The "simplest" way in my eyes is create your own error-table where you have appropiate columns for the error-code and the error-type (FRM,ORA,Whatever), then in your ON-ERROR-trigger read the appropiate record from that table and show the error. You could also have a flag in your table which decides what to do with a specific error (Show as Message, Show as Alert, Don't show at all) and react accordingly.This is exactly what we implemented in our application. We created a set of tables that contain all of the Oracle Runtime errors and their attributes (Error Type, Severity Level, etc). Then we wrote a standard On-Error trigger that is subclassed to all of our forms that calls a Library "On_Error" package. This package evaluates the exception raised, compares it to the database entry for the error and then displays an appropriate message depending on the Severity Level, Error Type (ORA or FRM) and Message Type (Informational, Error, Caution) and we display the message in either the Status Bar, Note Alert, Caution Alert or Stop Alert or it is supressed. If an error is not found in the table, then it is displayed in a Stop Alert as an "Unhandled Exception." The second table I mentioned contains all of the messages used by our application and is cross referenced with the table that contains the Oracle messages. By simply assigned one of our messages to an Oracle message - our package will display our message instead of the default Oracle Message. Yes, this took sometime to build and test and once implemented, we spent another couple of months perfecting it, but now it is pretty solid and we haven't had to modify it in over a year.
    While this level of complexity may be overkill for your application, it does offer the greatest flexibility in the long-run. Also, if your application must support multiple languages, having all of your messages in a table make internationalization extremely easy. :)
    The point of all this, is that no matter which system you use (Forms, Apex, or Java) you will still need to invest some time into designing an Excpeiton Handling method for your application and then implement it accross the application. This is not something you can develop in a short period of time and it will not be perfect in the beginning. However, in the long-run, you will be happy you spent the time up-front to build a flexible and robust Exception Handling system.
    Craig...

  • Error handling for master data with direct update

    Hi guys,
    For master data with flexible update, error handling can be defined in InfoPackege, and if the load is performed via PSA there are several options - clear so far. But what about direct update...
    But my specific question is: If an erroneous record (e.g invalid characters) occur in a master data load using direct update, this will set the request to red. But what does this mean in terms of what happens to the other records of the request (which are correct) are they written to the master data tables, so that they can be present once the masterdata is activated, or are nothing written to masterdata tables if a single record is erroneous???
    Many thanks,
    / Christian

    Hi Christian -
    Difference between flexible upload & Direct upload is that direct upload does not have Update Rules, direct upload will have PSA as usual & you can do testing in PSA.
    second part when you load master data - if error occurs all the records for that request no will be status error so activation will not have any impact on it i.e. no new records from failed load will be available.
    hope it helps
    regards
    Vikash

  • Error Handling for BAPI MB_COUNT_POST_WITHOUT_INV_DOC for MI10 Transaction

    Hi,
    Can any one suggest me, how to handle the errors for the BAPI MB_COUNT_POST_WITHOUT_INV_DOC, because this bapi does not have any return table for errors handling? And also suggest any other BAPI which fits for MI10 transaction.
    <removed by moderator>
    Thanks&Regards,
    Damuan.
    Edited by: Thomas Zloch on Feb 2, 2012

    Hi Dear,
    Your answer is very helpful, thanks..!!
    But when  i am testing with the EIKPF structure, neither error is populating in EIKPF  nor the records are  posting in MI10. Could you please guess what would be the problem?
    Below are the fields that i am passing through this BAPI
    1)Document date 2)count date 3)plant 4)storage location 5)item number 6)material code 7) entry quantity
    Thanks&Regards,
    Damuan.

  • Error handling in bapi

    hi all,
          how to handle errors in bapis,and also can anyone send faqs on bapis.

    Hi
    A BAPI should be able to record and classify all possible errors that may occur a function Module BAPI_MESSAGE_GETDETAIL is used to Handle the Error Messages..
    You have to create a parameter named Return for every BAPI. This parameter returns exception messages or success messages to the calling program.
    BAPIs themselves must not trigger any messages (such as MESSAGE xnnn) in the coding. In particular they must not generate terminations or display dialog boxes. Instead, all messages must be intercepted internally and reported back to the calling program in the Return parameter. Otherwise the BAPI will not be processed correctly and control may not be given back to the calling program.
    All error messages or indeed any message that may be returned by the BAPI, must be defined in message table (Tools ® ABAP Workbench ® Development ® Programming environment ® Messages) and described in the documentation for the return parameter. This also applies to the most important or most likely error messages generated by other programs that can be indirectly passed via the BAPI to the application program.
    You must not use exceptions in BAPI interfaces.
    When a termination message (message type A) is triggered, a database rollback is executed in the standard programming model, that is, all tasks performed since the last COMMIT WORK are canceled. When you program BAPIs, we recommend that you also execute a database rollback in the return parameter for termination messages. You must describe this process in the documentation for the Return parameter. For messages of type E (error), the calling program performs the error handling.
    Application developers are provided with two service BAPIs to diagnose and process error messages from BAPI calls:
    BapiService.MessageGetDetail() displays the short and long texts of BAPI error messages.
    BapiService.ApplicationLogGetDetail(), with which information in application logs can be displayed.
    Features
    The export parameter Return can be implemented as follows:
    As a structure, whereby it must be defined in the function module as an export parameter, as well as in the method in the BOR.
    As a table, whereby it must be defined in the function module as a table parameter, as well as in the method in the BOR as an export parameter.
    Before filling the Return parameter you should either initialize the structure with CLEAR or the table with REFRESH and CLEAR.
    If the return parameter is not set or is set to an initial value this means that no error has occurred.
    The Return parameter may be based on the following reference structures:
    BAPIRET2
    You must use this reference structure when developing new BAPIS.
    BAPIRET1, BAPIRETURN
    These reference structures are still partly used in old BAPIs.
    Both structures must be filled in the logon language.
    Reward if Helpfull,
    Naresh.

Maybe you are looking for

  • Dynamic calculations in a materialized view

    Hi, I have a problem. I created a materialized view which works perfectly. But now I need to perform some calculations with the data in my view . The view contains the working hours of employees who worked in different projects. Every project has a f

  • How to open a jsp page inside a portlet directly ,Cannot find FacesContext

    Hi Thank you for reading my post. I have a portlet (a jsf portlet build by JSC) , now i need to open a window that will show some information , i managed to open the pop-up and pass some parameters to popup but right now , i do not know what is my js

  • Import files, import files

    How do I import Garageband files to my second computer, Macbook 10.6 with GB '11? 

  • Intergrate any ABAP transaction in a ABAP WD application (not via ITS!)

    Can I integrate any standard ABAP transaction in a ABAP Webdynpro application, for instance in a  Popup? (not ITS!). My workaround is: To create an iView for the ABAP transaction in the portal and to call the iView using the iVIEW URL. This works, bu

  • Material Master for IS Media

    Hello All, I am working on SAP IS Media Project for a publication company. I have created the material master for the Books as per the heirarchy means Prodyct Family, Product group and Issue. with all ISBN now these issues of books may belong to a se