cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding scripts in Adobe Form

Former Member
0 Kudos

Hi Experts,

I am working on creating a Search help on Adobe Offline Forms, If anyone of you can just provide me some inputs on how to convert a string like

a* to a%

a** to a%

What i actually want is to convert any consecutive number of "*" to "%".

Please provide your inputs on this..

Thanks,

Amita

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks,

Amita

chintan_virani
Active Contributor
0 Kudos

Bad way of closing the thread. Please close the thread with proper comments as to which solution helped you close the question.

Former Member
0 Kudos

Hi Amita,

Try this in FormCalc,

Replace(s1, s2 [, s3 ] ) - Replaces all occurrences of one string with another within a specified string.

 
String.replace(s1, s2)

Thanks.

Best regards,

Xiang Li

Former Member
0 Kudos

Hi Amita,

If you are performing the code change in Adobe Form then use the following code in the respective event:

( Reference: http://www.w3schools.com/jsref/jsref_replace.asp )


var str="Welcome to SAP";
str.replace(/SAP/g, "SAP IFbA"); //here "g" is used for Global Search; for more information please refer the link

If you are performing the code change in ABAP then follow the below and build your logic:

( Reference: F1 Help in ABAP Workbench for keyword REPLACE )


DATA: text1 TYPE string, 
      text2(18) TYPE c, 
      cnt TYPE i, 
      off TYPE i, 
      len TYPE i. 

text1 = text2 = 'I know you know'. 

REPLACE ALL OCCURRENCES OF 'know' IN: 
        text1 WITH 'should know that' 
              REPLACEMENT COUNT  cnt 
              REPLACEMENT OFFSET off 
              REPLACEMENT LENGTH len, 
        text2 WITH 'should know that' 
              REPLACEMENT COUNT  cnt 
              REPLACEMENT OFFSET off 
              REPLACEMENT LENGTH len. 

Regards

Pradeep Goli