cancel
Showing results for 
Search instead for 
Did you mean: 

Problem When Transferring Values from program to workflow

Former Member
0 Kudos

Hi Friends,

I am new to workflow. I have tried simple workflow which is called from program.

My workflow will send mail with purchase order no. Workflow is working fine, but problem is purchase order is not transferred to workflow. I have created a container element in workflow as import parameter and defined its character as ABAP dic data type. EBELN.

Purchase order Value in Mail box is : 00000000010C. I am provind my code below.

Kindly help me in this regard .

INCLUDE:<cntn01>. "All Default Macros Defined here.

********Workflow Declaration

DATA: t_task TYPE swr_struct-task,

retcode TYPE sy-subrc,

workitemid TYPE swr_struct-workitemid,

newstatus TYPE swr_wistat,

wf_status TYPE swl_status,

it_cont TYPE TABLE OF swr_cont ,

wa_cont TYPE swr_cont,

obj_key TYPE swr_struct-object_key,

ret_code TYPE sy-subrc,

event_id TYPE swr_struct-event_id,

ebeln TYPE ebeln VALUE '5500002034'.

********Define Container.

swc_container t_wf_cont.

********Create Container.

swc_create_container t_wf_cont.

********Clear Container.

swc_clear_container t_wf_cont.

swc_set_element t_wf_cont 'EBELN' ebeln.

t_task = 'WS99700002'.

CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'

EXPORTING

task = t_task

  • LANGUAGE = SY-LANGU

DO_COMMIT = 'X'

  • USER = SY-UNAME

  • START_ASYNCHRONOUS = ' '

  • DESIRED_START_DATE =

  • DESIRED_START_TIME =

  • DESIRED_START_ZONLO = SY-ZONLO

  • IFS_XML_CONTAINER =

IMPORTING

RETURN_CODE = retcode

WORKITEM_ID = workitemid

NEW_STATUS = newstatus

TABLES

INPUT_CONTAINER = t_wf_cont

  • MESSAGE_LINES =

  • MESSAGE_STRUCT =

  • AGENTS =

.

*CALL FUNCTION 'DB_COMMIT'

  • .

Thanks in advance,

Senthil kumar.

Accepted Solutions (1)

Accepted Solutions (1)

surjith_kumar
Active Contributor
0 Kudos

Hi,

Check the Binding. Re-generate and check it again.

Regards,

Surjith

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

Thank u once againg. I did it my self. Point assigned. I have changed my code.

DATA:t_wf_cont TYPE TABLE OF swr_cont WITH HEADER LINE.

wa_object-objtype = 'EBELN'.

wa_object-objkey = '5500002034'.

t_wf_cont-element = 'EBELN'.

t_wf_cont-value = wa_object-objkey.

APPEND t_wf_cont.

wa_object-objtype = 'LIFNR'.

wa_object-objkey = '110272'.

t_wf_cont-element = 'LIFNR'.

t_wf_cont-value = wa_object-objkey.

APPEND t_wf_cont.

Remaining code same as above.

Regards,

S.Senthil kumar.

Former Member
0 Kudos

Hi Friends,

Thanks for your reply and sorry for my late reply. I did not come yesterday.

I tried everything as you guys suggested .But Still same result. I Have defined simple workflow which receive PO number from my program. My workflow has only one step thatu2019s Mail step.

My answer for surjith & arghadip: Wt should I check in binding . I am providing Binding definition below.

Binding workflow -> step u2018Pomailu2019. ( Upper Part Binding)

Workflow Step Po mail

&EBELN& &EBELN&

&EXPRESS&

&TYPEID&

&_WF_INITIATOR &ADDRESSSTRINGS&

&_ATTACH_OBJECTS& &ATTACHMENTS&

Binding Workflow <- Step u2018PO mailu2019 ( Lower Part Binding)

&EBELN& &EBELN&

_My answer for Rick _ : I tried as u said. I am getting Message like

Message type: S , Line: Task started under work item ID 000000429380 (current status: In Process) .

_My answer for Soumya _: I checked properties of ebeln both in prg and workflow , it is same. I have defined container variable EBELN as a Import parameter. All letters in CAPS only.

Kindly help me guys.

Thanks in Advance.

S.Senthilkumar.

Former Member
0 Kudos

Hi Senthil,

Please check the properties of EBELN . Is it an import parameter in the workflow?

Also check the data definition of EBELN is the same in workflwo and program. Finally check the case of the field EBELN in workflow. Is it all CAPS??

Regards,

Soumya

former_member185167
Active Contributor
0 Kudos

Hello,

Add this:

data: lt_messages type standard table of SWR_MESSAG.

and in the call:

MESSAGE_LINES = lt_messages

to see if there are any messages (always a good idea).

regards

Rick Bakker

Hanabi Technology

bpawanchand
Active Contributor
0 Kudos

I think there is no need of explicity calling the DB_COMMIT FM

Former Member
0 Kudos

Please check whether this value is transferred in the Workflow Container through the Workjflow Log. If yes then check the binding from Wflow to Task container.

Thanks

Arghadip