Skip to Content

Status of Process chain execution using FM RSPC_API_CHAIN_START

Hi,

I have executed a Process chain using the FM RSPC_API_CHAIN_START:

CALL FUNCTION 'RSPC_API_CHAIN_START'

EXPORTING

i_chain = 'ZPC_TEST'

  • I_T_VARIABLES =

i_synchronous = 'X'

  • I_SIMULATE =

  • I_NOPLAN =

  • I_DONT_WAIT = 'X'

  • I_POLL =

IMPORTING

e_logid = v_logid

EXCEPTIONS

failed = 1

OTHERS = 2.

I need know when this process chain have finished in order to populate the log by screen. I was using other function RSPC_API_CHAIN_GET_STATUS into a loop in order to give the status. This FM return A = Active, G = Green, R = Red OR X = Aborted.

WHILE v_status ne 'G' or v_status NE 'R'.

CALL FUNCTION 'RSPC_API_CHAIN_GET_STATUS'

EXPORTING

i_chain = 'ZPC_TEST'

i_logid = v_logid

  • I_DONT_UPDATE =

  • I_DONT_POLL =

IMPORTING

e_status = v_status.

ENDWHILE.

the variable should be updated with the current status of the execution but if i execute this code the execution not finish (infinite loop).

Please, how could I know the correct status of the PC?

Thx in advance!

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 16, 2012 at 12:18 PM

    check RSPCPROCESSLOG table

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 16, 2012 at 03:16 PM

    Hi ,

    Please use

    When v_status CA 'AX'

    CALL FUNCTION 'RSPC_API_CHAIN_GET_STATUS'

    EXPORTING

    i_chain = 'ZPC_TEST'

    i_logid = v_logid

    • I_DONT_UPDATE =

    • I_DONT_POLL =

    IMPORTING

    e_status = v_status.

    ENDWHILE.

    This should resolve your issue .

    Hope it helps .

    Thanks

    Kamal Mehta

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 16, 2012 at 04:13 PM

    While using FM "WHILE v_status ne 'G' or v_status NE 'R'", what is this v_status...

    if i correctly understand your question you want to know the status of the Process Chain which is run by FM 'RSPC_API_CHAIN_START.....

    this can be achieved by using select statement on table RSPCPROCESSLOG......there is a field 'status' in the table by which you can get the status of PC......

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2012 at 06:49 AM

    Hi,

    i can think of below solution:

    create 2 custom program : Z_START_PC and Z_GET_STATUS

    in Z_START_PC start the process chain using the start FM and then call FM to create a batch job to schedule Z_GET_STATUS is background.

    in Z_GET_STATUS call FM 'RSPC_API_CHAIN_GET_STATUS' ( not in LOOP )and get the status

    if the status is "process chains still running" then create a batch job to schedule Z_GET_STATUS after say 15 mins again. This will again run Z_GET_STATUS in bkgd after 15 mins.

    if the status is "other then process chain running" then fill log accordingly.

    goto SE37 and put * batch * to get the FMs to create batch jobs for programs.

    Regards,

    Neeraj.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2012 at 08:10 AM

    Hi,

    I think the approach suggested by Anshual is simple and good enough to know the process chain status information, simply check the status in RSPCPROCESSLOG.

    You can go even one step further and know the status of each process in the chain.

    Regards,

    Durgesh.

    Add a comment
    10|10000 characters needed characters exceeded

    • Thanks to all!

      I'm using the table RSPCPROCESSLOG and checking that all the process have finished correctly. I think that the other options of the colleages are good too, but i will use this table (I think that is more simple 😊 )

      Thanks to all again

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.