Addition of fields in Adobe forms using JavaScript or FormCalc

Hi All,
I have a few amount fields in my Adobe form. I want to calculate their sum and show it in another textfield. Any ideas how this is done using JavaScript or FormCalc.???
Thanks and Regards,
Sameer

Hi Sameer,
you cant use JavaScript here in Web Dynpro. But if you want to calculate the sum through a button click that can be done through the Action Handler method.
Suppose you have 2 fields to add whichare field1 and filed2 in the context tree and the sum will be shown in field3 of context tree - all of numeric data type - obviously. So you can do the following in the action handler method.
int sum = wdContext.currentContextElement().getField1() +
          wdContext.currentContextElement().getField2();
wdContext.currentContextElement().setFields3(sum);
Regards,
Shubhadip

Similar Messages

  • Problems!:  calculated fields in Adobe Forms using the ISR/PCR framework.

    Hi there,
    I have made an Adobe form in the ISR framework. Everybody who is familiar with these forms in the framework knows that the adobe form is embedded in a standard webdynpro which consist of a roadmap with three steps.
    Step 1: Fill out the form
    Step 2: Check and fill the form
    Step 3: Submit the form. After submit the form can be send to a manager or can be directly processed in SAP HR.
    Problem 1:
    When I test the adobe form and fill in a number in a field and click on next everything goes fine. But when I click on previous step the value which I filled in before is gone and put to 0,00.
    Problem 2:
    Also another problem is that calculated fields, do not show directly when clicking on next step. When you click on next step and then previous step, then you see the value of the calculated field.
    Problem 3:
    Also another problem is with the calendar function. When I fill in a date by hand and click on next the BADI behind the form sees 00-00-0000. When I use the calendar function everything goes well.
    Who can help me with these 3 problems.
    Greetings.
    Message was edited by: Sandhya Banwarie

    Hi Phil,
       Interesting - I have a similar issue.  We want to use the Request for Transfer scenario in ERP 2005, but it has not been developed in Adobe forms by SAP yet (it isn't available in 2004 either)!  So, we have decided to use the old JSP PCRs instead.
    Your issue is probably because you're using the same 2005 iviews to create your PCRs.  The 2005 PCR iviews are written in WebDynpro, and appear to assume that each one will be an Adobe form!  If you assign the old PCR iviews to your manager (give them the old MSS role under Migrated Content->EP5.0... in the pcd if you have it installed), you will be able to create a PCR with the JSP forms (regardless of the "Entry in Web" setting in QISRSCENARIO).
    The next issue is the approval.  In 2005, transaction SWFVISU has task TS50000075 configured as Java Webdynpro.  You'll need to change that to iView, and specify ID = com.sap.pct.hcm.isrdispatcher.default.  I'm following the UWL item type guide for this at:
    http://help.sap.com/saphelp_nw04s/helpdata/en/b1/cc1357eead454bb144face4a66be7d/content.htm
    Having said this, my approval is not working!  The item type has clearly changed, because the workitem name is no longer a hyperlink (rather annoying), but when I hit the "Launch Task Page" button (default name I think) I get the error:
    "Unable to perform action because the system returned an invalid URL"
    I can't see this "invalid url" anywhere in the logs, so I can't see where it is getting it from, or what path, etc I'm meant to put!  In your old system, what did you have as the "Server for ISR call" under "Additional Data for Scenario" in QISRSCENARIO?  Also, what did you have in the "URL" box that appears under the Additional Data for Scenario button when you change the Entry Type to JSP?
    Many thanks,
    Russell.

  • Date Calculation in Adobe Forms using Javscript or Formcalc

    Hi,
    We are designing a Form where a date is used to calculate the Financial  year and Quarter.
    For ex: if the document date is 9-Mar-2015 then the financial year is 2014-15 and the quater is 4th Quarter. (ie) the financial is is from July(curr.year) until June (next year)
    So the form should show the data as:
    For Finyear 2014-15: 3rd Quarter
    In the Form design, I've the Document date as FloatingField  and  have the financial year and quarter as calculated using Javascript.
    For this I want to have the below logic in the form::initialize event for the datefield as below.
    But am not sure about the date functions for getting the fullyear and month.  I need some help wrt to scripting for the below logic.
    var year1, year2
    var Qaurter
    var date1
    var month
    date1 = This.rawvalue
    month = date1.Getfullmonth()
    year1 = date1.Getfullyear()
    if (month <=6)
    then
         year2 = year1 -1
    Txtfinyear.rawvalue = Concat (year2, "-",year1)
    else
    year2 = year1 +1
    Txtfinyear.rawvalye = Concat(Year1, "-" year2)
    endif.
    If (mnth >= and mnth <=8)
      then
    txtquarter.rawvalue = "1st"
    Similar code for other quarters:
    Am attaching the screenshot for the design.
    Thanks much in advance for your help
    Best Regards,
    Maithili

    Hi Sameer,
    you cant use JavaScript here in Web Dynpro. But if you want to calculate the sum through a button click that can be done through the Action Handler method.
    Suppose you have 2 fields to add whichare field1 and filed2 in the context tree and the sum will be shown in field3 of context tree - all of numeric data type - obviously. So you can do the following in the action handler method.
    int sum = wdContext.currentContextElement().getField1() +
              wdContext.currentContextElement().getField2();
    wdContext.currentContextElement().setFields3(sum);
    Regards,
    Shubhadip

  • Making selective fields editable in adobe form [using web dynpro]

    Hi,
    I have displayed an adobe form using web dynpro application. But I have to make certain fields (not all fields) on this adobe form editable. I dont want to make this adobe form interactive because I dont have to save any data in database. The data entered in the editable fields will be saved as a pdf.
    What I did so far:
    1) The fields which I want as editable,  I have given there type as "User entered/ optional" & for rest of the fields I have given type as "Read only".
    2) In web dynpro, I have enabled the adobe
    3) This is not making the fields editable.
    4) If I write the following code in my webdynpro method WDDOMODIFYVIEW, then my data coming from adobe is not getting displayed even though the fields get selectively editable.
    *data: LR_INTERACTIVE_FORM type ref to CL_WD_INTERACTIVE_FORM,
    *LR_METHOD_HANDLER type ref to IF_WD_IACTIVE_FORM_METHOD_HNDL.
    *check first_time = abap_true.
    *LR_INTERACTIVE_FORM ?= VIEW->GET_ELEMENT('adobe').
    *LR_METHOD_HANDLER ?= LR_INTERACTIVE_FORM->_METHOD_HANDLER.
    *LR_METHOD_HANDLER->SET_LEGACY_EDITING_ENABLED( abap_true ).
    Any inputs regarding this??
    Thanks & Regards.

    Hi,
    Like I had mentioned using the following code in my webdynpro method WDDOMODIFYVIEW, my data coming from adobe form was not getting displayed even though the fields get selectively editable.
    *data: LR_INTERACTIVE_FORM type ref to CL_WD_INTERACTIVE_FORM,
    *LR_METHOD_HANDLER type ref to IF_WD_IACTIVE_FORM_METHOD_HNDL.
    *check first_time = abap_true.
    *LR_INTERACTIVE_FORM ?= VIEW->GET_ELEMENT('adobe').
    *LR_METHOD_HANDLER ?= LR_INTERACTIVE_FORM->_METHOD_HANDLER.
    *LR_METHOD_HANDLER->SET_LEGACY_EDITING_ENABLED( abap_true ).
    So I kept this code & I also kept the Interface type "ABAP Dictionary based".
    Additionally in Webdynpro, I used adobe form generated FM to get the adobe content & passed it to the "content" parameter of my adobe component in webdynpro.
    Thanks & Regards.

  • How to seperate current page fields in a pdf form using javascript

    Hi,
    Is that possible to seperate current page fields(textbox, Chesckbox) in a pdf form using javascript.
    I have coding to get all the fields in a pdf form. But i want to take CURRENT PAGE alone.
    Please help me out.
    Thanks and regards,
    Christy

    Hi try67,
    Thanks for your support.
    I got the result.
    Thanks and Regards,
    Christy

  • Set "peoples or groups" field with current user "login name" in sharepoint list form using javascript

    hi friends
    i am trying to set peoples or groups field in sharepoint  list form with current user login name
    here my code
    <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.js"></script>
    <script type="text/javascript">
    $(document).ready(function NewItemView () {
    var currentUser;
        if (SP.ClientContext != null) {
          SP.SOD.executeOrDelayUntilScriptLoaded(getCurrentUser, 'SP.js');
        else {
          SP.SOD.executeFunc('sp.js', null, getCurrentUser);
        function getCurrentUser() {
          var context = new SP.ClientContext.get_current();
          var web = context.get_web();
          currentUser = web.get_currentUser();
          context.load(currentUser);
          context.executeQueryAsync(onSuccessMethod, onRequestFail);
        function onSuccessMethod(sender, args) {
          var account = currentUser.get_loginName();
          var accountEmail = currentUser.get_email();
          var currentUserAccount = account.substring(account.indexOf("|") + 1);
        SetAndResolvePeoplePicker("requester",account);
    // This function runs if the executeQueryAsync call fails.
        function onRequestFail(sender, args) {
          alert('request failed' + args.get_message() + '\n' + args.get_stackTrace());
     function SetAndResolvePeoplePicker(fieldName, userAccountName) {
       var controlName = fieldName;
        var peoplePickerDiv = $("[id$='ClientPeoplePicker'][title='" + controlName + "']");
        var peoplePickerEditor = peoplePickerDiv.find("[title='" + controlName + "']");
        var spPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplePickerDiv[0].id];
        peoplePickerEditor.val(userAccountName);
        spPeoplePicker.AddUnresolvedUserFromEditor(true);
    </script>
    but it is not working
    please help me

    Hi,
    According to your post, my understanding is that you wanted to set "peoples or groups" field with current user "login name" in SharePoint list form using JavaScript.
    To set "peoples or groups" field with current user "login name”,  you can use the below code:
    <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.js"></script>
    <script type="text/javascript">
    function SetPickerValue(pickerid, key, dispval) {
    var xml = '<Entities Append="False" Error="" Separator=";" MaxHeight="3">';
    xml = xml + PreparePickerEntityXml(key, dispval);
    xml = xml + '</Entities>';
    EntityEditorCallback(xml, pickerid, true);
    function PreparePickerEntityXml(key, dispval) {
    return '<Entity Key="' + key + '" DisplayText="' + dispval + '" IsResolved="True" Description="' + key + '"><MultipleMatches /></Entity>';
    function GetCurrentUserAndInsertIntoUserField() {
    var context = new SP.ClientContext.get_current();
    var web = context.get_web();
    this._currentUser = web.get_currentUser();
    context.load(this._currentUser);
    context.executeQueryAsync(Function.createDelegate(this, this.onSuccess),
    Function.createDelegate(this, this.onFailure));
    function onSuccess(sender, args) {
    SetPickerValue('ctl00_m_g_99f3303a_dffa_4436_8bfa_3511d9ffddc0_ctl00_ctl05_ctl01_ctl00_ctl00_ctl04_ctl00_ctl00_UserField', this._currentUser.get_loginName(),
    this._currentUser.get_title());
    function onFaiure(sender, args) {
    alert(args.get_message() + ' ' + args.get_stackTrace());
    ExecuteOrDelayUntilScriptLoaded(GetCurrentUserAndInsertIntoUserField, "sp.js");
    </script>
    More information:
    http://alexeybbb.blogspot.com/2012/10/sharepoint-set-peoplepicker-via-js.html
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How to make a field in adobe form noneditable

    how to make a field in adobe form noneditable. like info keys..
    when this form is sent through worflow the receiver shudnt be able make changes to the field value...(I have a form, which has fields prefilled(like pernr employee name) but these fields are in editable able..(i want only some fields to be uneditable not all)
    Edited by: kumar gaurav on Apr 11, 2008 8:04 AM

    Hi,
    You can make fields non-editable at runtime using this code:
    field.access = "readOnly"
    Hope this helps.
    Amit

  • Create Adobe Form using Design Time for Processes and Forms

    Hi all,
    I am trying to create a form that have 3 fields:
    1. pernr
    2. ename
    3. effective_date
    I done all the necessary setup of BADI ,class, interface and form.
    I need the step to step guide where you create the adobe form using the Design Time for Processes and Forms. Anyone have any idea?
    Edited by: Siong Chao on Jan 3, 2011 4:54 AM
    Edited by: Siong Chao on Jan 3, 2011 5:00 AM

    Hi,
    I couldn't get to your query..
    What do you mean by step by step procedure for a design time & process for forms.
    if you are a beginner and looking for basic examples to implement adobe forms there are lot of them in SDN, please search them.
    let me know if your query was a very specific one.
    Cheers,
    Sai

  • Hide a row or field in adobe form

    Hi guys,
    Can any one suggest me how to hide a field in adobe form.
    My scenario is:
    Using control levels for deliveries with item data, if the item line is only one, then I should not display any subtotal field, if item lines are more than one, only then i need to display subtotal field in adobe form.
    Subtotals are maintained at item level not at the page level.
    Can any provide solution with scripting.
    Thanks.
    RP.

    One way is have some variable which tells how many rows of data is present. Check it and then make subtotal
    visible or hidden. The script will be like below.
    if (rownum.rawValue == 1) then
    this.presence = 'hidden'
    else
    this.presence = 'visible'
    endif
    Thanks,
    Aravind

  • Setting a Text field in adobe form non editable

    Hi Experts,
    I have generated a Adobe form using webdynpro java. I have  couple text fields. They are binded with some values which a RFC returns. When I see the output These text fiels values which are populated from backend are editable. Can anyone suggest me how to make these text fields non editable.
    Thanks,
    Raj

    Hi Raj,
    You have to set the properties of these text field as readonly.
    For this you have to select the text field ... Go to the Object Pallete.
    There you will see three Tabs Field, Value and Binding.
    You have to click on Value Tab  and there you have select the Type as Read Only.
    If you do not have Object Pallet open .. go to Menu Bar Window and Click Object
    This will solve your problem.
    Cheers
    Satya

  • How to make Mandatory field in adobe form

    Hi Experts,
              I have a text field in adobe form,.If user could not interact this form, without filling the text field..can you please give me the suggestion?
    Thanks,
    Hans

    Hi,
    Write the following script at the exit event of your text field.
    if ( $.rawValue == null )
    then
    $host.messageBox("Please Enter Value")
    $host.setFocus("TextField1");
    endif
    Here TextField1 is the name of the text field.
    Regards,
    Vaibhav Tiwari.

  • Why can I no longer fill in additional information on my adobe forms on pdf. At time this was an opposition. It will only allow me to type limited information?

    Acrobat Reader
    Why can I no longer fill in additional information on my adobe forms on pdf. At one time you could insert an icon that would allow you to type in additional information. It will only allow me to put in limited information?

    Not a lot of information. Can you post a link to a sample of the form so others can see the how the form does not work.

  • ADOBE FORMS using Webservice

    Hi Experts,
    I have a problem with Adobe Forms Using webservice.  I created  RFC where it saves data from Adobe Forms to a customized table and exposed it as webservice.  From the SOA manager, I copied the generated link pasted in the dataconnection in Adobe Lifecycle designer, but whenever I generate the form I keep receiving this error:
    "http:// erpwrk1.corp.com:8000/sap/bc/srt/wsdl/bndg_DFA46DE60CFOD33F19F21005056C00008/wsdl11/allinone/ws_policy/document?sap-client=001".  Check that the path is correct and that the file is a valid wsdl file.
    I already activated services from SICF in relation SOAP runtime.   What could be the cause of the problem and how to fix the problem?
    Thanks A Lot!
    Mae

    Hi Ma. Angelica A. Estacio,
    From the SOA manager, I copied the generated link pasted in the dataconnection in Adobe Lifecycle designer, but whenever I generate the form I keep receiving this error:  Check that the path is correct and that the file is a valid wsdl file and hence i cannot finish the data connection wizard.
    From the above posts, it looks like you have resolved the issue. But can you please let me know how did you resolve it ?
    Did you check any SAP transaction to find the above mentioned checkbox?
    Please revert as this has become critical now.
    You can mail me your response on [email protected]
    Regards,
    Rohit Gugale

  • Adobe Form used by more than one user simultaneously

    Friends,
    I am working on an online interactive Adobe form using Web Dynpro ABAP.
    once the user enters the data and clicks the submit button, the data is sent to ztables.
    the scenario is that more than one user can possibly use the same form simultaneously. in that case, how can i maintain synchronization ie how to avoid multiple users from using the form at the same time, when the form is already being filled by one user already.
    I am guessing i have to do something with ADS for this.
    Any thoughts or ideas would be greatly appreciated.
    Thanks and Regards.

    Hi Bertrand,
    The purpose of allowing only one user is to ensure data consistency as you have guessed.
    Is there a program name or transaction code where i can look up the lock entries and see if i can apply them to my web dynpro application or the adobe form.
    I would greatly appreciate your help.
    Thanks and Regards.

  • Drop Downs in adobe forms using Web dynpro ABAP

    Hi all,
    Im new to this adobe forms using webdynpro abap.
    In my requirement i have two drop downs on the form.
    by selecting value in one drop down i have to fill corresponding values in the other drop down.
    Using only WDA i know how to do this but with adobe i dnt know how and where i have
    to catch the drop down value and write my code. please let me know how i can achieve this.
    one more thing whatever action or events we are performing on the form where we have to place our code for this?
    Thanks,
    santosh

    hope this helps -
    [Thread: Populating one Drop-Down list from the selection of another Drop-down list |Populating one Drop-Down list from the selection of another Drop-down list;

Maybe you are looking for

  • Why aren't MacBook Pro's offered in white or black?

    I don't mean to offend anyone but I'm SO SICK of ugly grey/silver notebooks I could scream! Silver or metal...however you want to describe it is NOT hi tech looking...it's cheap and tacky! Why doesn't Apple offer the MacBook Pro's in Black and white

  • C# - Acrobat 9.4.5 - PrintPages not responsive

    I've been stuck on an issue for a month or so, and running out of ideas. I'm trying to use the Acrobat API's "PrintPages" method to print a PDF document. I'm able to load the PDFs in my WinForm just fine, populate their fields, etc. But whenever I in

  • PPOME - Org.Unit (Acount assignment) goes into DUMP

    Hello Gurus, ive got a Big issue, concerning SAP HR module. When we start the TC: PPOME we select org.unit from the structure. It is beeing showed normaly, but only when we select Acount assignment it goes straight into DUMP, saying: Runtime Errors  

  • Page Flow and Java Control interaction

    Hi everybody ! Even after to read some documents like http://dev2dev.bea.com/pub/a/2004/06/wlw_internals.html and http://dev2dev.bea.com/pub/a/2004/01/jones.html i still didn't get what is really happening "behind the scenes" between Page Flows and J

  • Explian value mapping with a scenario.

    Hello Guru's,      I have seen the material which defines VALUE MAPPING and VALUE MAPPING GROUP. But i am not able to implement in the scenario. ( please don't  ask which secnario )      Can any one please give me the scenario which uses VALUE MAPPIN