cancel
Showing results for 
Search instead for 
Did you mean: 

BW-BPS: Running a Process Chain through Exit Function

Former Member
0 Kudos

Hi,

I would like to run a process chain through a Planning Function of type Exit Function. For this, as i have read in other posts in the forums, two Function Modules can be used:

RSPC_CHAIN_START that initiates directly a process chain and

BP_EVENT_RAISE that can trigger an event which is included in the start process of the process chain

So, i have to create a new FM that calls one of these function modules.

Any suggestion on which of the 2 FMs i hould use?

Can someone tell me what should be the Interface Definition of this FM and, if possible, the code? (I'm still a novice in writing code)

I understand that i need to enter this FM in the FM initialization of the exit function while i should fill a "dummy FM" in the Function Module.

Is this correct? An ABAPer coleague doesn't think that having "dummy FMs" is not the best approach to my problem.

can u share your expertise on this?

Thanx in advance

Fragi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Fragi,

We are using FM RSPC_CHAIN_START for executing our process chains, so my vote goes for this one.

Also in past when we used some FM in BPS, we did not used any intialization FM and it worked without that also.

Hope it helps...

Regards,

Ashish

Answers (3)

Answers (3)

Former Member
0 Kudos

Ashish, Matthias, Andrey thank you for your help and recommendations

I managed to create the exit function that runs the Process Chain

This is what i did:

I created a function module that calls FM: RSPC_API_CHAIN_START:

FUNCTION z_bps_imptest_init.

*"----


""Local Interface:

*" IMPORTING

*" REFERENCE(I_AREA) TYPE UPC_Y_AREA

*" REFERENCE(I_PLEVEL) TYPE UPC_Y_PLEVEL

*" REFERENCE(I_METHOD) TYPE UPC_Y_METHOD

*" REFERENCE(I_PARAM) TYPE UPC_Y_PARAM

*" REFERENCE(I_PACKAGE) TYPE UPC_Y_PACKAGE

*" REFERENCE(IT_EXITP) TYPE UPF_YT_EXITP

*" REFERENCE(ITO_CHASEL) TYPE UPC_YTO_CHASEL

*" REFERENCE(ITO_CHA) TYPE UPC_YTO_CHA

*" REFERENCE(ITO_KYF) TYPE UPC_YTO_KYF

*" EXPORTING

*" REFERENCE(ET_MESG) TYPE UPC_YT_MESG

*" REFERENCE(ETO_CHAS) TYPE SORTED TABLE

*"----


DATA:

lv_proc_chain TYPE rspc_chain,

lw_exitp LIKE LINE OF it_exitp,

wa_et_mesg TYPE upc_ys_mesg.

READ TABLE it_exitp INTO lw_exitp

WITH KEY parnm = 'I_CHAIN'.

lv_proc_chain = lw_exitp-chavl.

CALL FUNCTION 'RSPC_API_CHAIN_START'

EXPORTING

i_chain = lv_proc_chain

  • I_T_VARIABLES =

  • I_SYNCHRONOUS =

  • I_SIMULATE =

  • I_NOPLAN =

  • IMPORTING

  • E_LOGID =

EXCEPTIONS

failed = 1

OTHERS = 2

.

IF sy-subrc <> 0.

wa_et_mesg-msgid = sy-msgid.

wa_et_mesg-msgty = sy-msgty.

wa_et_mesg-msgno = sy-msgno.

wa_et_mesg-msgv1 = sy-msgv1.

wa_et_mesg-msgv2 = sy-msgv2.

wa_et_mesg-msgv3 = sy-msgv3.

wa_et_mesg-msgv4 = sy-msgv4.

APPEND wa_et_mesg TO et_mesg.

  • --->

EXIT.

ENDIF.

ENDFUNCTION.

I could not use directly the FM RSPC_API_CHAIN_START since it cannot get the value of the variable i_chain (the Process Chain technical name) from the Parameter Group of the planning function. This is done in the first lines of my FM (after the interface declaration)

This FM was used in the FM initialization and in the Function Module i used a dummy FM (It's just the interface declaration - there is such an FM in Function Group UPFX)

I entered a parameter name: I_CHAIN, Data element: RSPC_CHAIN in Parameter exit functions and gave the process chain technical name in parameter group that was created. Now, i execute the parameter group and the PC is starting

The next step that i want to do is use FM RSPC_API_CHAIN_GET_LOG to get a message if there is success or fail of PC.

Regards,

Fragi

Former Member
0 Kudos

Hi.

Follow [this thread|http://forums.sdn.sap.com/click.jspa?searchID=41086117&messageID=8621198].

Regards.

[Uryukin Andrey|http://il.linkedin.com/in/andreyuryukin]

SAP-BI Consultant, [Advantech|http://advantech.co.il/en/index.asp]

[My Blog|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/u/252016769] [original link is broken] [original link is broken];

Former Member
0 Kudos

hi Fragi,

to be on the save side you should use function RSPC_API_CHAIN_START, because it belongs to the API. As you can see in RSPC_API_CHAIN_START the function module RSPC_CHAIN_START is called.

Please check http://help.sap.com/saphelp_nw04/helpdata/en/a8/a6eae34c9e9b4cbd8fbc7acd2845d0/frameset.htm and

http://help.sap.com/saphelp_scm70/helpdata/EN/01/15843b74f7be0fe10000000a114084/frameset.htm as well.

Regards Matthias