01-25-2014 12:37 PM
Hello Experts,
I am creating a Condition records using transaction VK11 with certain condition type.
My purpose is to trigger workflow after the condition record is saved after giving all the input.
I have written the triggering logic for Workflow in EXIT "SD_COND_SAVE_A" as I found from other thread that there is no BO specific to pricing condition.
I am facing the issue when I am creating Condition record through BDC. Its triggering workflow and somehow not getting saved. But when I am creating Condition record manually, its trggering workflow but then getting saved as well.
Now I want to know if there is any check I can put in my logic that if transaction is run through BDC then it will skip triggering my Workflow else will trigger if created manually, that will solve my issue.
Can anyone suggest what could be the issue and how to solve it.
Thanks in advance.
01-25-2014 2:40 PM
Hi Salil,
Just put a check in the exit "if SY-BINPT is initial" before the workflow triggering logic.
Regards,
Munesh.
01-25-2014 1:45 PM
Hi Salil,
{code}
IF SY-BATCH IS INITIAL.
* Here is Online Unse
ELSE.
* Here is Batch mode (BDC)
ENDIF.
{code}
Regards
Clemens.
01-25-2014 3:36 PM
Hi Clemens,
I thought of checking this logic but haven't tried yet, will do and will let you know if it useful.
Thanks,
Salil Bagchi
01-25-2014 2:40 PM
Hi Salil,
Just put a check in the exit "if SY-BINPT is initial" before the workflow triggering logic.
Regards,
Munesh.
01-25-2014 3:35 PM
Hi Munesh,
I will try this system variable check and will get back with the result.
Thanks,
Salil Bagchi
01-30-2014 6:20 AM
Hi Munesh,
It worked, thanks.
I have another concern here though, now if I want to run the BDC and removing that check so that it will trigger my WF, its not getting Saved. Any idea about that?
01-30-2014 2:38 PM
Hi Salil,
If it works manually, it should work for BDC also. Just try using "COMMIT WORK & WAIT" after the BDC and check if it solves your problem.
Regards,
Munesh.
01-26-2014 2:41 PM
Hello,
what do you mean by "BO specific" ?
Can you show us the added code in the EXIT ?
In this EXIT, do you use COMMIT instruction ? If yes, this can be a problem.
Chaouki
01-30-2014 6:25 AM
Hi Chaouki,
I meant Business object, I have used BUS3005 for my purpose and used SAP_WAPI_START_WORKFLOW, Function module as there is no triggering event in above business object I have mentioned.
Below is the sample code for your reference, I have commented do_commit in it,
All I wanted to know if I am triggering WF through BDC then why my data is not getting saved.
CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
EXPORTING
task ='WS90000004'
* 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 = lv_ret_code
workitem_id = lv_wi
new_status = lv_status
TABLES
input_container = lt_cont
message_lines = lt_message
message_struct = lt_struc
agents = lt_agent.