on 10-01-2014 7:53 AM
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 .
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Harminder
Please understand and try what Vikrant and pani are suggesting and then see if it doesn't suit your requirement.
As per my understanding, you need to run a process chain. Once that process chain is completed, you should run a program to fetch data from a DSO which is loaded as a part of the process chain.
Our suggestion is to add the program as the last step in the process chain, so it will start only after the DSO is loaded.
For instance, this should be your process chain design
1) Start Variant
2) Loading to DSO (Infopackage/DTP)
3) Activation of DSO
4) Add a variant ABAP program and include your program to fetch data.
Hope this explains!!
Regards
Karthik
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:
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.