cancel
Showing results for 
Search instead for 
Did you mean: 

triggering workflows

Former Member
0 Kudos

hi all

i am using SWE_EVENT_CREATE function module to trigger my event as follows

DATA: KEY LIKE swetypecou-objtype.

DATA: EVENT_CONTAINER LIKE SWCONT OCCURS 0 WITH HEADER LINE.

swc_create_element event_container 'I_LFA1' .

SWC_SET_ELEMENT event_container 'I_LFA1' i_lfa1.

KEY = i_lfa1-lifnr.(value from work area)

CALL FUNCTION 'SWE_EVENT_CREATE'

EXPORTING

objtype = 'Z_VEND'

<u><i><b>objkey = 'key</b></i></u>

event = 'CHECK'

  • CREATOR = ' '

  • TAKE_WORKITEM_REQUESTER = ' '

  • START_WITH_DELAY = ' '

  • START_RECFB_SYNCHRON = ' '

  • NO_COMMIT_FOR_QUEUE = ' '

  • DEBUG_FLAG = ' '

  • NO_LOGGING = ' '

  • IDENT = IDENT

  • IMPORTING

  • EVENT_ID = EVENT_ID

TABLES

EVENT_CONTAINER = EVENT_CONTAINER

EXCEPTIONS

OBJTYPE_NOT_FOUND = 1

OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

commit work.

ENDIF.

i am getting an error that the key specified is not allowed as it is not of type that is allowed in parameter objkey.

any pointers will be really helpfull

regards

navjot

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hai navjot sharma

declear the data statement likethis and follow the following sample code.

DATA: KEY LIKE SWEINSTCOU-OBJKEY.

KEY = '1163'.

CALL FUNCTION 'SWE_EVENT_CREATE'

EXPORTING

objtype = 'BUS1001006'

objkey = KEY

event = 'CREATED'

regards

rose.

KKilhavn
Active Contributor
0 Kudos

Pretty much what Samson already said, isn't it?

Answers (3)

Answers (3)

RKSK
Participant
0 Kudos

Hi,

Thanks for your help and support friend.

Thanks and Regards,

Rachit khanna

Message was edited by:

Rachit Khanna

Former Member
0 Kudos

Guys it is against forum guidelines to post your email addresses, please refrain fom doing it, Rachit can you take it out please.

Navjot

Your commit work is inside the IF statement, keep it outside for goodness' sake!

You are doing a sy-subrc <> 0 check and doing a commit in there!

Former Member
0 Kudos

thanks guys

sometimes small things are overlooked.

regards

navjot

Former Member
0 Kudos

Hi Navjot,

Please change the declaration of the variable KEY to the following

DATA: KEY LIKE swetypecou-objkey. ( not objtype).

Hope this will help.

Regards,

Sam