Skip to Content
author's profile photo Former Member
Former Member

Program Execution wait untill data is filled in DSO table through process chain


Hi,

I have a requiremnt where I need to trigger the process chain which is inserting the data into the DSO.I want to wait the further program execution untill the process chain gets completed.That mean it has to wait till the data is filled into the DSO.So that i can read the data from the DSO for my further process.

As i am new to ABAP developer ,so please can anyone provide me how i can achieve is.

Thanks in Advance for the reply .

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Oct 01, 2014 at 07:11 AM

    Hi,

    you need to create the ABAP program in SE38

    if program will compelte info packge job will finish then it will load the data target DSO.

    please search on the google how to trigger the PC using the abap program.

    Thanks,

    Phani.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member


      Hi Harminder,

      i usually use an FM in my programs for this issue.

      FM:

      Import-Paramters:

      I_CHAIN_ID TYPE RSPC_CHAIN

      I_DATE_FROM TYPE SYDATUM

      I_DATE_TO TYPE SYDATUM

      Export-Paramters:

      E_ACTIVE_STATUS TYPE RSPC_STATE

      Exceptions:

      NO_DATA_FOUND

      DATE_FROM_IS_NOT_MAINTAINED

      Source-Code:

      FUNCTION Z_CHECK_PROCESSCHAIN_ACTIVE.
      **** Get the statuses of a single process chain
      DATA: lt_date_range TYPE RANGE OF sydatum,
      ls_date_range LIKE LINE OF lt_date_range.
      **** Build a range for the optional i_datum parameter
      IF i_date_from IS NOT INITIAL AND
      i_date_to IS NOT INITIAL.
      ls_date_range-sign = 'I'.
      ls_date_range-option = 'BT'.
      ls_date_range-low = i_date_from.
      ls_date_range-high = i_date_to.
      ELSEIF i_date_from IS NOT INITIAL AND
      i_date_to IS INITIAL.
      ls_date_range-sign = 'I'.
      ls_date_range-option = 'EQ'.
      ls_date_range-low = i_date_from.
      ELSEIF i_date_from IS INITIAL AND
      i_date_to IS NOT INITIAL.
      RAISE date_from_is_not_maintained.
      ENDIF.
      APPEND ls_date_range TO lt_date_range.

      **** Select the process chain status data
      SELECT *
      FROM rspclogchain INTO TABLE t_rspclogchain
      WHERE chain_id = i_chain_id AND
      datum IN lt_date_range

      ORDER BY datum DESCENDING zeit DESCENDING.
      IF sy-subrc <> 0.
      e_active_status = ''.
      ENDIF.

      **** Check if the chain is running (status = A)
      READ TABLE t_rspclogchain TRANSPORTING NO FIELDS
      WITH KEY analyzed_status = 'A'.
      IF sy-subrc = 0.
      e_active_status = 'A'.
      ELSE.
      e_active_status = ''.
      ENDIF.
      ENDFUNCTION.

      Use in your program:

      IF lv_pchain IS NOT INITIAL.
      CALL FUNCTION 'Z_CHECK_PROCESSCHAIN_ACTIVE'
      EXPORTING
      I_CHAIN_ID = lv_pchain
      I_DATE_FROM = SY-DATUM
      I_DATE_TO = SY-DATUM
      IMPORTING
      E_ACTIVE_STATUS = lv_pc_status
      TABLES
      T_RSPCLOGCHAIN = it_pc_status.
      IF lv_pc_status <> 'A'.
      "Start Process Chain
      CALL FUNCTION 'RSPC_CHAIN_START'
      EXPORTING
      i_chain = lv_pchain
      IMPORTING
      e_logid = lv_logid
      EXCEPTIONS
      error_message = 1.
      lv_status = 'A'.
      WHILE lv_status EQ 'A'.
      WAIT UP TO 30 SECONDS.
      CALL FUNCTION 'RSPC_API_CHAIN_GET_STATUS'
      EXPORTING
      i_chain = lv_pchain
      i_logid = lv_logid
      IMPORTING
      e_status = lv_status.
      ENDWHILE.
      ENDIF.
      ENDIF.
      ENDIF.

      -----

      Works fine for me. In case of questions, just contact me.

      Kind regards

      Edit: Just found again the orginial post from where i took the FM:

      Wait for Other Process Chain to Finish

  • author's profile photo Former Member
    Former Member
    Posted on Oct 01, 2014 at 07:11 AM

    Hi,

    You can place the same program in your chain after DSO make the link as only successful.

    By this way the program will run after completion of DSO load.

    Regards,

    Vikrant

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Vikrant,

      I cannot place my remaining program as my requirement is to trigger the process chain and if gets completed then fetch the data from the DSO .After that some manipulation is done on the data.

      Thanks for your reply in advance.

      Regards

      Harminder

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.