How's my error handling?
I'll keep this short.
I have TONS of CFTRY/CFCATCH blocks encapsulating different logic. In the event an error throws, I send the CFCATCH data and usually a descriptive message along with the invokation to a custom tag called cf_errorhandler. I haven't coded the logic yet in that page, but I'm wondering if this sounds convoluted.
I understand that this will only address 'caught' exceptions, and I will utilize the onError method in the application.cfc for unhandled exception handling, but I'd love to hear other people's input on how their error handler for caught exceptions work.
It's just that I get this feeling that I'm doing it the hard way.
Hmm. Thanks for that info, p. sim.
One of the things I'm adamount about with a framework solution is that:
a. It allows me to maintain my own URL format., ie, I can use domain.com/apples/oranges or domain.com/blog/this-is-an-article/comments rather than it forcing functionality into the url like domain.com/files/functions.cfm?do=that. I mean, it's one thing if I can call functionality in the framework with an AJAX or other "behind the scenes" HTTP request, that's fine. But when it comes to the user seeing the URL in the address bar, I want that to be all me.
b. It allows me to have my own directory structure for where I put files. Though I understand that MVC in its very nature is about separation of logic, presentation and data (and I'm fine with that), it would need to support my naming structures for the application's directories.
I've heard about Fusebox the most, and in the few CF job postings I've seen, when they mention framework familiarity, they usually list Fusebox as the preference. I do like your line on spending time on what to build than how to build.
Can you recommend a good place to learn Fusebox? Their website seems to suffer from what I call "Developer-itis", where it's not necessarily being presented in an easy to consume manner (though I understand that's a subjective statement). Fusebox seems like something well worth learning since it can optimize my build process.
Similar Messages
-
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 -
How to treat error handling in the consumer loop in the queue message handler structure?
Hi,
I'd like to know how to stop the producer loop(event loop) in the QMH structure when the error happened in the consumer loop.
I've construct a demo code by myself as the attached image, but it's a pity that I have to create a recdundant indicator "End" to trigger the value change event to stop the program. This is not a good way to do it. Could someone give me some better idea how to deal with it? Very appreciated to you sharing ideas.Concerning your doubts about the "traditional" implementation of this pattern, I hear you. As I have written many times before, its main benefit is that it is easy to explain in a training class. It unfortunately has a lot of drawbacks.
Tim's suggestion about User Events, is a good one. But to use it to the best advantage, you will need to get away from having everything on one block diagram. If you think about it there is no real need for the two loops to be on the same block diagram and a lot of really good reasons for them not to be. For example, if they are in separate VIs, they can both be event driven and any communication problems between loops evaporates.
Its also more modular, easier to maintain, more reusable, etc...
Check the link in my signature.
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps -
How do perform error handling in production environment?
Hi,
I am using CKM and flow control true, tp trace the invalid records while moving data from File to DB. For all invalid records it make n entry in E$_ Table.
But when I correct the record in file and if its success full, those error gets deleted... I want to keep those error as a history?? How can i do that?
Secondly, If there is an error records in E$ table..and when i run next time.. Will it insert only the error records or entire file again???????????????
Thanks:)To your first question,
Yes this can be achieved by amending the CKM. You can remove the step to 'delete previous errors' and make sure that the 'DROP_ERROR_TABLE' option is not set to 'true', therefore all errors will remain in the E$ table even if they have been loaded.
Your second question is dependent on what you are trying to achieve and how.
Are you using IKM incremental update/control Append to load your data?
You may want to have the RECYCLE_ERRORS' set to false on your IKM, then the previously error'ed records will not be re-inserted to your I$ table.
Your third point is basically due to to incorrect model definition in ODI and probably your target database. This is not an error in ODI terms but incorrect data modelling.
Edited by: Bos on Apr 13, 2011 11:38 AM -
How to implement Error handling in Openscript
Hi All,
Please help me to implement this .
I am creating Load test script for ebs - approve requisitions process.
The script will login to check any requisitions are waiting for approval, if found then it will click on random requisitions then approve it.
There are no requisitions for approval then I want to call the log-out function then start the iteration again.
What function to be used to start the iteration again .
//After login, I am checking no of requisition to approve.
beginStep("Login");
getScript("MyFunc").callFunction("ebsLogin");
http.assertText("LoginCheckString", "window[@index='0']","Oracle Applications Home Page", Source.Html,TextPresence.PassIfPresent, MatchOption.Exact);
try {
http.solve("noOfFound", "window[@index='0']", "<a id=\"N39:(.+?)\" title=\"Purchase Requisition ", "No Requisitions Found", false, Source.Html, null, EncodeOptions.None);
}catch (Exception e){
info("No Requisitions to Approve");
getScript("UtilityFunc").callFunction("ebsLogOut");
// I want to start the iteration again after this point, but it's continue executing the remaining steps.
endStep();
beginStep("ClkRequisitions");
http.link(716,"window[@index='0']//a[@id='N39:{{sRndChoice}}']").click();
endStep();
beginStep("Logout");
getScript("UtilityFunc").callFunction("ebsLogOut");
endStep();Create a flag(boolean) and loop till true, ie.
boolean flag =true;
while(flag){
---your steps----
try{
----your steps---
flag=false;
catch(Exception e){
---your steps---
Cheers,
Deepu M
[email protected] -
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.
ThanksBackground 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. -
/SAPSRM/CL_OFFLINEAPP_INBOUND error handling
Hello gurus,
I hope someone may enlighten me with a question I have on the Offline Approval inbound process...
We're running SRM 7.0 SP9, and in order to configure the inbound processing of the offline approval we have to go to SO50, add the exit /SAPSRM/CL_OFFLINEAPP_INBOUND etc. All good so far!
The question: how is the error handling done, and most importantly how may we add our custom logic? I see there is a method called HANDLE_ERROR (where I could add an enhancement implementation) - which seems to not be called anywhere and doesn't have any import/export parameters! Therefore this is no good for me I guess (unless someone proves me wrong?)
Basically my client wants to add an entry to RZ20 alert / or a normal log in SLG1 whenever an offline approval fails (if immediate processing fails for any other reason). By standard I think it forwards the reply e-mail to the SAP Business Workplace inbox of the user.
Has anyone done something similar? I have checked the forums and done several xSearches on the SAP Marketplace, however just hitting dead ends...
Many thanks!
AdiHi Adi Abu-Taha Zitawi,
Hope all is well.
I actually have the same question as you. The standard error handling functionality seems to send a message back to the "wf-batch" user if there is an error. Also, this message is pretty useless since it does not even contain the shopping cart #. This is also not an ideal solution because a business user has no visibility of these messages.
What / how did you end up resolving this business requirement? Did you implement the solution mentioned above?
cheers, -
Hello every one,
How to do error handling in user exit plz gimme some example for this..
Regards
MartinHi Jen,
the problem is that I want to use a transaction that needs data (TO number) that I created already but I don't called a COMMIT, see following structure (simplified):
* Creating TO
PERFORM create_new_transport_order CHANGING lv_generated_to_num.
CALL TRANSACTION LT31 WITH lv_generated_to_num.
<....>
COMMIT WORK.
Is it possible to call a transaction with data that is not really in the database yet? That's my question/problem.
Thanks -
OUTBOUND- ERROR HANDLING USING WORKFLOW
Hi Gurus,
Can any one tell me about workflow & how to do error handling using WORKFLOW in OUTBOUND IDOC.Below are the points , Please check it & send me reply.
1.Value not found for Custom IDoc fields.
2. Partner Profile not maintained correctly.
3. Syntax error in IDoc.
4. IDoc ready for dispatch (ALE Service).
Regards,
Chiranjeevi.Hi,
FOr most of your requirements, there is already std. SAP IDOC error Single-step tasks.
Have a look at WE46 transaction.
Also, if you go to SWO1 and search with "IDOC*", you will get all the BO's even.
It's pretty straightfwd. Also, in Partner Profiles, WE20, for each of the IDOC type, there is one "Post.Processing AGent", whom if you set up correctly, will be the person receiving this Errored IDOC mails.
Hope this helps
venu -
Error Handling for Outbound IDOC - COSMAS (Cost Center Master)
Hi,
I need to trigger a mail to SAP inbox whenever a outbound idoc fails for any reason.
I know how to do it for inbound or outbound transaction data, but not sure how to do error handling for outbound master data.
Could one of you help me understand the same.
Thanks in Advance,
VinothHey Vinoth,
Do you want decide the recipient of the mail dynamically? am asking because if you give the USER NAME in the partner profile and when ever a IDOC fails a mail will automatically reach the user inbox automatically
let me know if i answered ur question.
Thanks,
Santhosh -
Error handling with cmdlnlauncher.bat
Hi,
I'm trying to figure out how to incorportate error handling when calling CmdLnLauncher.bat in a .bat file. I checked for 'errorlevel' after a business rule failure and it's 0, which says it was successful. Has anyone added error handling to the CmdLnlauncher batch process?
Thanks,
Vickiuser5519435 wrote:
Hi,
I'm trying to figure out how to incorportate error handling when calling CmdLnLauncher.bat in a .bat file. I checked for 'errorlevel' after a business rule failure and it's 0, which says it was successful. Has anyone added error handling to the CmdLnlauncher batch process?
Thanks,
VickiI have the same requirements and now checking whether we can check the error codes returned. -
Error Handling in BDC...Review code..
Hi Gurus,
I have made a BDC program to do call transaction for FV50...i AM NOT SURE ON HOW TO DO ERROR HANDLING IN THAT...TRIED TO DO SOMETHING BUT IT NEEDS LOT OF IMPROVEMENT...
CAN ONE YOU EXPERTS HELP ME IN THAT...I AM ATTACHING THE ENTIRE CODE..
REPORT zbdc_park_fv50.
DATA:
t_document_line_item_main LIKE bapiacgl09 OCCURS 100,
t_document_line_item_enhn LIKE bapiacextc OCCURS 100,
t_document_line_item_amnt LIKE bapiaccr09 OCCURS 100,
wa_document_header LIKE bapiache09,
wa_document_line_item_main LIKE bapiacgl09,
wa_document_line_item_enhn LIKE bapiacextc,
wa_document_line_item_amnt LIKE bapiaccr09.
DATA: BEGIN OF s_bdc_document_item_main,
v_HKONT LIKE ACGL_ITEM-HKONT,
v_SHKZG LIKE ACGL_ITEM-SHKZG,
v_SGTXT LIKE ACGL_ITEM-SGTXT,
v_WRBTR LIKE ACGL_ITEM-WRBTR,
v_WAERS LIKE ACGL_HEAD-WAERS,
v_PRCTR LIKE ACGL_ITEM-PRCTR,
v_YYLOB LIKE ACGL_ITEM-YYLOB,
v_YYCSG LIKE ACGL_ITEM-YYCSG,
END OF s_bdc_document_item_main.
DATA: t_bdc_document_item_main LIKE s_bdc_document_item_main OCCURS 0,
wa_bdc_document_item_main LIKE s_bdc_document_item_main.
DATA: t_bdcdata LIKE bdcdata OCCURS 0 with header line,
t_messages LIKE bdcmsgcoll OCCURS 0 with header line.
DATA: idx TYPE i,
ch3(2) TYPE n,
fname(40) TYPE c,
options TYPE ctu_params.
DATA: indate TYPE d,
intdate TYPE d,
var_SHKZG LIKE BSEG-SHKZG,
amount(13) type c.
DATA: w_textout LIKE t100-text.
*DATA: gd_update TYPE i,
gd_lines TYPE i.
CLEAR wa_document_header.
***FILL DOCUMENT HEADER***********
wa_document_header-obj_type = space. "
wa_document_header-obj_key = space.
wa_document_header-obj_sys = space.
wa_document_header-bus_act = 'RFBU'.
wa_document_header-username = 'samwil'.
wa_document_header-header_txt = 'TEST_BDC_PARK123'.
wa_document_header-comp_code = '1001'.
wa_document_header-doc_date = '20070817'.
wa_document_header-pstng_date = '20070817'.
CLEAR wa_document_header-trans_date.
CLEAR wa_document_header-fisc_year.
CLEAR wa_document_header-fis_period.
wa_document_header-doc_type = 'SY'.
wa_document_header-ref_doc_no = 'AAR1213'.
wa_document_header-ac_doc_no = space.
wa_document_header-obj_key_r = space.
wa_document_header-reason_rev = space.
wa_document_header-compo_acc = space.
wa_document_header-ref_doc_no_long = space.
wa_document_header-acc_principle = 'LGAP'.
wa_document_header-neg_postng = space.
wa_document_header-obj_key_inv = space.
wa_document_header-bill_category = space.
FILL LINE ITEMS *******************
CLEAR: wa_document_line_item_main, wa_document_line_item_enhn, wa_document_line_item_amnt.
Fill Main Portion Of Accounting Line Item
wa_document_line_item_main-itemno_acc = '1'. "Accounting Document Line Item Number
wa_document_line_item_main-gl_account = '2480001067'."HKONT - Account
wa_document_line_item_main-item_text = 'ITEM 2'. "SGTXT - Item Text
wa_document_line_item_main-doc_type = space. "BLART - Document Type
wa_document_line_item_main-comp_code = space. "BUKRS - Company Code
wa_document_line_item_main-pstng_date = '20080817'. "BUDAT - Posting Date
wa_document_line_item_main-alloc_nmbr = space. "ZUONR - Allocation Number
wa_document_line_item_main-costcenter = space. "KOSTL - Cost Center
wa_document_line_item_main-profit_ctr = '1999999'. "PRCTR - Profit Center
wa_document_line_item_main-de_cre_ind = 'D'. "NEWBS - Posting Key / Debit Credit Indicator
wa_document_line_item_main-trade_id = space. "RASSC - Company ID Of Trading Partner
Fill Amount Portion Of Accounting Line Item
wa_document_line_item_amnt-itemno_acc = '1'. "Accounting Document Line Item Number
wa_document_line_item_amnt-curr_type = '00'. "Currency Type
wa_document_line_item_amnt-currency = 'USD'. "WAERS - Currency Key
wa_document_line_item_amnt-amt_doccur = '100'. "WRBTR - Amount In Document Currency Type
Create Enhancement Portion Of Accounting Line Item
wa_document_line_item_enhn-field1+0(3) = '001'. "Line of Bus YYLOB
wa_document_line_item_enhn-field1+3(3) = '008'. "Customer Segm YYCSG
wa_document_line_item_enhn-field1+6(5) = space. "Product Group
wa_document_line_item_enhn-field1+11(2) = space. "Distribution Ch
wa_document_line_item_enhn-field1+13(4) = space. "Maturity Year
wa_document_line_item_enhn-field1+17(3) = space. "Insurance Type
wa_document_line_item_enhn-field1+20(4) = space. "Accident Year
wa_document_line_item_enhn-field1+24(6) = space. "Product
wa_document_line_item_enhn-field1+30(3) = space. "Source
wa_document_line_item_enhn-field1+33(22) = space. "DI Run Name
wa_document_line_item_enhn-field1+55(1) = space. "DI Run Type
wa_document_line_item_enhn-field1+56(5) = space. "DI Run Number
wa_document_line_item_enhn-field1+61(16) = space. "DI Journal ID
wa_document_line_item_enhn-field1+77(5) = space. "DI Journal Link
wa_document_line_item_enhn-field1+82(22) = space. "DI File Name
APPEND: wa_document_line_item_main TO t_document_line_item_main,
wa_document_line_item_enhn TO t_document_line_item_enhn,
wa_document_line_item_amnt TO t_document_line_item_amnt.
Fill Next Line Item #2
CLEAR: wa_document_line_item_main, wa_document_line_item_enhn, wa_document_line_item_amnt.
Fill Main Portion Of Accounting Line Item
wa_document_line_item_main-itemno_acc = '2'. "Accounting Document Line Item Number
wa_document_line_item_main-gl_account = '2480001067'."HKONT - Account
wa_document_line_item_main-item_text = 'ITEM 3'. "SGTXT - Item Text
wa_document_line_item_main-doc_type = space. "BLART - Document Type
wa_document_line_item_main-comp_code = space. "BUKRS - Company Code
wa_document_line_item_main-pstng_date = '20080817'. "BUDAT - Posting Date
wa_document_line_item_main-alloc_nmbr = space. "ZUONR - Allocation Number
wa_document_line_item_main-costcenter = space. "KOSTL - Cost Center
wa_document_line_item_main-profit_ctr = '1999999'. "PRCTR - Profit Center
wa_document_line_item_main-de_cre_ind = 'C'. "NEWBS - Posting Key / Debit Credit Indicator
wa_document_line_item_main-trade_id = space. "RASSC - Company ID Of Trading Partner
Fill Enhancement Portion Of Accounting Line Item
Fill Amount Portion Of Accounting Line Item
wa_document_line_item_amnt-itemno_acc = '2'. "Accounting Document Line Item Number
wa_document_line_item_amnt-curr_type = '00'. "Currency Type
wa_document_line_item_amnt-currency = 'USD'. "WAERS - Currency Key
wa_document_line_item_amnt-amt_doccur = '100'. "WRBTR - Amount In Document Currency Type
Create Enhancement Portion Of Accounting Line Item
wa_document_line_item_enhn-field1+0(3) = '001'. "Line of Bus YYLOB.
wa_document_line_item_enhn-field1+3(3) = '008'. "Customer Segm YYCSG
wa_document_line_item_enhn-field1+6(5) = space. "Product Group
wa_document_line_item_enhn-field1+11(2) = space. "Distribution Ch
wa_document_line_item_enhn-field1+13(4) = space. "Maturity Year
wa_document_line_item_enhn-field1+17(3) = space. "Insurance Type
wa_document_line_item_enhn-field1+20(4) = space. "Accident Year
wa_document_line_item_enhn-field1+24(6) = space. "Product
wa_document_line_item_enhn-field1+30(3) = space. "Source
wa_document_line_item_enhn-field1+33(22) = space. "DI Run Name
wa_document_line_item_enhn-field1+55(1) = space. "DI Run Type
wa_document_line_item_enhn-field1+56(5) = space. "DI Run Number
wa_document_line_item_enhn-field1+61(16) = space. "DI Journal ID
wa_document_line_item_enhn-field1+77(5) = space. "DI Journal Link
wa_document_line_item_enhn-field1+82(22) = space. "DI File Name
APPEND: wa_document_line_item_main TO t_document_line_item_main,
wa_document_line_item_enhn TO t_document_line_item_enhn,
wa_document_line_item_amnt TO t_document_line_item_amnt.
****FILL THE BDC TABLE*******************************************************
LOOP AT t_document_line_item_main INTO wa_document_line_item_main.
Move: wa_document_line_item_main-gl_account TO wa_bdc_document_item_main-v_HKONT,
wa_document_line_item_main-item_text TO wa_bdc_document_item_main-v_SGTXT,
wa_document_line_item_main-profit_ctr TO wa_bdc_document_item_main-v_PRCTR,
wa_document_line_item_main-de_cre_ind TO wa_bdc_document_item_main-v_SHKZG.
Read table t_document_line_item_amnt index sy-tabix into wa_document_line_item_amnt.
IF sy-subrc = 0.
Move : wa_document_line_item_amnt-currency TO wa_bdc_document_item_main-v_WAERS,
wa_document_line_item_amnt-amt_doccur TO wa_bdc_document_item_main-v_WRBTR.
ENDIF.
Read table t_document_line_item_enhn index sy-tabix into wa_document_line_item_enhn.
IF sy-subrc = 0.
Move : wa_document_line_item_enhn-field1+0(3) TO wa_bdc_document_item_main-v_YYLOB,
wa_document_line_item_enhn-field1+3(3) TO wa_bdc_document_item_main-v_YYCSG.
ENDIF.
APPEND wa_bdc_document_item_main TO t_bdc_document_item_main.
CLEAR: wa_bdc_document_item_main.
ENDLOOP. " BDC Table.
************************BDC PROGRAM**************************************************************
perform bdc_dynpro TABLES t_bdcdata using 'SAPLACHD' '1000'.
perform bdc_field TABLES t_bdcdata using 'BDC_CURSOR'
'BKPF-BUKRS'.
perform bdc_field TABLES t_bdcdata using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field TABLES t_bdcdata using 'BKPF-BUKRS'
wa_document_header-comp_code.
perform bdc_dynpro TABLES t_bdcdata using 'SAPMF05A' '1001'.
perform bdc_field TABLES t_bdcdata using 'BDC_OKCODE'
'=PBBP'.
perform bdc_field TABLES t_bdcdata using 'ACGL_HEAD-BLDAT'
wa_document_header-doc_date.
perform bdc_field TABLES t_bdcdata using 'ACGL_HEAD-WAERS'
'USD'.
perform bdc_field TABLES t_bdcdata using 'ACGL_HEAD-BUDAT'
wa_document_header-pstng_date.
perform bdc_field TABLES t_bdcdata using 'ACGL_HEAD-XBLNR'
wa_document_header-ref_doc_no.
perform bdc_field TABLES t_bdcdata using 'ACGL_HEAD-BKTXT'
wa_document_header-header_txt.
perform bdc_field TABLES t_bdcdata using 'ACGL_HEAD-BLART'
wa_document_header-doc_type.
perform bdc_field TABLES t_bdcdata using 'BDC_CURSOR'
'ACGL_ITEM_GEN-GEN_CHAR2(02)'.
LOOP AT t_bdc_document_item_main INTO wa_bdc_document_item_main.
idx = idx + 1.
ch3 = idx.
CONCATENATE 'ACGL_ITEM-HKONT('ch3')' INTO FNAME.
perform bdc_field TABLES t_bdcdata using fname
wa_bdc_document_item_main-v_HKONT.
CONCATENATE 'ACGL_ITEM-SHKZG('ch3')' INTO FNAME.
IF wa_bdc_document_item_main-v_SHKZG = 'C'.
var_SHKZG = 'H'.
ELSEIF wa_bdc_document_item_main-v_SHKZG = 'D'.
var_SHKZG = 'S'.
ENDIF.
perform bdc_field TABLES t_bdcdata using fname
var_SHKZG.
CONCATENATE 'ACGL_ITEM-WRBTR('ch3')' INTO FNAME.
WRITE: wa_bdc_document_item_main-v_WRBTR to amount.
perform bdc_field TABLES t_bdcdata using FNAME
wa_bdc_document_item_main-v_WRBTR.
amount.
CONCATENATE 'ACGL_ITEM-SGTXT('ch3')' INTO FNAME.
perform bdc_field TABLES t_bdcdata using FNAME
wa_bdc_document_item_main-v_SGTXT.
CONCATENATE 'ACGL_ITEM-PRCTR('ch3')' INTO FNAME.
perform bdc_field TABLES t_bdcdata using FNAME
wa_bdc_document_item_main-v_PRCTR.
CONCATENATE 'ACGL_ITEM_GEN-GEN_CHAR1('ch3')' INTO FNAME.
perform bdc_field TABLES t_bdcdata using FNAME
wa_bdc_document_item_main-v_YYLOB.
CONCATENATE 'ACGL_ITEM_GEN-GEN_CHAR2('ch3')' INTO FNAME.
perform bdc_field TABLES t_bdcdata using FNAME
wa_bdc_document_item_main-v_YYCSG.
options-dismode = 'A'.
options-nobinpt = 'X'.
endloop.
CALL TRANSACTION 'FV50' USING t_bdcdata MESSAGES INTO
t_messages OPTIONS FROM options.
*if sy-subrc = 0.
Retrieve error messages
LOOP AT t_messages WHERE msgtyp = 'E'.
Builds actual message based on info returned from Call transaction
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
msgid = t_messages-msgid
msgnr = t_messages-msgnr
msgv1 = t_messages-msgv1
msgv2 = t_messages-msgv2
msgv3 = t_messages-msgv3
msgv4 = t_messages-msgv4
IMPORTING
message_text_output = w_textout.
ENDLOOP.
Start new screen
FORM bdc_dynpro TABLES it_bdcdata STRUCTURE bdcdata USING program
dynpro.
DATA: wa_bdcdata TYPE bdcdata.
wa_bdcdata-program = program.
wa_bdcdata-dynpro = dynpro.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO it_bdcdata.
ENDFORM. "BDC_DYNPRO
Insert field
FORM bdc_field TABLES it_bdcdata STRUCTURE bdcdata USING fnam fval.
DATA: wa_bdcdata TYPE bdcdata.
IF fval <> space.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = fnam.
wa_bdcdata-fval = fval.
APPEND wa_bdcdata TO it_bdcdata.
ENDIF.
ENDFORM. "BDC_FIELD
Title was edited by:
Alvaro Tejada GalindoHI,
The code looks ok...
take a internal table for messages.
data : begin of itab occurs 0,
message(100) type c,
end of itab.
put this after
Retrieve error messages
LOOP AT t_messages WHERE msgtyp = 'E'.
Builds actual message based on info returned from Call transaction
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
msgid = t_messages-msgid
msgnr = t_messages-msgnr
msgv1 = t_messages-msgv1
msgv2 = t_messages-msgv2
msgv3 = t_messages-msgv3
msgv4 = t_messages-msgv4
IMPORTING
message_text_output = w_textout.
<b>itab-message = w_textout.
append itab</b>.
ENDLOOP. -
Using the general error handler on an embedded rt target
I would like to know how the general error handler can be best employed
with Labview RT on a Compact Fieldpoint controller. Clearly no
dialogue options are valid so how can error information be accessed
remotely - is there an error log file available on the controller?I think there are plenty of ways to handle errors with Labview RT on a Fieldpoint controller.
Usually I use the general error handler vi to catch the error and get the error message (sure, no dialog), then write the eroor message into a log file (ordinary text file created on the controller), and/or send the eroor message through TCP/IP network to the host. You can use FTP to open, read and tranfer the log file at host. Hope help.
Xu -
Error Handling in OS 10gR3: How To's, Approaches, best practices
I am trying to do error rhandling within OSB 10gR3 and looking for some guidance as to best practices and how to carry out the error handling based on my use-case as -
Consumers ---> GenericProxyExt(WSDL based) ---> GenericProxyInt(Any SOAP) ---> Proxy (Any XML) ---> Business Service --------------> Target Service
Since target web service will pass error in the SOAP:fault, where in the OSB should this error be handled? Also, how can I pass the custom error messages (instead of the one returned from the target service). Do I have to write error handlers in each of the proxy services?
Any insight, sample code, approaches will be helpful
Thanks,
-Juser2629959 wrote:
I am trying to do error rhandling within OSB 10gR3 and looking for some guidance as to best practices and how to carry out the error handling based on my use-case as - Some customer has documented related info www.insemble.com/CustomExceptionHandlingwithOracleServiceBus.pdf
>
Consumers ---> GenericProxyExt(WSDL based) ---> GenericProxyInt(Any SOAP) ---> Proxy (Any XML) ---> Business Service --------------> Target Service
Since target web service will pass error in the SOAP:fault, where in the OSB should this error be handled? Also, how can I pass the custom error messages (instead of the one returned from the target service). Do I have to write error handlers in each of the proxy services?Not sure if I understood your point of using that many proxies for invoking a Target Service.
Since BS throws soap fault, and the last Proxy is AnyXML. You need to do bit of manipulations. First of all for AnyXML services, you have to manually copy $fault into $body. Reason behind this step, is For Any XML there is no concept of $fault being returned and reply with failure. Subsequent proxies will receive the $fault as originated in Target Service. If we want to control the $fault received by the consumers, we have to use error handlers and populate $fault accordingly.
>
Any insight, sample code, approaches will be helpful
Thanks,
-J -
Dear all
How to Setup Forward Error Handling in PI Scenarios. Can you help me with the same with screen shots if possible?
Thanks
Regards
karanHello
These are the following errors
1. Trace level="1" type="T">no interface action for sender or receiver found</Trace>
2. <Trace level="1" type="System_Error">Application-Error exception return from pipeline processing!
3.
<Trace level="1" type="T">Application Error at Receiver... => ROLLBACK WORK</Trace>
<Trace level="1" type="T">System Error at Receiver... => ROLLBACK WORK</Trace>
<Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_LOG_TO_PERSIST" />
<Trace level="1" type="System_Error">Application-Error exception return from pipeline processing!</
Trace level="3" type="T">No persisting of message after plsrv call, because of config</Trace>Trace level="3" type="T">Error of the prevous version:</TraceTrace level="3" type="T">Error ID APPLICATION_ERROR</Trace>
tThere are repeating errors also.
TThanks
Regards
kkaran
Maybe you are looking for
-
How do I stop firefox from remembering my passwords?
I want firefox not to remember the my passwords in this computer as I will not be using this computer anymore. How do I stop password remembering feature>
-
How can i add a progress bar to my UIwebview
i have a page in my application where i have a UIWebview what i want to do is have a progress bar somewhere on the screen to indicate the loading status on the page.
-
Export to excel iview table data of a standard application with out BAPI
Hi All, I am Editing Standard Application. In that i need to add a button, on clicking that the data present in that iview table to be exported to excel. The table contains editable & non editable fields. The context attributes are under in different
-
New java-like scripting language w/ powerful regex
Hi, Just wanted to let you know that there's now a new scripting language called P~ with the following important aspects: 1) matches and exceeds Perl regex solveability -- e.g. offers full regex-based boolean query on non-indexed corpus, offers compl
-
Using the Create Page wizard to create a 3 Page Master Detail by selecting the "Edit detail on a separate page. Resulting pages are:- 1. Report on Master page, 2. Master Detail page (allows maintenance of Master row) 3. Maintain Detail page However t