Close Sidebar close
Sapignite
  • SAP
  • Coding Challenges
  • Download
  • SAP Ignite Products

Subscribe & Follow

All product names on this web site are trademarks of the companies that own them. Sapignite.com is not affiliated with SAP AG in any way. SAP AG is the registered trademark holder of SAP, SAP R/3, mySAP, ABAP, xApps, NetWeaver, and other proprietary terms. The technical information on this site is verified to the greatest extent possible, however, any information found on this site is used at the site visitor's own risk. Sapignite.com reserves the right to correct any errors or omissions in any portion of this site at any time without obligation.

  • SAP
  • Coding Challenges
  • Download
  • SAP Ignite Products
Sapignite
Sapignite
    ABAP SAP Webdynpro For ABAP

    Make your adobeforms more interactive with Formcalc

    August 16, 2017

    The way Beauty is incomplete without brain!!!!!!!!

    Interactive form is incomplete without scripts.

    So let’s discuss the golden part of Interactive adobeforms.

    If you are still making V shape with your eyebrow that what I am talking about, let me tell you it’s a Java script/formcalc.

    In this article I will be covering how to fill color into input fields, simple mathematical operation, conditional statement and popup windows.

    If you don’t know the basic of interactive form and you have not created before kindly go through the how to create an interactive adobeforms.

    Before starting the formcalc function the important thing is “how to access the particular element”.

    Let’s say you have one input_no input field in your adobeform.

    And one submit button. To apply formcalc function on INPUT_NO you can use

    Input_no field as ADOBE_DATA.INPUT_NO (see the hierarchy view which gives you a clear idea)

    After wrapping it into subform it will be access like

    So starting with our first sample:

    1. How to fill the input field with a color.

      For this you can use a fill color attribute of the input field.

    See the blow screen shot (“Don’t worry about extra buttons simply remember that you want to fill the color in the input_no field when you click on the FILL COLOR Button”)

    So as I said before to read the input_no field.you need to use

    ADOBE_DATA.FORM.INPUT_NO.FillColor = “102,179,255”

    Write the above script to Click event of the pushbutton.

    So it will fill the input_no field with the color specified.

    Now execute Webdynpro application or you can test it using Preview PDF tab.

    How to use IF condition and arithmetic operations.

    The requirement is to add 100 into input_no field if it contains less than 100 value and subtract 100 from the input_no field if it contains more than 100.

    This addition or subtraction should be carried out when you click on the ADD/SUBTRACT Button.

    To achieve this :Add a button ADD/SUBTRACT as shown in the below screen shot and add the below formcalc script in onclick event of that button.

    if ( ADOBE_DATA.FORM.INPUT_NO.rawValue < 100     ) then

    ADOBE_DATA.FORM.INPUT_NO.rawValue = ADOBE_DATA.FORM.INPUT_NO.rawValue + 100

    else

    ADOBE_DATA.FORM.INPUT_NO.rawValue = ADOBE_DATA.FORM.INPUT_NO.rawValue – 100

    endif

    How to display the POPUP BOX in the interactive form.

    Put one more button in the layout name it as “Popup”.

    Click on it and insert the formcalc script as

    xfa.host.messageBox( “This is the test for Popupbox”)

    Execute your webdynpro application or go to Preview PDF for testing. All the formacalc script

    button in adobeformscolor change formcalcformcalc fillColor functionformcalc function adobeformsformcalc rawvaluepopup function adobeforms
    raju borda
    Raju is working with Technical areas like SAP ABAP, PI , Web design, JAVA , PBT, robotics as architect also functional areas like SCM , QM, MM , insurance . When he is not Doing above geeky things you might find him travelling , Cooking , dancing or drinking with friends :-) .
    • Tutorial on interactive adobeforms by webdynpro for ABAP

    • Tutorial on Implicit Enhancement in SAP ABAP

    You Might Also Like

    Best practices While working with SAP Database

    July 18, 2017

    Let’s remember our old friend : Classical Reports !

    August 7, 2017

    Do the Drone – SAP Rescue Bots

    July 4, 2017

    No Comments

    Leave a Reply Cancel Reply

Sign up for some exciting content

Recent Posts

  • How to prepare for SAP IBP Certification
  • What is SAP Leonardo ?
  • RoadMap UI Tutorial webdynpro for ABAP
  • Offline Adobe forms in WebDynPro for ABAP
  • MVC Architecture for Webdynpro for ABAP

Categories

  • ABAP
  • Android
  • Coding Challenges
  • Enhancement
  • featured
  • Interviews
  • Learning Hub
  • PI ( Process integration )
  • SAP
  • SAP HANA
  • Uncategorized
  • Webdynpro for ABAP
  • Webdynpro For ABAP