Encode and decode password and give Error Message in Odata services
Data: ls_header TYPE ihttpnvp,
ls_header-name = 'lgErCde'.
/iwbep/if_mgw_conv_srv_runtime~set_header( ls_header ).
"Decode old Pwd
CALL METHOD cl_http_utility=>decode_base64
EXPORTING
encoded = ls_request_input_data-oldpwd
RECEIVING
decoded = lv_old_decd.
lv_old_pwd = lv_old_decd.
"Decode new Pwd
CALL METHOD cl_http_utility=>decode_base64
EXPORTING
encoded = ls_request_input_data-newpwd
RECEIVING
decoded = lv_new_decd.
lv_new_pwd = lv_new_decd.
ls_header-name = 'Status'.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO ls_header-value.
/iwbep/if_mgw_conv_srv_runtime~set_header( ls_header ).
ls_header-name = 'lgErCde'.
ls_header-value = 'X'.
/iwbep/if_mgw_conv_srv_runtime~set_header( ls_header ).
ls_header-name = 'lgErCde'.
/iwbep/if_mgw_conv_srv_runtime~set_header( ls_header ).
"Decode old Pwd
CALL METHOD cl_http_utility=>decode_base64
EXPORTING
encoded = ls_request_input_data-oldpwd
RECEIVING
decoded = lv_old_decd.
lv_old_pwd = lv_old_decd.
"Decode new Pwd
CALL METHOD cl_http_utility=>decode_base64
EXPORTING
encoded = ls_request_input_data-newpwd
RECEIVING
decoded = lv_new_decd.
lv_new_pwd = lv_new_decd.
ls_header-name = 'Status'.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO ls_header-value.
/iwbep/if_mgw_conv_srv_runtime~set_header( ls_header ).
ls_header-name = 'lgErCde'.
ls_header-value = 'X'.
/iwbep/if_mgw_conv_srv_runtime~set_header( ls_header ).
Comments
Post a Comment