Showing posts with label adobe form. Show all posts
Showing posts with label adobe form. Show all posts

Monday, November 27, 2017

Adobe Form Overview

Adobe Form is an interactive form in PDF that allow user to fill out the form in screen and save  entries in XML format in the form. When the SAP system receives the form, it extract the data saved in the form and can process further.

The forms are composed of Master Pages and Body Pages.

Context:
  • The text include module cannot refer to an import, it only can refer to a global variable.

What’s in the form design?
The following components make up a form design:
  1. Master pages: Provides the layout and format for pages in the form.
The Master Pages defines the global elements as Header/footer/pages/format/orientation…
The master pages contains « Content Area ».
This content area will take the Body Pages. It can be resized

In general we create only 1 master page except in the case we have many formats or orientation
  1. Body pages: Represent the page of a form. You can choose which master page to assign to the body page. Header, Item detail, Footer are defined in body page.
  2. Content areas
  3. Subforms: Container that you can use to group design objects such as fields, images, address etc. You can set the properties of subform, it will then apply to all objects within the subform.
  4. Fields
  5. Boilerplate objects
    1. Text Field (Text with caption - caption can be translated to different languages by Edit → Translation)
      1. You can remove the caption in the text field is changing its caption position to none using Layout tab of the object properties window.
    2. Text: Display only text
    3. Floating Field

Palettes
  1. Hierarchy palettes is a visual presentation of the contents in body pages and master pages tabs. The palettes also display objects added to the form under the object node.
  2. Data View palettes is a visualization to provide a way of mapping data from context to the form. You can drag & drop fields from Data View to the form.
  3. Object palettes
  4. Layout palettes

Layout settings: Expand to fit

Thursday, November 23, 2017

Q&A (Adobe Form)

How to access a context data in Javascript?
use a hidden field and read the value from this hidden field.

How to create table?

Create subform by dragging internal table from the data layout tab
In binding, choose "use name <subform>"
The table is automatically created and displayed

How to create table with alternative?
Create 2 tables and alternatively hide the table using script by a condition.

How to call adobe form from driver program?
The 5 basic steps involved are -
 1.Data retrieval in the report programme.
 2.Call Function 'FP_FUNCTION _MODULE_NAME( to get the  generated
    function module name).
 3.Call Function 'FP_JOB_OPEN '.
 4.Call Function <generated function module name>.
 5.Call Function 'FP_JOB_CLOSE'.

Example:
DATA: CUSTOMER          TYPE SCUSTOM,
      BOOKINGS          TYPE TY_BOOKINGS,
      CONNECTIONS       TYPE TY_CONNECTIONS,
      FM_NAME           TYPE RS38L_FNAM,
      FP_DOCPARAMS      TYPE SFPDOCPARAMS,
      FP_OUTPUTPARAMS   TYPE SFPOUTPUTPARAMS.
 
 
* GETTING THE DATA
  <data selection>
 
 
* PRINT:
 
* Sets the output parameters and opens the spool job
    CALL FUNCTION 'FP_JOB_OPEN'
     CHANGING
     IE_OUTPUTPARAMS       = FP_OUTPUTPARAMS
     EXCEPTIONS
     CANCEL                = 1
     USAGE_ERROR           = 2
     SYSTEM_ERROR          = 3
     INTERNAL_ERROR        = 4
     OTHERS                = 5.
    IF SY-SUBRC <> 0.
  <error handling>
    ENDIF.
 
* Get the name of the generated function module
   CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
    EXPORTING
    I_NAME                     = '<form name>'
    IMPORTING
    E_FUNCNAME                 = FM_NAME.
   IF SY-SUBRC <> 0.
  <error handling>
   ENDIF.
 
* Call the generated function module
   CALL FUNCTION FM_NAME
     EXPORTING
     /1BCDWB/DOCPARAMS        = FP_DOCPARAMS
     CUSTOMER                 = CUSTOMER
     BOOKINGS                 = BOOKINGS
     CONNECTIONS              = CONNECTIONS
*   IMPORTING
*     /1BCDWB/FORMOUTPUT       =
    EXCEPTIONS
      USAGE_ERROR           = 1
      SYSTEM_ERROR          = 2
      INTERNAL_ERROR           = 3.
   IF SY-SUBRC <> 0.
  <error handling>
   ENDIF.
 
* Close the spool job
  CALL FUNCTION 'FP_JOB_CLOSE'
*   IMPORTING
*    E_RESULT             =
    EXCEPTIONS
      USAGE_ERROR           = 1
      SYSTEM_ERROR          = 2
      INTERNAL_ERROR        = 3
      OTHERS                = 4.
  IF SY-SUBRC <> 0.
  <error handling>
  ENDIF.

Saturday, February 18, 2017

Hiding a Field Using Javascript in Adobe Form based on the condition

Hiding a Field Using Javascript in Adobe Form based on the condition


By Kalyan Balabhadrapatruni, YASH Technologies

Go to Transaction SFP->  
Select Interface Radio Button & Enter the name to create New Interface.
(Eg:- zhide_field).  
Click on Create & Enter the Description and Press Save:  
Press Save Button.
 
Creating a import parameter
Go to Form Interface->import ->Parameters name -> Enter the import parameter (ie:- pernr)
Creating the Global Delivery which will passed filled in the form interface and passed to the Layout of adobe form.
Go to Global Definitions->Global Data -> enter the below variables.
Go to Global Definitions->Create types.
Go to Initialization->code Initialization.
Enter the below code.
Save
Check
Activate the Interface.

Once the interface is activated.
Go back to transaction SFP.
Select Form Radio Button & Enter the name to create New Form.
(Eg:- zhide_field).  
Enter the Description & Interface name which we have created and press save button.
Press save.
 
Form Context is displayed as below.
Drag & drop the Global data form Interface to Context Level & Save the form.  
Click on the Layout to design the layout.  
Form layout is displayed.
Click on the data view to View the fields that are add to the context in the context tab.

Now drag and drop the fields from the Data view to the form.  
Select object name ->go to Palettes->Click on Script Editor.
This script will hide the field in runtime if it is initial.
Enter the below JavaScript in the editor & Select the language as JavaScript.  
if(this.rawValue == null) // if you use double quotes instead, it will not take effect
{
 this.presence = "hidden"; // in lowercase
}  
Save and activate the form.  
Execute the form to see the below screen.  
Here for output we will have two scenarios.   
SCENARIO 1: Position Title is not initial  
SCENARIO 2: Position Title is initial  
SCENARIO 2:

Using Alternative

Adobe Forms - Using Alternative

By Jayachandra Nagaram, YASH Technologies
In this demo we will create adobe form, which displays two different table data in different scenarios based on the given input. This functionality is achieved by using Alternative in adobe forms.
Step1: Go to SFP transaction and create interface for the Adobe form.
Note: Maintain Interface type ABAP-Dictionary Base interface. (IN ECC6.0 Version)
Step2: In interface you will find import, export and Exceptions.
Create import parameters by clicking on below shown create button.
Step3: Create import parameters IT_SPFLI and FLAG.
The import parameter IT_SPFLI is used to input data and FLAG is used to select the table that should be displayed in the Output. Here the details of either SPFLI or SFLIGHT are displayed depending on the FLAG.
Step4: Create two global tables SPFLI and SFLIGHT to hold the data that needs to be displayed in the output.
Step5: Code for fetching the data is written in the code initialization part of interface.
In code initialization the variables whose values are being passed to the code to fetch the details of the output should be declared in the Input parameters and the variables to which the results are assigned needs to be declared in the Output parameters.  
Step6:  Write the below code in code initialization part. Check for errors and activate the interface.
select *
 from spfli
 into table gt_spfli
  for all entries in it_spfli
where carrid eq it_spfli-carrid
  and connid eq it_spfli-connid.
select *
 from sflight
 into table gt_sflight
  for all entries in it_spfli
where carrid eq it_spfli-carrid
  and connid eq it_spfli-connid.

Step7: After the interface part is done, create Form by going to SFP transaction.
Step8: In the creation of the Form, we need to give the name of the interface for which we are creating the Form. This is the additional functionality in Adobe forms. One interface can be used for many Forms if it is suitable.
Step9: In the Context tab of the Form we will find two sections Interface and Context.
In Interface we will find the data that was created in the interface. Content area will be blank initially. We need to drag the elements that need to be displayed in output into the content area.
Step10: Drag and drop element FLAG into context area.
Step11: Select folder YDEMO_ALTERNATIVE in context and create an ALTERNATIVE. Right-clicking on the folder go to create--> Alternative.
Step 12: In Alternative will find two nodes TRUE and FALSE.
Initially both are blank.


Step13: Drag and drop table GT_SPFLI from Global data to TRUE node and de-activate fields which we don't need.
Step14: Drag and drop table GT_SFLIGHT from Global data to FALSE node and de-activate fields which we don't need.
Step15: Select the Alternative conditions tab and create condition for alternative.
Create condition as FLAG = INITIAL.
Means subform TRUE will be triggered when the flag is initial and subform FALSE will be triggered when there is some value in flag variable (NOT INITIAL).  
Step16: Select tab page LAYOUT for going to Adobe layout.
In Layout, go to MASTER page decrease the page area and create the boiler plate elements, such as text and image elements. We can create these from dragging the elements from library.   
Step 17: In data view we will find subform ALTERNATIVE, with in it tables will be placed in TRUE and FALSE subforms using choice subform set.  
Step18: Drag and drop complete ALTERNATIVE subform into body page from data view.


Step19: Select body page and go to the object view from the palettes.
Step20: Go to SUBFORM tab; make the body page content FLOWED, Flow direction TOP TO BOTTOM.
Step21: Go to Pagination, set over flow to ‘Go To Page "Page1"’.
This should be done in order to flow the content to the next page when first page is filled completely.
Step22: Set subforms ALTERNATIVE, TRUE, FALSE content also to be flowed.
Step23: Select the elements in table data and set the appearance to ‘None’.  
Step24: Save and activate the form.
Execute the form to see the below screen.
Here for output we will have two scenarios.
Step25:
SCENARIO 1: When the FLAG is INITIAL, SPFLI data will be displayed in output.
SCENARIO 2: When the FLAG is NOT INITIAL, SFLIGHT data will be displayed in output.
Step26: Select the table IT_SPFLI to give the input data. Give inputs to the table.
Step27: Now there are three entries in the table IT_SPFLI and the FLAG is BLANK.
Step28: Subform TRUE will be triggered when FLAG is INITIAL. And SPFLI table data will be displayed in output.
Step29: Maintain same data in IT_SPFLI and give 'X' in FLAG. Scenario 2 will be triggered.
Step30: Output screen displays SFLIGHT table data;   


SAP giới thiệu mã hỗ trợ AI trong ngôn ngữ ABAP riêng của mình

SAP đã ra mắt một loạt tính năng mã hỗ trợ AI trong môi trường phát triển ứng dụng dựa trên đám mây của mình, đồng thời tham gia vào danh sá...