Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Insert Digital Signature in SAP ABAP Smartforms

akjayaa
Explorer
0 Kudos
6,233

Hi Experts,

Good afternoon!

I got a business requirement to insert a digital signature in smartforms. I have tried many times but could not happen anything so kindly guide me to insert digital signature.

Thank You!

Regards

Jayaprakash AK

1 ACCEPTED SOLUTION

SugguSandeep
Contributor
0 Kudos
5,704

Hi akjayaa,

Here are the steps to create a digital signature in SAP ABAP smart forms:

1. Add a digital signature field to your Smart Form by placing a 'Signature Field' in the form's layout.

2. Go to Transaction Code 'SE38' and create a new ABAP program.

3. Declare the signature field as a global variable in the program. Here's an example:

```ABAP
DATA gv_signature TYPE sscr_signature.
```

4. In the program, write the code to obtain the digital signature. Here's an example of using function module 'SSF_FUNCTION_MODULE_NAME' to get the function module of the smart form:

```ABAP
DATA: lv_smartform_func TYPE rs38l_fnam.

lv_smartform_func = 'ZSMARTFORM'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = lv_smartform_func
IMPORTING
fm_name = ref_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
```

5. Use the 'SSF_FUNCTION_MODULE_NAME' function module to obtain the function module name of the smart form. Assign the function module to a reference variable named 'ref_fm_name'.

6. In the program, get the digital signature using function module 'SSCR_SIGNATURE_GETDETAIL'. Here's an example:

```ABAP
CALL FUNCTION 'SSCR_SIGNATURE_GETDETAIL'
EXPORTING
signature_index = 1
IMPORTING
signature_data = gv_signature
EXCEPTIONS
no_signature = 1
OTHERS = 2.
```

7. Assign the digital signature retrieved with 'SSCR_SIGNATURE_GETDETAIL' to the signature field in the smart form. Here's an example:

```ABAP
ITAB-SIGNATURE_FIELD = gv_signature.
```

8. Save the ABAP program and activate it.

9. Once done, execute the Smart Form and test the digital signature. You should be able to sign the Smart Form using a digital signature.

These are the basic steps to create and use digital signature in SAP ABAP smart forms. However, note that there may be additional integration steps that need to be done based on your organization's security policy and requirements.

Thank You,
Suggu Sandeep.

3 REPLIES 3

SugguSandeep
Contributor
0 Kudos
5,705

Hi akjayaa,

Here are the steps to create a digital signature in SAP ABAP smart forms:

1. Add a digital signature field to your Smart Form by placing a 'Signature Field' in the form's layout.

2. Go to Transaction Code 'SE38' and create a new ABAP program.

3. Declare the signature field as a global variable in the program. Here's an example:

```ABAP
DATA gv_signature TYPE sscr_signature.
```

4. In the program, write the code to obtain the digital signature. Here's an example of using function module 'SSF_FUNCTION_MODULE_NAME' to get the function module of the smart form:

```ABAP
DATA: lv_smartform_func TYPE rs38l_fnam.

lv_smartform_func = 'ZSMARTFORM'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = lv_smartform_func
IMPORTING
fm_name = ref_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
```

5. Use the 'SSF_FUNCTION_MODULE_NAME' function module to obtain the function module name of the smart form. Assign the function module to a reference variable named 'ref_fm_name'.

6. In the program, get the digital signature using function module 'SSCR_SIGNATURE_GETDETAIL'. Here's an example:

```ABAP
CALL FUNCTION 'SSCR_SIGNATURE_GETDETAIL'
EXPORTING
signature_index = 1
IMPORTING
signature_data = gv_signature
EXCEPTIONS
no_signature = 1
OTHERS = 2.
```

7. Assign the digital signature retrieved with 'SSCR_SIGNATURE_GETDETAIL' to the signature field in the smart form. Here's an example:

```ABAP
ITAB-SIGNATURE_FIELD = gv_signature.
```

8. Save the ABAP program and activate it.

9. Once done, execute the Smart Form and test the digital signature. You should be able to sign the Smart Form using a digital signature.

These are the basic steps to create and use digital signature in SAP ABAP smart forms. However, note that there may be additional integration steps that need to be done based on your organization's security policy and requirements.

Thank You,
Suggu Sandeep.

xiswanto
Active Participant
0 Kudos
5,704

I'm not sure if you could have a digital signature ( which looks exactly like a handwritten signature ) based on input parameter, unless it is using the graphic object in smartforms ( where the signature image is uploaded from SE78 ).

Perhaps you might want to take a look at adobe form instead.

vca
Discoverer
0 Kudos
5,704

Hi Sandeep Suggu,

My system (SAP S/4HANA 1909) not found function module 'SSCR_SIGNATURE_GETDETAIL'.

How can I get this function module?


Thank you.

Budtawwan Vu,