To handle errors

Advertisement
November 30

Hi, if tr r 100 records to be updated, if  3, 52 and 99 records are failed ,what happens in case of session  and calltransaction method, how we can correct the errors in both cases and what happens they will update remaining fields or not.

Advertisement

Replay

hi,
if you use session u can check unprocessed records using SM35 tcode.In sm35 after processing the session you can check error log for unprocessed records depending up on the error message we can modify that particular record.
In the call transaction method we have to explicitly catch errors using BDCMSGCOLL and FORMAT_messages.
just check the below coding.
Handling errors in calltransaction using XK01 tcode.
REPORT  ZSR_BDC_CT_ERROR1.
TABLES : RF02K,LFA1.
DATA: BEGIN OF ITAB OCCURS 0,
         LIFNR LIKE RF02K-LIFNR,
         KTOKK LIKE RF02K-KTOKK,
         NAME1 LIKE LFA1-NAME1,
         SORTL LIKE LFA1-SORTL,
         LAND1 LIKE LFA1-LAND1,
         SPRAS LIKE LFA1-SPRAS,
      END OF ITAB.
DATA : BDCTAB LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
       BDCMSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
INCLUDE BDCRECX1.
START-OF-SELECTION.
CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    FILENAME                      = 'z:\flatfiles\sr1.txt'
   FILETYPE                      = 'ASC'
   HAS_FIELD_SEPARATOR           = 'X'
  HEADER_LENGTH                 = 0
  READ_BY_LINE                  = 'X'
  DAT_MODE                      = ' '
  CODEPAGE                      = ' '
  IGNORE_CERR                   = ABAP_TRUE
  REPLACEMENT                   = '#'
  CHECK_BOM                     = ' '
IMPORTING
  FILELENGTH                    =
  HEADER                        =
  TABLES
    DATA_TAB                      = ITAB
EXCEPTIONS
  FILE_OPEN_ERROR               = 1
  FILE_READ_ERROR               = 2
  NO_BATCH                      = 3
  GUI_REFUSE_FILETRANSFER       = 4
  INVALID_TYPE                  = 5
  NO_AUTHORITY                  = 6
  UNKNOWN_ERROR                 = 7
  BAD_DATA_FORMAT               = 8
  HEADER_NOT_ALLOWED            = 9
  SEPARATOR_NOT_ALLOWED         = 10
  HEADER_TOO_LONG               = 11
  UNKNOWN_DP_ERROR              = 12
  ACCESS_DENIED                 = 13
  DP_OUT_OF_MEMORY              = 14
  DISK_FULL                     = 15
  DP_TIMEOUT                    = 16
  OTHERS                        = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*perform open_group.
LOOP AT ITAB.
PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0100'.
PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                              'RF02K-KTOKK'.
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                              '/00'.
PERFORM BDC_FIELD       USING 'RF02K-LIFNR'
                              ITAB-LIFNR.
PERFORM BDC_FIELD       USING 'RF02K-KTOKK'
                              ITAB-KTOKK.
PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0110'.
PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                              'LFA1-SPRAS'.
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                              '/00'.
PERFORM BDC_FIELD       USING 'LFA1-NAME1'
                              ITAB-NAME1.
PERFORM BDC_FIELD       USING 'LFA1-SORTL'
                              ITAB-SORTL.
PERFORM BDC_FIELD       USING 'LFA1-LAND1'
                              ITAB-LAND1.
PERFORM BDC_FIELD       USING 'LFA1-SPRAS'
                              ITAB-SPRAS.
PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0120'.
PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                              'LFA1-KUNNR'.
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                              '/00'.
PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0130'.
PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                              'LFBK-BANKS(01)'.
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                              '=ENTR'.
PERFORM BDC_DYNPRO      USING 'SAPLSPO1' '0300'.
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                              '=YES'.
PERFORM BDC_TRANSACTION USING 'XK01'.
IF SY-SUBRC <> 0.
*LOOP AT bdcmsg.
*WRITE: bdcmsg-DYNAME,
      bdcmsg-DYNUMB,
      bdcmsg-MSGTYP,
      bdcmsg-MSGSPRA,
      bdcmsg-MSGID,
      bdcmsg-MSGNR,
      bdcmsg-MSGV1,
      bdcmsg-MSGV2,
      bdcmsg-MSGV3,
      bdcmsg-MSGV4.
*ENDLOOP.
READ TABLE BDCMSG WITH KEY MSGTYP = 'E'.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
   ID              = BDCMSG-MSGID
   LANG            = SY-LANGU
   NO              = BDCMSG-MSGNR
   V1              = BDCMSG-MSGV1
   V2              = BDCMSG-MSGV2
   V3              = BDCMSG-MSGV3
   V4              = BDCMSG-MSGV4
IMPORTING
   MSG             = BDCMSG-MSGV1
EXCEPTIONS
  NOT_FOUND       = 1
  OTHERS          = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE : / BDCMSG-MSGV1.
ENDIF.
ENDLOOP.
*perform close_group.

View 3 Replies

Can't open PDF's on my Mac coming in on MS Outlook 2010. Reinstalled Adobe software 4 x and still get "Adobe PDF Preview Handler" error message.

October 11

Can't open PDF's on my Mac coming in on MS Outlook 2010. Reinstalled Adobe software 4 x and still get "Adobe PDF Preview Handler" error message.No. Reader will not damage files. It is only meant to read pdf files. PDF files are frequently damage

View All Replies

I am gettng the following popup when using firfox as my browser: Exc in ev handl: Error: Bad NPObject as private data!

November 30

In the past few days I have been getting the following popup when I use firefox as my browser: Exc in ev handl: Error: Bad NPObject as private data! I assume it came from your latest update. I have windows vista with a 64 bit processor, and I am usin

View All Replies

Unity Connection 9 call handler error greeting "after greeting" action

November 30

Hello, i'm looking for a way to export all our call handler error greeting "after greeting" actions.  the Call Handler Data Dump tool doesn't seem to include this column in its export.  is there a SQL query I could run that would report this for

View All Replies

Exc in ev handl: Error: Bad NPObject as private data! what is this an how do i get rid of it...

November 30

Exc in ev handl: Error: Bad NPObject as private data!Please see solution in http://kb.mozillazine.org/Problematic_extensions for "McAfee Site Advisor". (Windows): For best results you should uninstall '''McAfee Site Advisor''' from Control Panel

View All Replies

Elke keer Exc in ev handl: Error: Bad NPObject as private data! na firefox 7

November 30

Na upgrade firefox 7 telkens de volgende mededeling: Exc in ev handl: Error: Bad NPObject as private data! Wat kan hieraan gedaan worden? Is het verstandig firefox 6 te gebruiken?This issue can be caused by the McAfee Site Advisor extension *https://

View All Replies

What is a "sync UI Handler" error mean?

November 30

What does a "sync UI handler" error mean? This happens when I try to sync with my PC in itunes. It tells me there are three conflicts that occured when I synced, 2 calendar and 1 music.I had the same problem few days ago. It appears that MP4 for

View All Replies

Handling errors in bdc

November 30

Hi, How to handle errors in bdc call transaction method. what is the steps to download errors from bdcmsgcoll into flat file  in call transaction method udayHi friend,   Here is a beautiful example which explains how to trap erroreneous records ..if

View All Replies

Handling Errors in Purchase Requisition

November 30

Hi guys, For handling errors in Purchase Orders is quite simple because it can be used mm_messages_mac. and there can be used macros: - for adding new errors mmpur_message_forced 'E' 'ZM' '048' TEXT-003 ' '  ' ' ' ' . - for removing errors, it can be

View All Replies

Every time I switch tabs I get this message "Exc in ev handl: Error: Bad NPObject as private data!" What do I do to stop this message from coming up??

November 30

If I open up firefox & have more than one tab I get this message "Exc in ev handl: Error: Bad NPObject as private data!" whenever I switch tabs. What should I do to fix this problem?? Thanks for your prompt attention to this matter -KippThis

View All Replies

Since I upgraded my Firefox..whenever I click on a link i get this error message...Java Script Exc in ev handl: Error: Bad NPObject as private data! Then I have to click ok to get the page to open.

November 30

Since I upgraded my firefox..I get this box most of the time when I click on a link to go to another page... Java Script Exc in ev handl: Error: Bad NPObject as private data! Then I have to click ok to get the page to open.That issue can be caused by

View All Replies

Getting OCI HANDLE ERROR

November 30

hi I running a big query and i got the result when I tried to save the result it gave me this error OCI HANDLE ERROR and then checked on details it says tht some DLL file not found. But this issue was not there previously. Can you suggest me how to r

View All Replies

How to handle error or exceptions in jsf

October 11

Hi i have a code using DTO and DAO.I want to handle errors in jsf automatically(ie without return parameter in java code .).Hoe i can handlethose errors in faces.config.Declaratevly You can't do this. I use two event handler for state remembering: pu

View All Replies

In call transaction how can we handle error records.

October 11

hai..tellme how can we handle error records in call transaction..we can get error records into one flatfile ok...then we have to execute the same bdc program with dat flat file (error records) once again...is it wright ..Hi, check this program u will

View All Replies

How to handle error for a file to file transform in ODI

October 11

I am doing a lab for file to file transformation where source = CSV file and target = Flat file. 1) When I am changing the datatype in source two files are getting created where one having the errored out data and the other having the errored message

View All Replies

Exception Handler Error: Source File Error please help me out

November 30

Hai i have simply added a text field and a button and i am trying to submit the data entered in text field to the database by pressing button. It is compiling and running successfully. but when i press the button it is showing that exception handler

View All Replies

Message Channel Handler error [oData through SUP]

November 30

when we are trying to access the oData service URL through SUP we are getting the following error any idea what could be wrong ERROR MMS MessageChannel Thread-252 [com.sybase.sup.server.msgchannel.internal.InboundMoHttpTransport]MessageChannel error

View All Replies

Handling error on service side

November 30

We have WCF service implemented in our project and it contains very complicated error handling. Pretty much all methods start with Try\catch block which are catching generic exception. Mean catch all. We would like to rework this service and I was tr

View All Replies

Handler Errors

November 30

Hello I am trying to figure out how to incorporate the donwload filereference code with my button - I have clicked actions then placed the code within but am getting errors - It must be { or } but im not sure where to place them - can someone take a

View All Replies

Raise without Handler error when printing pdf files in Outlook

October 11

At work sometimes I'm asked to print emails with tons of attachments, but when I attempt to print the email with the attachments through outlook, anytime there is a PDF attached, I get the "Raise without Handler!" error and also the following wi

View All Replies

Tags:

  1. how to enable mosh in Cisco routers
  2. ME_PROCESS_PO_CUST BAPI_PO_CREATE1
  3. HRDM
  4. barnduu
  5. principle3go
  6. describecy7
  7. JFQS
  8. protectionb1d
  9. steel6s3
  10. rearu3w
Copyrights 2019 Fcffair BigData Resource, All rights reserved