Scripting in Adobe Forms - Hiding a field

Hi Experts
I have some code that I just can't get to work - please advise where I am going wrong.
Looking at the folowing code segment (Javascript, at Client), I am running through a loop of items (PO Text Items). If I take the IF statement out around the statement where I hide the fields, it works well (in other words it hides every line), but I only want to hide lines where the item (ItemTextFromPO) is empty.
var oFields = xfa.resolveNodes("data.PO_Page.MainSubform.ItemSubForm.POItemText.DATA[*].ItemTextFromPO");
var nNodesLength = oFields.length;
for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++)
     if ( xxxxxxxxxxxx.rawValue == "" )
          oFields.item(nNodeCount).presence = "hidden";
Please advise what I need to use in the IF statement to make it work?
Thanks
Casper

Hi Chintan
I know there is no index currently in the if statement - and that is my problem.
I am getting a table of texts for PO Items passed into a form. Some items may have more than one text item, and some may have none. For those with none, it will still have a dummy entry - i.e. a table entry with nothing next to it. A table might look like this:
0010     Text for item 10
0010     More text for item 10
0020
0030     Text for item 30.
So, Item 20 above has no text (an empty text line).
In the form, I have a repeating subform -  it repeats once for evry item. On this subform, I have an textfield called that can repeat many times, if necessary (like for Item 10 above in this example). In the context of the form, I have a where condition that linke the item texts to the items - in other words the texts appear with the correct items already.
However, I do not want anything to appear if the field is empty (like for line 20, in this example).
So, I have written the loop as you saw in my original question. This loop works - if I take the IF statement out, then it hides EVERY line. If I do not use a loop, it only hides the 1st line... so the loop is required.
I then need to 'ask' each item with the IF statement whether it is empty or not - and if it is, then hide it. So, I just need someone to tell me the correct syntax for the xxxxxxxxxxxxx in my IF statement. This should surely include the index (the counter of the loop) somehow, so that I can access each individual item.
I have tried many combinations, but none worked - so far.
Please let me know if I need to explain more.
Thanks,
Casper

Similar Messages

  • Scripting in ADOBE forms

    Hi,
    I need information regarding scripting in adobe forms.
    please help me out.
    Thanks And Regards
    Shruti

    Hi,
    for hiding the fields go thru this link.........
    Adobe Form Fields Visibility
    Regards,

  • Condition verification in java script on Adobe form.

    Hello Experts,
    I am using a interactive forma text element on my view. (java web dynpro)
    It's a simple application. I am trying to figure out how it works with java script.
    I have a text field. which displays employ is sales or production dept
    the values in the data view and its the output element of a BAPI which returns XF,TF,HF and XK,JK,HK
    (record.dept)
    if its XF, TF, HF on the text field in the adobe form should print sales else production.
    I have never used java script on adobe form.
    I figured the strip above the form in adobe designer is used for java script.
    can any one, let me know how I can manipulate.  the record value
    Here is what I am trying record.dept = XF |TF|JF . but i dont know how to run the java script or its syntax.
    Your help is highly appreciated.

    James,
    xfa.host.messageBox should show you an alert dialog box to check data you are getting.
    And yes you are right. You can set the value of textfield using code you mentioned.
    if(record.dept.equalsIgnoreCase("XF")
                 || record.dept.equalsIgnoreCase("TF")
                          record.dept.equalsIgnoreCase("JF"))
       xfa.host.messageBox("The value is Sales");
       <Text-field id>.value = "Sales";
    else
       xfa.host.messageBox("The value is Production");
      <Text-field id>.value = "Production";
    You can even set the texfields to be readOnly, hide some of them etc. But for that I would suggest you going thru the LiveDesigner help. It would solve most of your doubts :-).
    Chintan
    Edited by: Chintan Virani on Feb 19, 2008 3:37 PM

  • Adobe Forms wo/Interactive Fields Completed in Workspaces?

    Can I complete an Adobe form without interactive fields in Workspaces?  If so, how?

    Unfortunately, there is no way to do this within Workspaces.

  • Migrating SAP Scripts to Adobe Forms

    Hi All,
       We are going for a new Rollout in US based on our European implementation in 2001 which was on
       4.6b. Eventually this system was upgrated to ECC 6.0 recently however all the outputs are still using
       SAP Scripts.
       For the new Rollout in the US, we are planning to migrate all these outputs to Adobe Forms. Does
       anyone know if there is an easy way to migrate Scripts to Adobe Forms or else the  migration is more
       or less like fresh development.
       Please share your experiences/knowledge if anyone has worked similarly. Thank you all.
    Regards,
    Vamsee

    Hi,
    migration from script to adobe is a big problem.
    dont go for that.
    many problems will come after migration, the time to take rectification is more than the development directly.
    Thank U
    Jay----

  • How to Migrate SAP Scripts to Adobe form

    Hi,
    Can yo uplease tell me step by step how to convert/migrate SAP Script to Adobe forms.
    Thanks,
    Rajeev Gupta

    Hi
    Transforming SAP Scripts - > Smartform -> Adobe Forms is the right way.
    refer this thread...
    [Re: Convert SAP Scripts to Adobe PDF Forms|Re: Convert SAP Scripts to Adobe PDF Forms]
    Regards
    Raj
    Edited by: Rajasekhar Dinavahi on Dec 9, 2008 5:25 AM

  • Adobe form hiding fields stopped suddendly

    Hi All,
    I had made the sub form as flowed and written the below script in docready event in order to move other fields up if it do not have a value.
    if(this.rawValue == null) 
    this.presence = "hidden"; 
    This was working and it is working for the fields which are in the content area. But it suddendly stopped working.
    Thanks in advance.

    Hi!
    There might be a number of reasons for such behavior. First of all, check for the latest versions of Adobe form. If there were recent changes it might be e.g. some other script which is incorrect and your script fails to run. A simple test for scripts is going to "Preview PDF" tab on Format page. If any error popups - check the corresponding script. It's the first point I start from while having script troubles.
    If Adobe form wasn't changed, I would still check whether this script runs. If this issue can be reproduced in DEV / TEST systems, you can make any kind of debug printing or popup to be sure that IF-condition is fulfilled. If it's ok, have a closer look at the form elements, if not - check the data coming from the outside.

  • How to Debug Java Script in Adobe Form

    I have used an alert for empty fields . I have used Check button control for this.
    But the button click is very inconsistent. Some times it triggers the event sometimes it doesnt. Is there anyway to debug the java script. I have installed Script editor for IE but I am unable to use it for Adobe Forms.
    Any help is appreciated.
    Thanks,
    Vasu

    Hi Vasu,
    i think that maybe is the check sequence is not very correct.. and maybe you can try to code it one check for empty fields at a time..
    example
    Name.
    Address.
    Tel.
    Hp.
    Email.
    so u can try to code for one item at a time then slow try to debug it... as last time i use to insert the javascript inside each component then after it i implement into a button and slowly check for the check sequence which one need to be 1st and etc.
    hope it help you. if not maybe u can give more information. maybe i can help you out at myside.
    Regard,
    Ng Jia Jun

  • Script, , smartforms , adobe forms

    hi friends,
                       i know about script and smartforms,
                       can you clearly tell about adobe forms(pdf)
                       what, where , why ?
    thanks

    Hi,
    t.code SFP.
    definition:
    Interactive Forms based on Adobe software is SAP's new solution for forms development. Its first release has the focus on interactive use of forms. High-volume printing is supported in principle, but - being a new solution - the performance has not yet reached the same level as Smart Forms or SAPscript, two established solutions that had years to grow. Interactive Forms is the only solution that will continue to be enhanced with new features, while SAPscript and Smart Forms will be supported without limitations.
    When (or if) to move to Interactive Forms depends on your requirements. For interactive forms usage, i.e. the new functions, you have no choice, as the existing solutions don't support it. High-volume print scenarios need to be carefully analyzed to see whether your concrete requirements can be met at this point.
    However, it is possible to move to Smart Forms and design your forms in such a way that a migration at any point in the future would be but a small step. Smart Forms offers from Web AS 6.40 a migration wizard to Interactive Forms. Technically, everything can be migrated, but we recommend against things like ABAP program nodes, for example.
    You are not forced to ever go to Interactive Forms if you don't want to. It really depends on whether your client needs any of the new features in Interactive Forms. Also, if they are currently working with JetForms, they could enquire with Adobe directly what migration path they offer to the joint solution.
    go thru this links
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/4a94696de6429cada345c12098b009/frameset.htm
    example
    To get an overview idea about Adobe forms ,
    Using SFP , first you need to create a interface . in interface you can declare the import and export parameters and also the declaration part, coding etc : This is nothing but similar to Function module interface.
    And now we have to create the Form which is interactive. Create the form and enter the interface name which you have created in first step, so that the parameters , declarations of fields etc : will be copied and available in the form layout. So that you can drag and drop these declared fields ( dclared fields of interface ) to the layout.
    Create the context and layout in the form.
    The layout generated can be previewed and saved as PDF output.
    Now we need to integrate the driver program and the PDF form to get the final output as per the requirement.
    On activating and executing the form you will get a function module name just similar to smartforms.
    The driver program needs to call this FM.
    Refer to the below sample code :
    DATA : is_customer TYPE scustom.
    DATA : it_bookings TYPE ty_bookings.
    DATA : iv_image_url TYPE string.
    DATA : iv_sending_country TYPE adrc-country.
    DATA : it_sums TYPE TABLE OF flprice_t.
    DATA : docparams TYPE sfpdocparams.
    DATA : formoutput TYPE fpformoutput.
    DATA : outputparams TYPE sfpoutputparams.
    PARAMETERS : pa_cusid TYPE scustom-id.
    SELECT SINGLE * FROM scustom INTO is_customer
    WHERE id = pa_cusid.
    SELECT * FROM sbook
    INTO CORRESPONDING FIELDS OF TABLE it_bookings
    WHERE customid = pa_cusid.
    outputparams-nodialog = 'X'.
    outputparams-getpdf = 'X'.
    *outputparams-adstrlevel = '02'.
    CALL FUNCTION 'FP_JOB_OPEN'
    CHANGING
    ie_outputparams = outputparams
    EXCEPTIONS
    cancel = 1
    usage_error = 2
    system_error = 3
    internal_error = 4
    OTHERS = 5.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    docparams-langu = 'E'.
    docparams-country = 'US'.
    docparams-fillable = 'X'.
    CALL FUNCTION '/1BCDWB/SM00000043'
    EXPORTING
    /1bcdwb/docparams = docparams
    is_customer = is_customer
    it_bookings = it_bookings
    IV_IMAGE_URL =
    iv_sending_country = 'US'
    IT_SUMS =
    IMPORTING
    /1bcdwb/formoutput = formoutput
    EXCEPTIONS
    usage_error = 1
    system_error = 2
    internal_error = 3
    OTHERS = 4
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    CALL FUNCTION 'FP_JOB_CLOSE'
    IMPORTING
    E_RESULT =
    EXCEPTIONS
    usage_error = 1
    system_error = 2
    internal_error = 3
    OTHERS = 4
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Reward points
    Regards
    pc

  • Error when inserting Web Dynpro script in Adobe form

    Hi
    In my WD component in one of the view I have an ADOBE form (Online scenario) and a button to save data into backend. In the ADOBE form everything is working properly, however the problem is when I click on the button to save, Its not getting into my action code. Even I am not getting any error other than the wait symbol.
    In the form I have taken ZCI layout but when i'm inserting Webdynpro Script its showing an error 'Error when inserting Web Dynpro script'.
    Please let me know why this error is getting.
    Thanks
    Ram

    Hi Ram,
    I hope  you help me,
    I have the same error, when I insert a web Dynrp Script, what version of SAPGUI do you use?
    Thanks

  • Problem in Webdynpro and Adobe form with signature field

    Hi experts!
    I have a problem with Signature Field in Adobe Form showed in a Web Dynpro Abap.
    During the execution I fill the Signature field correctly but when I push any other button of the Webdynpro, the Adobe Form shows me the next error.
    After click OK, the webdynpro is hang and not respond.
    Any idea why not respond?
    Thanks.

    Hi friend,
    Its not like that the Adobe created using SFP is non interactive.
    We can create interactive forms using SFP transaction using java code.
    I think it will be the problem with ADS just check with your basis people i think they will configure you the settings which works fine.
    To check whether the settings are perfect you can try executing the standard programs FP_TEST_00 and
    FP_PDF_TEST_00. If it works fine then some other problem exists else check with your basis team.
    Just check this and revert me if you have any issues. I will help you
    Thanks,
    Sri Hari

  • Adobe form bulider - Image field

    Hi,
    I have a requirement where i have to pass URL for image field through interface
    and it should dispaly image.
    Now the problem is if i assign the URL directly it works but if i do a binding there it doesen't work may be i am not doing it in right way.
    Any clue.
    Thanks,
    Atul

    Dear Engineer Naguib,
    Please refer to the following post:
    [Adobe Forms and Dynamic Images]
    this.value.image.href = xfa.record.Images.URL;
    Replace "xfa.record.Images.URL" by "xfa.record." + path to URL attribute in data hierarchy.
    Regards,
    Motaz

  • SAP SCRIPT to Adobe form conversion SF_MIGRATE_FORM

      Hello Experts,
         Can you please let me know if can identify all the global variables in a script which are like this &T001-BUKRS& and add in the global parameters of the smartforms which can be inturn converted to Adobe forms,
          In the SF_MIGRATE_FORM I can see only p_form-->interface is filled with the import export and the exceptions.thanks,
    thanks,
    vijay.

    Sorry the FM name is FB_MIGRATE_FORM

  • Design Promissory note in spa script or adobe form

    Hi All,
    I want to generate the promisorry note to the client.
    Can anybody please let me know what is possiabilities like  script or smartform or adobe form to geenrate the Promissory note.
    Is tehre any standard form avaliable to generate the promissory note.What will the print program.
    Waht is the Procedure to generate the promissory note in FI.
    Thanks,
    Taragini

    Hello,
    There are some correspondence programs in FI that are used to generate customer/vendors statements and to send other types of letters to customers.
    Check F140* or F130* form or to one of the following programs: SAPF140, RFKORD, SAPF130*.
    If this is not the type of note you want to send to customers, please explain your requirement with more details and maybe we can help.
    REgards,
    Renan Correa

  • SAP Script,Smartforms,Adobe Forms

    Hi SDN Friends!
    I had this question.
    Given a SAP Script or SMART Form ... how do we identify (table names?)
    The Print program associated with them? Also, how does that concept differ from PDF forms?
    Any body can answer please........
    Regards,
    Markiv.C

    Hi
    In any Orgn in real time in SAP we use Sap scripts or Smartforms for sending Outgoing documents like Sales,Pur order to customer or vendor.
    So these are assigned with an Output type, Medium, Print  program
    These settings are configured first in Application document and in NACE Tcode
    accordingly an Entry is saved in NAST table and TNAPR tables
    so from these 2 tables we will come to know the form/sf name, print program and Output type and Medium etc
    <b>Reward points for useful Answers</b>
    Regards
    Anji

Maybe you are looking for

  • DOC BUG: 9.0.3.1 View Object Wizard and a Question

    First the question: What is the Passivate property for in the View Object Wizard's Attribute Settings page? Related Doc Bugs 9.0.3.1 Topic: Define New View Attribute Dialog (click Help button in New Attribute dialog when creating a view object attrib

  • Implementing A Group BY outside the database

    Guys, I have out today that I need to provide an implementation which allows dynamic Group by's to be proceessed in Java. I have looked at Hibernate but it does not support what I have in mind. Ideally I have a result set of 1000 rows (say). I need t

  • User Exits for  PP

    Dear All, Can  any one please provide me the list of user exits availble in PP Module, and their functions . Rgds, Vijay Mankar

  • MARS 6.1 and vulnerability scans

    Hey guys, I'm looking at getting the MARS 55 k9 6.1 and was wondering about the vulnerability scan tools in MARS. 1. Are there any? 2. What are they? 3. What are the scheduling options? If MARS 6.1 doesn't have anything native can it work with someth

  • I am getting an error message when I try to reinstall itunes (after I accidentally removed bonjour).

    When itunes is installing a window pops up that says service 'apple mobile device' failed to start.  Any ideas?