3

I know that one can start a new thread by

CALL FUNCTION 'ZTEST_RFC' 
STARTING NEW TASK 'ABC'.

but as I am writing a web application in ABAP, it feels so wrong to have my OO handler parse an http call, get the request data, then call an Old Skool function module and then have that FM call again an OO object with all the application logic.

Is there any way to start a new task providing a object & method?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
tomdemuyt
  • 4,572
  • 2
  • 31
  • 60

1 Answers1

2

Not really. I understand that this feels wrong, but STARTING NEW TASK uses a lot of the basic RFC mechanisms, and since classes were never really RFC-enabled (though you can see in some internal details that someone at least made some provisions to do so), you still have to rely on basic procedural programming there. On the other hand, I've rarely seen an appropriate use for parallel processing in ABAP...

vwegert
  • 18,371
  • 3
  • 37
  • 55
  • Upload file with delivery plans from web front end, response time could be minutes, hence the separate processing. – tomdemuyt Jun 17 '13 at 19:59
  • I still don't get it - aren't you posting to a separate web service? Why use two ABAP dialog processes for this? – vwegert Jun 17 '13 at 20:49
  • first abap dialog process quits and returns that the file will be processed ( that is after validating that the data is fine ). The 2nd process goes for much longer and does the actual work. – tomdemuyt Jun 17 '13 at 21:46
  • 6
    How about starting a background job for this? This way, you can even spread the processing load across various servers. First process stuffs the binary file into the database using a GUID, generates a variant and uses `SIMPLE_BATCH_JOB_SUBMIT` to start the background job. – vwegert Jun 18 '13 at 06:47