Showing posts with label custom ABAP program to trigger process chain. Show all posts
Showing posts with label custom ABAP program to trigger process chain. Show all posts

Wednesday, November 22, 2023

Triggering Process chain through Program based on TVARVC Flag or DSO/ADSO Data

 

In this Post ,We will create a program which triggers a process chain when Flag from TVARVC is X or based on DSO/ADSO value.

 

Let us consider a scenario where we have TVARV flag Variable which we can change in STVARV T-code. Based on that flag we need to trigger.

So, we are reading that flag and trigger the process chain in the program using the below Function Module.

*&---------------------------------------------------------------------*
*& Report ZPC_TRIGGER_FLAG
*&---------------------------------------------------------------------*
*& (PC Trigger) Program
*$ Created on 07/11/2023
*&---------------------------------------------------------------------*
REPORT ZPC_TRIGGER_FLAG.

DATAV_FLAG TYPE C.

SELECT SINGLE LOW FROM TVARVC INTO V_FLAG WHERE NAME 'ZV_PC_TRG_FLG' .

IF V_FLAG 'X' ).

  
CALL FUNCTION 'RSPC_CHAIN_START'
  
EXPORTING
    I_CHAIN             
'ZPC_TRIGGER'.

  
ENDIF.



 

 

Let us consider Another scenario where Process chain needs to be triggered if we have data loaded to any DSO/ADSO.

 

*&---------------------------------------------------------------------*
*& Report ZPC_TRIGGER_FLAG2
*&---------------------------------------------------------------------*
*&  (PC Trigger) Program
*$ Created on 07/11/2023 
*&---------------------------------------------------------------------*
REPORT ZPC_TRIGGER_FLAG2.

DATAV_COUNT TYPE I.

SELECT COUNT(*FROM /BIC/AZADSOX2 INTO V_COUNT WHERE /BIC/ZDATE SY-DATUM.

IF V_COUNT > ).

  
CALL FUNCTION 'RSPC_CHAIN_START'
  
EXPORTING
    I_CHAIN             
‘ZPC_TRIGGER'.

  
ENDIF.



Then after triggering the Program the process chain will gets triggered automatically.

Featured Post

Extending/Increasing Key figure Length with custom Domain

  In this Post, We will learn how to increase Key figure length with new domain or custom Domain.   Go to RSD1 Tcode and enter NOHDB Tcode...

Popular Posts