cancel
Showing results for 
Search instead for 
Did you mean: 

Decoding in BSP

Former Member
0 Kudos

Hi

I am passing a encoding parameter into BSP using java.net.URLencoder class.

How to decode the parameter in BSP which is encoded in java using java encoder class.

Regards,

puneet aggarwal

Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Depending upon how you read this parameter, the runtime might be decoding it for you. However if you need to do this manually have a look at:

Class CL_HTTP_UTILITY Method DECODE_BASE64 and ENCODE_BASE64

Former Member
0 Kudos

I am using the code as

l_fname = request->get_form_field( name = '<b>UserID</b>' ).

clear l_bpartner.

call function 'Z_CRM_BP_GETNUMBER'

exporting

lv_username = l_fname

importing

lv_bpartner = l_bpartner.

if l_bpartner is not initial.

l_fname = l_bpartner.

exit.

endif.

In this case I am passing the UserId as java encoded parameter.

Can you please send me the code for how to convert it into BSP in decoded form.

Thanks

Puneet Aggarwal

athavanraja
Active Contributor
0 Kudos

data: userid type string .

l_fname = request->get_form_field( name = 'UserID' ).

userid = cl_http_utility=>if_http_utility~decode_base64( encoded = l_fname ).

clear l_bpartner.

call function 'Z_CRM_BP_GETNUMBER'

exporting

lv_username = <b>userid</b>

importing

lv_bpartner = l_bpartner.

if l_bpartner is not initial.

l_fname = l_bpartner.

Regards

Raja