Skip to Content
0

Add Custom workflow log to Workflow overview - GOS for CJ02 Transaction

Dec 21, 2017 at 07:30 AM

259

avatar image

Hello All,

I have a new custom BO.By using this BO we are triggering an event on some particular changes in CJ02 transaction. event is triggering and workflow is working properly.

here the requirement is user will triggers the workflow and checks the workflow log through GOS. At present in the WF log there is already a standard log for BUS2054 was getting displayed.

I want to add my custom BO to "Generic Object Services" -> Workflow Overview to see my custom WF log to the existing.

Thanks & Regards,

Sundeep.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

8 Answers

Sandra Rossi Dec 21, 2017 at 09:03 PM
1

To add your own GOS service, create a class and maintain the table SGOSATTR, search the forum for more information.

Show 7 Share
10 |10000 characters needed characters left characters exceeded

Hi sandra.

Thanks for replying.My requirement is to add my workflow log in workflow overview. Not to add custom GOS sevices.

0

The workflow log only displays the workflows related to the current business object, not other business objects. Did you try storing the current business object into an element of your workflow container?

0

hello sandra,

Yes I tried storing my custom business object into an element in workflow container and generate instance by suing standard business object 'SYSTEM' and method 'GENERICINSTANTIATE'. But it was not fulfilling my requirement.

0

Okay. I've just checked. I don't think it's possible to do it using the standard, you can display only the workflow of the current object. You need to enhance the standard, use the ABAP trace and debugger to find the right place (be careful, I think that the display is done asynchronously in a new session).

1

Hi, I've checked it. By debugging displaying process of workflow log, it was written in this class CL_WF_SRV_OVERVIEW and method EXECUTE.

in this method there is an internal table lt_lporb here in this table we are having the data of objectkey, objectype and category.

so i have appended my custom BO to that internal table and then I have display of my custom workflow along with the standard.

please check the code and help me to enhance the standard.

here is the code for the pirticular method.

METHOD execute.
  DATA:
    ls_lporb TYPE sibflporb,
    lt_lporb TYPE sibflporbt,
    lp_lines TYPE i.

* application or customer may add further objects for the overview
  CREATE OBJECT go_badi.
  CLEAR lt_lporb.
  APPEND gs_lporb TO lt_lporb.
  CALL METHOD go_badi->if_ex_gos_mult_publish~add_objects
    EXPORTING
      flt_val  = gc_srvc
    CHANGING
      ct_lporb = lt_lporb.

  DESCRIBE TABLE lt_lporb LINES lp_lines.
  if lp_lines = 0.
    CALL FUNCTION 'SWI_WF_CONNECTIONS_DISPLAY' DESTINATION 'NONE'
      EXPORTING
        ibf_object = gs_lporb
      EXCEPTIONS
        OTHERS     = 1.
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

  elseif lp_lines = 1.
    read table lt_lporb index 1 into ls_lporb.
    CALL FUNCTION 'SWI_WF_CONNECTIONS_DISPLAY' DESTINATION 'NONE'
      EXPORTING
        ibf_object = ls_lporb
      EXCEPTIONS
        OTHERS     = 1.
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.

  elseif lp_lines > 1.
    CALL FUNCTION 'SWI_WF_CONNECTIONS_DISPLAY' DESTINATION 'NONE'
      EXPORTING
        IBF_OBJECTS = lt_lporb
      EXCEPTIONS
        OTHERS      = 4.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE 'S' NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  endif.
ENDMETHOD.
1

This portion of code seems great : look, there's a BAdI named GOS_MULT_PUBLISH, and method ADD_OBJECTS. Create one implementation (transaction SE19). Search GOS_MULT_PUBLISH in SCN for more information.

When you have finished successfully with your code, I let you add your own answer so that other people interested can easily find it, mark it "best answer", and close the question. Thanks.

1

I just tried, it works very well. It displays the workflow logs of all objects determined by the method ADD_OBJECTS. In the filter of your implementation, indicate WF_OVERVIEW. In the method, make sure to add objects only if input parameter FLT_VAL = 'WF_OVERVIEW' in case there are future implementations for other GOS services.

1
Mike Pokraka Dec 26, 2017 at 09:29 AM
1

Just create an instance of the relevant CJ02 object (project I think?) in your workflow container and it will appear in GOS. Simple.

Share
10 |10000 characters needed characters left characters exceeded
Mike Pokraka Dec 27, 2017 at 12:10 PM
1

I just checked and CJ02 is indeed a project. You're adding a WBS element.

I don't know if CJ02 will identify all the WBS elements belonging to a project via GOS, so that is one possibility. Else your key might be wrong. WBS elements have different internal/external formats. Do you see the instance in the WF log?

If you see an instance then you definitely need the project (BUS2001). If not, try creating an instance using the correct key (you can even just edit an existing WF container just to test), and then see if it appears in GOS.

Share
10 |10000 characters needed characters left characters exceeded
Stéphane Bailleul Dec 21, 2017 at 12:15 PM
0

Hi

I am wondering why you have not created a delegated object of BUS2054 but you certainly have your reasons

DATA: * BORIDENT TYPE BORIDENT,

BOR type SIBFLPOR GOS_MANAGER TYPE REF TO CL_GOS_MANAGER.

BOR-TYPEID = 'ZMDT'.

BOR-INSTID =

BOR-CATID = 'BO' or 'CL'

CREATE OBJECT GOS_MANAGER

EXPORTING IS_OBJECT = BORIDENT EXCEPTIONS OTHERS = 1.

Share
10 |10000 characters needed characters left characters exceeded
Stéphane Bailleul Dec 21, 2017 at 12:15 PM
0

Hi

I am wondering why you have not created a delegated object of BUS2054 but you certainly have your reasons

You'll have to add this in the transaction (or something similar)

DATA: * BORIDENT TYPE BORIDENT,

BOR type SIBFLPOR GOS_MANAGER TYPE REF TO CL_GOS_MANAGER.

BOR-TYPEID = 'ZMDT'.

BOR-INSTID =

BOR-CATID = 'BO' or 'CL'

CREATE OBJECT GOS_MANAGER

EXPORTING

IS_OBJECT = BORIDENT

EXCEPTIONS

OTHERS = 1.

There are lots of example available via google to add GOS to transaction

Cheers

Stephane

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hello Stephane,

Thanks for the reply. My requirement is to add my custom business object to workflow log in GOS > workflow > workflow overview. Not to add GOS to transaction.

Please help me on it.

0
Anjan Paul Dec 22, 2017 at 11:50 AM
0

Hi ,

Are you want to add custom message in Workflow Log? If yes, just raise the Error message from underlying methods.

Thanks.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Anjan,

thanks for replying. could please help me in more detail how to do that and resolve this problem.

0
sundeep kolavennu Dec 27, 2017 at 04:42 AM
0

Hi Mike,

Thanks For Replying. I Did the same . I've Created a instance with BUS2054 which is relevant to the CJ02

and then created a task in my workflow with standard 'SYSTEM' BOR and 'GENERICINSTANTIATE' method.

Done Binding

Am I missing anything else..

even after this I am not able to find my custom wf log in GOS of CJ02 transaction.


Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 19 at 12:14 PM
0

have you solved this issue? I am facing the same problem .

Please let me know how you solved it.

Share
10 |10000 characters needed characters left characters exceeded