Skip to content

Instantly share code, notes, and snippets.

@mbtools
Created March 17, 2021 09:26
Show Gist options
  • Save mbtools/136fb815f3a9662e7bd1d5335dcbe82c to your computer and use it in GitHub Desktop.
Save mbtools/136fb815f3a9662e7bd1d5335dcbe82c to your computer and use it in GitHub Desktop.
abapGit form parsing
REPORT zabapgit_parse_fields.
CONSTANTS:
c_query TYPE string VALUE 'key=00%2601&param=abc%3defg&value=xxx%3fyyy&option=%25%24123%5f'.
DATA:
gv_url TYPE string,
gs_fields TYPE ihttpnvp,
gt_fields TYPE tihttpnvp.
* ZCL_ABAPGIT_HTML_ACTION_UTILS
gt_fields = zcl_abapgit_html_action_utils=>parse_fields( c_query ).
LOOP AT gt_fields INTO gs_fields.
WRITE: / gs_fields-name, gs_fields-value.
ENDLOOP.
SKIP.
gt_fields = zcl_abapgit_html_action_utils=>parse_fields( to_upper( c_query ) ).
LOOP AT gt_fields INTO gs_fields.
WRITE: / gs_fields-name, gs_fields-value.
ENDLOOP.
SKIP.
* CL_HTTP_UTILITY
gt_fields = cl_http_utility=>string_to_fields( c_query ).
LOOP AT gt_fields INTO gs_fields.
WRITE: / gs_fields-name, gs_fields-value.
ENDLOOP.
SKIP.
gt_fields = cl_http_utility=>string_to_fields( to_upper( c_query ) ).
LOOP AT gt_fields INTO gs_fields.
WRITE: / gs_fields-name, gs_fields-value.
ENDLOOP.
SKIP.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment