Open navigation

Aico supported SAP program guidelines

Modified on Tue, 15 Aug, 2023 at 10:04 AM

Info: Please note we are not SAP specialists. The examples given are from our SAP environment, but yours might differ. If you have any questions relating to your SAP environment, please contact your SAP Support Team..

This article goes through some guidelines to enable SAP programs to run from Aico.

Info: Please be aware that the screenshots are from our own SAP environment and yours might look different.

You can encounter SAP authorisation issues when running programs.

  • Remember you will need personal authorisation rights to run a program and save the variant. 
  • You are very likely to have different rights in your SAP test versus production environments.
  • In order to run the program from Aico, Aico's technical user will also need to have authorisation rights to run the program in both test and production. 

If you have any questions regarding your own SAP environment, contact your own SAP support team.

This article covers:

Running SAP in the background

It must be possible to run the SAP program in the background. If the program is only built to be run from the SAP GUI directly, it cannot be run from Aico. 

For example, the FS10N program can only run from the SAP GUI. However, there are almost always alternative programs that can deliver the same output. In this example, S_ALR_87012277 will give you the same information as FS10N.

Program support setting

The program should support setting a standard (not selection) variant.

Aico’s smart tag functionality manipulates the SAP variant when the program is run. The program, therefore, should have the option to use a variant. 

This is not always mandatory. Some programs can be executed in the background without variants using static values. But this varies case by case and would require you to investigate further.

Note: A selection variant is where you make one selection, such as controlling area. Based on that first selection, you can then enter further selections. We have been able to automate some of these by calling the program directly via SAP T-code SE38 and entering the full program name. It is then possible to save the selection part into a standard variant, but you would need to investigate this on a case by case basis using your SAP and Aico test systems.

Dynamic selections

Aico typically supports dynamic selections, although there are few cases when there have been problems.

Note: That SAP has introduced a new dynamic variant called "Free selections" and Aico supports this differently.  It is worth reviewing the Dynamic and Free selections section of the SAP variants article which reviews how this is supported when saving the variants in SAP

Spool format

Spool format must be in the ABAP List, shown below. 

Currently, Aico does not support the OTF format typically used for SAP invoice creation.

This is because Aico Z-function uses the standard SAP function modules:

RSPO_RETURN_ABAP_SPOOLJOB

RSPO_RETURN_ABAP_SPOOLJOB_RAW

How to test if a program is Aico compatible

You can test compatibility via the SAP GUI using T-code SE37, assuming Aico’s closing package is installed into your SAP system.

Testing report execution

Enter T-code SE37, then enter the Aico function module name /AICO/START_PRT_DYN_SEL and press the spanner button.

Note: You may still be using Aico's original Z functions, in which case the function module name is Z_AICO_START_PRT_DYN_SEL.

Enter the T-code or program name into the I_CODE field

Set the saved variant name into I_VARIANT

Finally, flag USE_RAW_FORMAT (introduced in newer versions of the functions).

Press execute.

If the background execution is successful, you will see E_JOBCOUNT and E_JOBNAME. If there are any errors, you will see those in the E_BAPIRET2 structure.

Test that program is finished

After the job is started, you can see from T-code SM37 it is running. When it is finished, the spool file will be created.

Testing the printout

After the background job is finished and the spool file is created, Aico uses the job number to retrieve the spool file and converts it into an Excel and/or PDF. You can test if this will work in Aico.

Go to SE37 and enter the Aico function module name /AICO/GET_PRINTOUT (Z_AICO_GET_PRINTOUT) and press the spanner button.
Enter the job count and job name. Press execute.

You will see PDF in XSTRING mode in the E_PDF parameter

The T_PRINTOUT table shows the spool output

The T_BAPIRET2 includes the Job log

Special Cases

It is possible to execute in the background some programs which do not create spool files. In these cases, Aico only returns the Job log.

Sometimes spool files contain strange characters which Aico does not recognise. These include less common languages or control characters from other systems. In these cases, some changes on the Aico side are needed. However, you can still test the functionality inside SAP. An error message will pop up in Aico. Please contact Aico Support at this point.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article