Skip to Content
avatar image
Former Member

Regarding scripts in Adobe Form

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Sep 01, 2009 at 11:14 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 02, 2009 at 06:16 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 02, 2010 at 08:16 AM

    Thanks,

    Amita

    Add comment
    10|10000 characters needed characters exceeded