Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Check for BDC in SD_COND_SAVE_A Badi

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

muneshpatwari
Active Participant
0 Kudos

Hi Salil,

Just put a check in the exit "if SY-BINPT is initial" before the workflow triggering logic.

Regards,

Munesh.

8 REPLIES 8

Clemenss
Active Contributor
0 Kudos

Hi Salil,

{code}

IF SY-BATCH IS INITIAL.

* Here is Online Unse

ELSE.

* Here is Batch mode (BDC)

ENDIF.

{code}

Regards

Clemens.

Former Member
0 Kudos

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

muneshpatwari
Active Participant
0 Kudos

Hi Salil,

Just put a check in the exit "if SY-BINPT is initial" before the workflow triggering logic.

Regards,

Munesh.

0 Kudos

Hi Munesh,

I will try this system variable check and will get back with the result.

Thanks,

Salil Bagchi

0 Kudos

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?

0 Kudos

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.

chaouki_akir
Contributor
0 Kudos

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


0 Kudos

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.