Hi Ruchi,
Please use String token function seperated by &. You will get 5 tokens and replace the value #x2a with using strcat function. Send it final value.
For ex:
SAP SID original value =R*VV7H*UArFQjcVf*ZGhPA--Z1JulYFN4Lh23ChZeO53*w--
You have to send R*VV7H*UArFQjcVf*ZGhPA--Z1JulYFN4Lh23ChZeO53*w--
first you need capture original value like
1)web_reg_save_param("SAPSID_1","LB=XXXX","RB=XXXX",LAST);
2)Print that value
3)lr_output_message("SAPSID_1 value= %S",lr_eval_string("{SAPSID_1}");
4)Create seperate action called Convertcode
5)There you need to use string token in a Convertcode action.
Convertcode(char* inputstr, char* outputStr)
{
extern char* strtok(char* string, const char* delimiters ); // Explicit declaration
char* path;
char separators[] = "&";
char* token;
char p_tmp[1024];
char temp[1024];
char final[1024];
path = inputstr;
token = (char *)strtok(path, separators); // Get the first token
if (!token) {
lr_output_message("No tokens found in string!");
return( -1 );
}
lr_output_message("%s", token);
strcpy(final, token);
while (token != NULL )
{ // While valid tokens are returned
lr_output_message("%s", token);
token = (char *)strtok(NULL, separators); // Get the next token
if (token != NULL)
{
p_tmp[0] = 0;
lr_output_message("tmp value is: %s", p_tmp);
strncpy(p_tmp, token, 5);
lr_output_message("unicode value is: %s", p_tmp);
if (strncmp(p_tmp,"#x2a;", 5) == 0)
{
strcat(final, "*");
}
strcpy(temp, token + 5);
strcat(final, temp);
}
lr_output_message("%s", final);
}
lr_output_message("%s", final);
lr_save_string(final,outputStr);
return 0;
}
6) Just call this function in your script
Convertcode(lr_eval_string("{SAPSID_1}"), "SAPSID_Convertedvalue");
lr_output_message("SAPSID_Convertedvalue = %s",lr_eval_string("{SAPSID_Convertedvalue}"));
7)Replace this Parameter {SAPSID_Convertedvalue} in your script.
If you follow my steps, I am sure definitely you will find a solution. Still if you have any problems please let me know.
Thanks,
Dinesh Kumar
Dinesh Reddy