SAP Adobe Form Tutorial Part X Alternative in Adobe Forms

SAP Adobe Form alternative solutions for better form design

Uncertainties and “buts” are an integral part of life, and Adobe Forms are no exception. You often encounter real-life scenarios where printing depends on specific conditions. In such cases, SAP Adobe Form Tutorial Part X Alternative in Adobe Forms explores a feature called “Alternative” that allows you to print data conditionally based on the requirements.

Transaction Code: SFP.

Enter the connection point name and make (the connection point is compulsory for Adobe structure).

Adobe Form Tutorial

Enter the necessary short portrayal and save.

Adobe Form Tutorial

Enter the bundle name and save.

Allow us to add our own custom boundary name. Select the Import choice under the Structure Connection point (left side) and press the Make button (right side) to add a bringing-in boundary.

Adobe Form Tutorial

FLAG is for alternative. TEXT1 and TEXT2 are for printing the texts.

Save, Check, and Actuate the Connection Point.

Go to the back SFP Exchange fundamental screen. Make the structure.

Adobe Form Tutorial

Press the make button. Give the short portrayal and connection point name that you have made before.

Adobe Form Tutorial

Enter the bundle name and save.

Drag Banner, TEXT1, and TEXT2 from Point of Interaction to Setting.

Adobe Form Tutorial

Go to setting. Right-click on the YRAM_ADOBE_FORM10 under the unique circumstance and make an alternative.

Adobe Form Tutorial

Alternative:

Alternative is the option that we use for conditional printing with TRUE / FALSE option.

When it is TRUE, it will print the details, which are specified under TRUE and vice versa.

Adobe Form Tutorial

Simplified the TEXT1 under the Genuine Condition and the TEXT2 to Bogus Condition.

Adobe Form Tutorial

Make a condition for elective. Press on Alternative Conditions button.

Add a condition:  FLAG = ‘X’

Adobe Form Tutorial

That’s what it intends – when you pass ‘X’ it is Valid, when Space it is Misleading.

Go to Design. Simplified the TEXT1 and TEXT2 to the design.

Adobe Form Tutorial

Save and enact the structure.

Allow us to construct the Driver program

*&---------------------------------------------------------------------*
*======================================================================*
* YRAM_ADOBE_FORM_PROGRAM8 *
*======================================================================*
* Project : SAP Adobe Forms Tutorial                                   *
* Author : varad (www.elearningsolutions.co.in)                    *
* Description : Using Alternative in Adobe form                        *
*======================================================================*
REPORT yram_adobe_form_program10.

*======================================================================*
* Selection Screen
*======================================================================*
PARAMETERS : p_flag TYPE char1.
*======================================================================*
* Data Objects
*======================================================================*

DATA: gv_fm_name         TYPE rs38l_fnam, " FM Name
      gs_fp_docparams    TYPE sfpdocparams,
      gs_fp_outputparams TYPE sfpoutputparams,
      gv_text1           type char255,
      gv_text2           type char255.

*======================================================================*
* Constants
*======================================================================*
CONSTANTS : gv_form_name TYPE fpname VALUE 'YRAM_ADOBE_FORM10'.

 gv_text1 = 'Welcome to Adobe form tutorial'.
 gv_text2 = 'Welcome to SAP ABAP'.
*======================================================================*
* START of Calling the Form
*======================================================================*
*&---------------------------------------------------------------------*
**&&~~ Form Processing: Call Form - Open
*
CALL FUNCTION 'FP_JOB_OPEN'
  CHANGING
    ie_outputparams = gs_fp_outputparams
  EXCEPTIONS
    cancel          = 1
    usage_error     = 2
    system_error    = 3
    internal_error  = 4
    OTHERS          = 5.
IF sy-subrc <> 0.
  " Suitable Error Handling
ENDIF.
*&---------------------------------------------------------------------*
**&&~~ Get the Function module name based on Form Name
*
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
  EXPORTING
    i_name     = gv_form_name
  IMPORTING
    e_funcname = gv_fm_name.
IF sy-subrc <> 0.
  " Suitable Error Handling
ENDIF.
*&---------------------------------------------------------------------*
**&&~~ Take the FM name by execuing the form - by using Pattern-
**&&~~ call that FM and replace the FM Name by gv_fm_name
**&&~~ Call the Generated FM

CALL FUNCTION gv_fm_name
 EXPORTING
   /1BCDWB/DOCPARAMS        = gs_fp_docparams
   FLAG                     = p_flag
   TEXT1                    = gv_text1
   TEXT2                    = gv_text2
* IMPORTING
*   /1BCDWB/FORMOUTPUT       =
 EXCEPTIONS
   USAGE_ERROR              = 1
   SYSTEM_ERROR             = 2
   INTERNAL_ERROR           = 3
   OTHERS                   = 4
          .
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
*&---------------------------------------------------------------------*

*&---------------------------------------------------------------------*
*&---- Close the spool job
CALL FUNCTION 'FP_JOB_CLOSE'
  EXCEPTIONS
    usage_error    = 1
    system_error   = 2
    internal_error = 3
    OTHERS         = 4.
IF sy-subrc <> 0.
* <error handling>
ENDIF.

Allow us to execute this structure and see the result.

Test 1 :  Execute program YRAM_ADOBE_FORM_PROGRAM10 to test TRUE Alternative.

Adobe Form Tutorial

Pass ‘X’

Execute. Press on Print see

Test 2 :  Execute program YRAM_ADOBE_FORM_PROGRAM10 to test FALSE Alternative

Pass no worth.

Execute. Press on Print see.

Trust this post was clear enough for you to comprehend. A legitimate showcase is something which we really want in each elective structures. It tends to be taken care of in more than one way however when SAP has given a shrewd Elective why not use it.

We put a lot of effort into conceptualizing, testing, and writing each article. If you could share this link with at least 5 colleagues or friends who might benefit from our post, it would be a great support to our team. We believe our articles, including “SAP Adobe Form Tutorial Part X Alternative in Adobe Forms,” should reach as many audiences as possible so that everyone can benefit and our team remains motivated, ensuring our work does not get lost in the vast expanse of the web.

Thank you kindly for visiting. Kindly leave your remarks/praises, great and no so great so we can continue to improve and giving you quality stuff.

YOU MAY BE INTERESTED IN

Your Definitive Guide to Becoming a SAP ABAP Developer

Understanding the Depth of SAP Audits: A Comprehensive Guide

10 Real-World SAP ABAP Programming Examples (with Code!)