From 826e5692c5f64e3eb24ed1c846a29392773e7416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=BCnter?= Date: Wed, 25 Oct 2017 18:12:18 +0000 Subject: [PATCH 1/5] display HTTP error codes and message --- src/zabapgit_http.prog.abap | 43 +++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/src/zabapgit_http.prog.abap b/src/zabapgit_http.prog.abap index 0420e0a1e..20e3c2f4d 100644 --- a/src/zabapgit_http.prog.abap +++ b/src/zabapgit_http.prog.abap @@ -198,7 +198,9 @@ CLASS lcl_http_client IMPLEMENTATION. METHOD send_receive. - DATA lv_text TYPE string. + DATA: lv_text TYPE string, + lv_code TYPE i, + lv_message TYPE string. mi_client->send( ). mi_client->receive( @@ -208,20 +210,29 @@ CLASS lcl_http_client IMPLEMENTATION. http_processing_failed = 3 OTHERS = 4 ). IF sy-subrc <> 0. - CASE sy-subrc. - WHEN 1. - " make sure: - " a) SSL is setup properly in STRUST - " b) no firewalls - " check trace file in transaction SMICM - lv_text = 'HTTP Communication Failure'. "#EC NOTEXT - WHEN 2. - lv_text = 'HTTP Invalid State'. "#EC NOTEXT - WHEN 3. - lv_text = 'HTTP Processing failed'. "#EC NOTEXT - WHEN OTHERS. - lv_text = 'Another error occured'. "#EC NOTEXT - ENDCASE. + + mi_client->get_last_error( + IMPORTING + code = lv_code + message = lv_message ). + + lv_text = |HTTP error { lv_code } occured: { lv_code }|. + +* CASE sy-subrc. +* WHEN 1. +* " make sure: +* " a) SSL is setup properly in STRUST +* " b) no firewalls +* " check trace file in transaction SMICM +* lv_text = 'HTTP Communication Failure'. "#EC NOTEXT +* WHEN 2. +* lv_text = 'HTTP Invalid State'. "#EC NOTEXT +* WHEN 3. +* lv_text = 'HTTP Processing failed'. "#EC NOTEXT +* WHEN OTHERS. +* lv_text = 'Another error occured'. "#EC NOTEXT +* ENDCASE. + zcx_abapgit_exception=>raise( lv_text ). ENDIF. @@ -502,7 +513,7 @@ CLASS lcl_http IMPLEMENTATION. DATA: lv_host TYPE string, lt_list TYPE zif_abapgit_definitions=>ty_icm_sinfo2_tt, - li_exit TYPE ref to lif_exit. + li_exit TYPE REF TO lif_exit. CALL FUNCTION 'ICM_GET_INFO2' TABLES From 274afc01eb0d52e3d66f4b70903ba20d3cb4fa1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=BCnter?= Date: Wed, 25 Oct 2017 18:14:48 +0000 Subject: [PATCH 2/5] Fix code displayed double and text missing --- src/zabapgit_http.prog.abap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zabapgit_http.prog.abap b/src/zabapgit_http.prog.abap index 20e3c2f4d..c01ba32b6 100644 --- a/src/zabapgit_http.prog.abap +++ b/src/zabapgit_http.prog.abap @@ -216,7 +216,7 @@ CLASS lcl_http_client IMPLEMENTATION. code = lv_code message = lv_message ). - lv_text = |HTTP error { lv_code } occured: { lv_code }|. + lv_text = |HTTP error { lv_code } occured: { lv_message }|. * CASE sy-subrc. * WHEN 1. From 789058778edfab2b31acee8dd6c2501324393a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=BCnter?= Date: Wed, 25 Oct 2017 18:37:07 +0000 Subject: [PATCH 3/5] Remove not existing exception (7.31 and lower) --- src/zabapgit_object_iamu.prog.abap | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/zabapgit_object_iamu.prog.abap b/src/zabapgit_object_iamu.prog.abap index 880950a28..aa6c3a074 100644 --- a/src/zabapgit_object_iamu.prog.abap +++ b/src/zabapgit_object_iamu.prog.abap @@ -116,8 +116,7 @@ CLASS lcl_object_iamu IMPLEMENTATION. object_not_existing = 9 object_invalid = 10 error_occured = 11 - content_data_error = 12 - OTHERS = 13 ). + OTHERS = 12 ). IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |Error from if_w3_api_mime~set_changeable| ). @@ -303,8 +302,7 @@ CLASS lcl_object_iamu IMPLEMENTATION. object_not_existing = 9 object_invalid = 10 error_occured = 11 - content_data_error = 12 - OTHERS = 13 ). + OTHERS = 12 ). IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |Error from if_w3_api_mime~set_changeable| ). From 2dea8cf49af8223ca1455f97d98af18a8d8de73e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=BCnter?= Date: Wed, 25 Oct 2017 18:53:42 +0000 Subject: [PATCH 4/5] Better communication of HTTP errors --- src/zabapgit_http.prog.abap | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/zabapgit_http.prog.abap b/src/zabapgit_http.prog.abap index c01ba32b6..8f7dc46f0 100644 --- a/src/zabapgit_http.prog.abap +++ b/src/zabapgit_http.prog.abap @@ -209,7 +209,13 @@ CLASS lcl_http_client IMPLEMENTATION. http_invalid_state = 2 http_processing_failed = 3 OTHERS = 4 ). + IF sy-subrc <> 0. + " in case of HTTP_COMMUNICATION_FAILURE + " make sure: + " a) SSL is setup properly in STRUST + " b) no firewalls + " check trace file in transaction SMICM mi_client->get_last_error( IMPORTING @@ -218,21 +224,6 @@ CLASS lcl_http_client IMPLEMENTATION. lv_text = |HTTP error { lv_code } occured: { lv_message }|. -* CASE sy-subrc. -* WHEN 1. -* " make sure: -* " a) SSL is setup properly in STRUST -* " b) no firewalls -* " check trace file in transaction SMICM -* lv_text = 'HTTP Communication Failure'. "#EC NOTEXT -* WHEN 2. -* lv_text = 'HTTP Invalid State'. "#EC NOTEXT -* WHEN 3. -* lv_text = 'HTTP Processing failed'. "#EC NOTEXT -* WHEN OTHERS. -* lv_text = 'Another error occured'. "#EC NOTEXT -* ENDCASE. - zcx_abapgit_exception=>raise( lv_text ). ENDIF. From 9a3c97d58103141a4a1386c2e04e42ba72e22a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=BCnter?= Date: Thu, 26 Oct 2017 09:53:04 +0000 Subject: [PATCH 5/5] Fix bug WEBI output parameter --- src/zabapgit_object_webi.prog.abap | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/zabapgit_object_webi.prog.abap b/src/zabapgit_object_webi.prog.abap index 4c5d35dc2..a69100167 100644 --- a/src/zabapgit_object_webi.prog.abap +++ b/src/zabapgit_object_webi.prog.abap @@ -179,6 +179,11 @@ CLASS lcl_object_webi IMPLEMENTATION. METHOD handle_function. + CONSTANTS: BEGIN OF co_parameter_type, + import TYPE vepparamtype VALUE 'I', + export TYPE vepparamtype VALUE 'O', + END OF co_parameter_type. + DATA: li_parameter TYPE REF TO if_ws_md_vif_param, li_soap TYPE REF TO if_ws_md_soap_ext_func, li_fault TYPE REF TO if_ws_md_vif_fault, @@ -205,16 +210,22 @@ CLASS lcl_object_webi IMPLEMENTATION. LOOP AT is_webi-pvepparameter ASSIGNING WHERE function = -function. + CASE -vepparamtype. - WHEN 'I'. + WHEN co_parameter_type-import. + li_parameter = li_function->create_incoming_parameter( -vepparam ). - WHEN 'E'. + + WHEN co_parameter_type-export. + li_parameter = li_function->create_outgoing_parameter( -vepparam ). + WHEN OTHERS. ASSERT 0 = 1. ENDCASE. + li_parameter->set_name_mapped_to( -mappedname ). li_parameter->set_is_exposed( -is_exposed ). li_parameter->set_is_optional( -is_optional ).