Create a dynamic logo in smart form through SE38 Program
source link: https://blogs.sap.com/2023/05/19/create-a-dynamic-logo-in-smart-form-through-se38-program/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Create a dynamic logo in smart form through SE38 Program
Introduction
Dealing with logos is always a big deal in Smart form. This blog shows how to generate a Smart form with a dynamic logo in SE38. The objective is by using the parameter values set dynamic logo in the report program.
Requirement: Pass Purchase document number (EBELN) as input parameter and fetch Document date (BEDAT). If the Purchase document date is lower than require date then, print the First logo. Else print the Second logo.
- Upload logos in the Graphic library using T-code SE78.
- Demo Logo 1
-
- Demo Logo 2
- The below structure is a source of this object. Create a Smart form using the below structure and save it in a local object.
- Creating a program in Abap editor using T-code SE38. Save it in a local object.
- Write below code to call smart form through report. In this code, logo name changed based on the condition.
SELECTION-SCREEN BEGIN OF BLOCK b1.
PARAMETERS p_ebeln TYPE ebeln.
SELECTION-SCREEN END OF BLOCK b1.
DATA: ls_data TYPE zdemo_str_dym_logo,
lv_fmname TYPE rs38l_fnam,
ls_cntl_parm TYPE ssfctrlop,
ls_op_options TYPE ssfcompop,
lv_date TYPE sydatum.
SELECT SINGLE ebeln, bedat
FROM ekko
INTO @ls_data
WHERE ebeln = @p_ebeln.
IF ls_data-doc_date <= '20210131'.
ls_data-logo = 'DEMO LOGO 1'.
ELSE.
ls_data-logo = 'DEMO LOGO 2'.
ENDIF.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZDEMO_SFM_DYM_LOGO'
IMPORTING
fm_name = lv_fmname
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
ls_cntl_parm-langu = 'EN'.
ls_cntl_parm-preview = space.
ls_cntl_parm-no_dialog = abap_true.
ls_op_options-tddest = 'LP01'.
ls_op_options-tdnewid = abap_true.
ls_op_options-tdimmed = abap_true.
ls_op_options-tddelete = space.
CALL FUNCTION lv_fmname "'/1BCDWB/SF00000086'
EXPORTING
control_parameters = ls_cntl_parm
output_options = ls_op_options
user_settings = 'X'
e_structure = ls_data
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
- In smart form create a window. Inside the window create a Graphic.
- Inside the graphic window fill the name, object, and Id of images as shown below.
- Get the above details in t-code SE78 as shown below.
Output
- Demo output 1 Document date is lesser than 30.01.2021.
- Demo output 2 Document date is greater than 30.01.2021.
Conclusion
- Hope you all know how to achieve a dynamic logo in the smart form now. It will be a pleasure to receive comments from you.
- Preparing more new topics to connect with you all.
Thanks,
Jeevitha.
Recommend
-
50
In this blog post, you will learn the procedure to create a dynamic form builder in Blazor with the EditForm class an...
-
9
In this tutorial, we’ll learn how to create dynamic form controls in Angular using Angular FormArray API. While building forms for our apps, most of the time we know in advance what fields the user needs, so we statically lay them ou...
-
1
Create Dynamic Form Fields in ReactA few days ago I needed to implement dynamic form fields for a project in React. I thought it would be good to make a quick tutorial on this, so here it is!Let’s say we are buildin...
-
5
10 dynamic logo animations you’ll wish you madeLogo inspiration from young and veteran animators
-
4
Accelerating Delivery of Dynamic Form Projects
-
3
Hans Raj November 7, 2022 3 minute read ...
-
8
Mohammed Aymen November 29, 2022 3 minute read...
-
3
This time, we will again create dynamic forms but now with the help of the react-hook-form library. Note 📣: You need to have knowledge in Type...
-
6
Jeevitha Palanisamy May 11, 2023 4 minute...
-
5
JSON Dynamic Components loading on react native application form JSON file Jul 24, 2023 1 min read
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK