cancel
Showing results for 
Search instead for 
Did you mean: 

conditional process chain

Former Member
0 Kudos

hello,

is there a way, to return a success or failure code from ABAP routine to the process chain? i need to make conditional process chain. or is there any possible / better way making conditional process chain depending on a value in a table, ODS... ?

thanks in advance,

martin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Martin and welcome to the SDN!

I think a abab can at least end with a error code. So if it is a custom abap and the processing failed, raise a message of type E, A or X. Additionally you might think about raising different events depending on successful/unsuccessful termination and having another subchain waiting for the success event. In case you are talking about a standard abap you may need to embed it into a custom abap to achieve the same.

regards

Siggi

Former Member
0 Kudos

hi siggi,

thanks for answer! i am a newbie in abap and even whole SAP... i have been trying to find and return some error value recently, but haven't found it... is there any posibility to raise E,A or X from a routine?

thanks,

regards

martin

Former Member
0 Kudos

Hi Martin,

you only need to add the statement

message <msgty><msgno>.

to your coding.

<msgty>

I = information

W = warning

E = error

A = abort

X = short dump

S = success

<msgno>

a valid number of a message in your specified message-id.

Please check also the help for the abap keyword message. The easiest way for doing this is pressing F1 on the word if you are editing/displaying a abap in se38.

kind regards

Siggi

Former Member
0 Kudos

siggi,

a strange thing... it work fine while running routine with "message" in se38, but no effect in process chain... it just pass through the routine process, even when using 'X' type (not jaguar :o)) message.

best regards

martin

******************

i c, it seems i need to have abap program variant and for that i need screen selection... oh god... :o(

Message was edited by: Martin Hudik

Former Member
0 Kudos

Hi,

have a look at this HowTo (implement custom defined process type):

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/45d8a990-0201-0010-a290-f22...

we created a new processtype zabapredgreen and than created an abap which you can use in your chains:

REPORT zbw_status_red_green.

*

SELECTION-SCREEN BEGIN OF BLOCK eins WITH FRAME.

PARAMETERS: red RADIOBUTTON GROUP radi,

green RADIOBUTTON GROUP radi.

SELECTION-SCREEN END OF BLOCK eins.

*

IF NOT green IS INITIAL.

MESSAGE <b>i</b>162(00) WITH 'Status' 'Green'.

ELSE.

MESSAGE <b>e</b>162(00) WITH 'Status' 'Red'.

ENDIF.

/manfred

Former Member
0 Kudos

hi manfred,

thanks for answer and for the way... i am not at "my" SAP 🐵 now. i will try later.

regards

martin

Former Member
0 Kudos

hi,

i'm back. i'm trying to make my own process type, something general - condition, which depends on value in simple table - one field, if 0 then stop the process chain, if 1 then continue, but i have problems with all those methods... 🐵 as i said. i'm a newbie in abap programming, even in sap bw, but i will win! ;o)

martin

Former Member
0 Kudos

Hi,

let's have a look on your abap code.

/manfred

Former Member
0 Kudos

hi manfred,

from the link (pdf doc) you sent me i found, that i need to implement in general case at minimum those methods:

IF_RSPC_EXECUTE~EXECUTE

and

(IF_RSPC_GET_VARIANTGET_VARIANT, IF_RSPC_GET_VARIANTEXISTS, IF_RSPC_GET_VARIANT~WILDCARD_ENABLED while using IF_RSPC_GET_VARIANT interface)

or

(IF_RSPC_MAINTAIN~GET_HEADER while using IF_RSPC_MAINTAIN interface).

am i right?

thanks,

martin

Former Member
0 Kudos

Hi Manfred,

Thanks for this. It helped me to successfully create a new process type that returns the status of an ABAP report and add this to my process chain.

My scenario is this: We are using RSCRM_BAPI to populate a DB table with the resultset of a BW query, we then reference this data in the start routine of subsequently run update rules to control the load to an InfoCube.

We are currently having technical problems and cannot be confident in the job log and thus don't know if the RSCRM_BAPI has worked to populate the DB Table.

By using a new process type we are able to include an ABAP program in a process chain to:

1. check that the DB Table exists and

2. that it contains data

and then conditionally halt the processing of the Update Rules until the RSCRM_BAPI has run successfully.

Its all so simple when you know how

Many thanks,

Andrew

(SDN rocks!)

Former Member
0 Kudos

thanks manfred, siggi!

i solved it on my own, using unix (one text file and one short script)... maybe a bit dirty solution, but my pm wanted a quick solution and i can use it generaly too.

take care!

best regards,

martin

Answers (0)