SAP Adobe Form tutorial III date, time, floating field, picture

Previously:

A simple example of the SAP Adobe Form tutorial

SAP Adobe Form tutorial Table 2

 

Original title: SAP Adobe Interactive Form Tutorial. Part III. Date Time and Floating Fields

Link to this article: https://www.cnblogs.com/hhelibeb/p/15501044.html

prepare

The first step is still to create interface s and form s. See above for details.

 

  Get the form as follows, drag and drop the parameter NAME to the context,

 

Drag and drop the DATE and TIME fields to the Context. These are system generated variables,

 

 

Then work in the Layout area.

How to use floating field?

floating field, that is, the field printed according to the binding. The specific printing content depends on the field bound during operation.

Go to Layout,

 

Insert standard text field,

Expand / stretch (as you did in ms paint) the text field boundary to write text in it.

 

Enter the text below or any desired line. But choose a word you want to keep as floating field. Floating field means that it can print any bound field.

My name is NAME, I am SAP Technical consultant. Thank you SAP Yard.

For this example, we want the NAME to be dynamic. Select the text (NAME), right-click it and select it as floating field, and change the word NAME to {TextField}.

 

 

Bind the floating field to the NAME field we dragged to the context area,

 

The field {Text Field} will have a dynamic length (the maximum length from the context to the bound NAME field). It will be expanded and compressed according to the input. The NAME "Ram" has only 3 characters, but the NAME "wolfeschlegelstein hausenbergerdorff" has more than 30 characters, but {TextField} will still accept it. After all, this is a floating field.

How do I use dates and times?

Go to Data view,

 

Drag and drop the date and time fields into Layout,

 

Change the date format by selecting the date mode under select type,

 

The country based mode can be selected by selecting the desired country under regional settings.
We can also format the time using the same steps described above for the date field.

 

The following system fields exist in Adobe Form,

 

 

Check, save and activate.

Press F8 to run and pass in the NAME value.

 

Then continue to run,

 

You will get the date and time and the text containing the entered NAME,

 

 

If called by the driver, you can use the following code,

 1 *======================================================================*
 2 * YRAM_ADOBE_FORM_PROGRAM3 *
 3 *======================================================================*
 4 * Project : SAP Adobe Forms Tutorial *
 5 * Author : Ramanjula Naidu DARURU (www.SAPYard.com) *
 6 * Description : Driver Program for Printing Floating Field, Date & Time *
 7 *======================================================================*
 8 REPORT yram_adobe_form_program3.
 9 
10 * Selection Screen
11 PARAMETERS: p_name TYPE name1.
12 
13 **&&~~ Data Objects
14 DATA: gv_fm_name TYPE rs38l_fnam, " FM Name
15 gs_fp_docparams TYPE sfpdocparams,
16 gs_fp_outputparams TYPE sfpoutputparams.
17 
18 CONSTANTS : gv_form_name TYPE fpname VALUE 'YRAM_ADOBE_FORM3'.
19 
20 *======================================================================*
21 * START of Calling the Form
22 *======================================================================*
23 *&---------------------------------------------------------------------*
24 **&&~~ Form Processing: Call Form - Open
25 *
26 CALL FUNCTION 'FP_JOB_OPEN'
27 CHANGING
28 ie_outputparams = gs_fp_outputparams
29 EXCEPTIONS
30 cancel = 1
31 usage_error = 2
32 system_error = 3
33 internal_error = 4
34 OTHERS = 5.
35 IF sy-subrc <> 0.
36 " Suitable Error Handling
37 ENDIF.
38 *&---------------------------------------------------------------------*
39 **&&~~ Get the Function module name based on Form Name
40 *
41 CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
42 EXPORTING
43 i_name = gv_form_name
44 IMPORTING
45 e_funcname = gv_fm_name.
46 IF sy-subrc <> 0.
47 " Suitable Error Handling
48 ENDIF.
49 *&---------------------------------------------------------------------*
50 **&&~~ Take the FM name by execuing the form - by using Pattern-
51 **&&~~ call that FM and replace the FM Name by gv_fm_name
52 **&&~~ Call the Generated FM
53 CALL FUNCTION gv_fm_name "'/1BCDWB/SM00000176'
54 EXPORTING
55 /1bcdwb/docparams = gs_fp_docparams
56 name = p_name
57 EXCEPTIONS
58 usage_error = 1
59 system_error = 2
60 internal_error = 3
61 OTHERS = 4.
62 IF sy-subrc <> 0.
63 * Implement suitable error handling here
64 ENDIF.
65 *&---------------------------------------------------------------------*
66 
67 *&---------------------------------------------------------------------*
68 *&---- Close the spool job
69 CALL FUNCTION 'FP_JOB_CLOSE'
70 EXCEPTIONS
71 usage_error = 1
72 system_error = 2
73 internal_error = 3
74 OTHERS = 4.
75 IF sy-subrc <> 0.
76 * <error handling>
77 ENDIF.

 

Keywords: sap abap

Added by basim on Tue, 02 Nov 2021 15:56:08 +0200