Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
antoniovaz
Participant
The purpose of this post is to share a tool, well, not only a tool, a framework ... I like the term framework kind of sounds geek :grin: .

This framework will always be under development ... so, feel free to provide some feedback.

In order to keep things simple I will post the source to the framework and some usage examples. But before, let's jump into some what, why & how questions.

What?

This is a framework to allow users to easily have the ability to use work process parallelism without the burden to manage all the technical implementation details.

Why?

  1. Because this is a topic that I really like;

  2. I don't know ... because, I want to


How?

I'm describing the simple way to use the framework in the following items:

 

  1. The tasks you are trying to process are independent and non-related to each other;

  2. You have to define a Function Module Remote Enabled (this is extremely important ... I'll bet that someone is going to miss this particularity :razz: ), that will be your way to process an entry;

  3. Gather the data to be processed

    1. Example 1: select pernr into table it_employee from pa0000 where name like '%peanuts%'

    2. it_employee needs to have all the data that you require to process an unit of process (in this case an employee)

    3. If you need multiple data, example data from another table or from seven thousand and thirty five tables

      1. Create a data type that will hold all the data per unit of process.





  4. Instantiate the framework providing:

    1. FM name

    2. Internal table containing the data to be processed



  5. Execute the run method


This is all blah blah but ... talk to me in code!

If you are like me you are probably skipping all the introduction blah blah and just got to this point ... or not, nevertheless follows a simple example:

" **********************************************************************

" Retrieve some example data

data: it_t005 type table of t005.

select * into table it_t005 up to 100 rows from t005.

try .

" **********************************************************************

" Build instance

l_pp_ref = zcl_pp_factory=>build_instance( pit_raw_data            = it_t005

p_rfc_name              = 'Z_PP_UNIT_TESTS'

p_logon_group           = sp_loggr

p_max_execution_time    = sp_maxt

p_task_wait_time        = sp_tswt

p_task_max_retries      = sp_maxr

p_task_wait_no_resource = sp_tstn

p_log_level             = sp_logl

).

" **********************************************************************

" Execute the processing

l_pp_ref->run( ).

" **********************************************************************

" Display results

perform display_results using

l_pp_ref

changing

git_processed

git_unprocessed

git_error.

catch zcx_pp_exception into cx.

l_err = cx->if_message~get_text( ).

message l_err type 'S' DISPLAY LIKE 'E'.

endtry.

Where?

At this particular moment I'm sharing this tool using the saplink format ... if you don't know what saplink is please follow this link before trying to install.

Considerations!!!

Regarding the generic runtime, it is considering that the Remote Function Module has a fixed signature. If you are planning on using this generic runtime, please make sure that you change your Function Module accordingly.

Some documentation







Full documentation

Manual: AVAZ - SAP BC - Parallel Processing

 

Download

Inside the manual PDF you can find the NUGG file.

PLEASE READ

There are some notes that I would like to leave before providing this framework.

  • Use this at your own risk, I will not be held responsible in any way for whatever could happen if you use this framework

    • Even if I have an infinite loop that overheats the CPU and causes a fire which then burns down a whole block leading to the world caos...I don't care :twisted:



  • You can use this as you want, I don't mind ... some credit is appreciated though :smile:

4 Comments