‎2008 Oct 27 7:23 PM
Hi,
I need to replace string contents in the internal table.
FM TEXT_SPLIT & SWA_STRING_SPLIT are not meeting my requirement.
<BSP_PROTCL>://<BSP_SERVER>/SAP/BW/BEX?BOOKMARK_ID=42QDVUFIFCOQ9O50UDSBMJUDO&VA
I need to replace code in between '=" and '&' each time
Any ideas?
Rgds
Praveen
‎2008 Oct 27 7:29 PM
You could of course use regex, but I am not really a fan of it. So here is a solution.
data: lv_source type string.
data: lv_first_part type string.
data: lv_second_part type string.
data: lv_third_part type string.
data: lv_target type string.
data: Lv_some_other_value type string.
lv_source = `<BSP_PROTCL>://<BSP_SERVER>/SAP/BW/BEX?BOOKMARK_ID=42QDVUFIFCOQ9O50UDSBMJUDO&VA`.
split lv_source at `=` into lv_first_part lv_second_part.
split lv_second_part at `&` into lv_second_part lv_third_part.
Lv_some_other_value = `BlahBlahBlah`.
CONCATENATE lv_first_part `=` lv_some_other_value `&` lv_third_part into lv_target.
write:/ lv_source.
write:/ lv_target.Regards,
Rich Heilman
‎2008 Oct 27 7:29 PM
You could of course use regex, but I am not really a fan of it. So here is a solution.
data: lv_source type string.
data: lv_first_part type string.
data: lv_second_part type string.
data: lv_third_part type string.
data: lv_target type string.
data: Lv_some_other_value type string.
lv_source = `<BSP_PROTCL>://<BSP_SERVER>/SAP/BW/BEX?BOOKMARK_ID=42QDVUFIFCOQ9O50UDSBMJUDO&VA`.
split lv_source at `=` into lv_first_part lv_second_part.
split lv_second_part at `&` into lv_second_part lv_third_part.
Lv_some_other_value = `BlahBlahBlah`.
CONCATENATE lv_first_part `=` lv_some_other_value `&` lv_third_part into lv_target.
write:/ lv_source.
write:/ lv_target.Regards,
Rich Heilman
‎2008 Oct 27 7:32 PM
looks like you want to read the url parameter , see the class CL_HTTP_ENTITY , method GET_FORM_FIELD logic.