on 07-17-2014 9:24 AM
Hi Workflow Experts,
I have a scenario like, When purchase order creator deleted the itemline 10,20,30 and added 40,50,60 itemline,its getting triggered mail as below screenshots. But the question is why the email content(Old values) is different between two screen shots which is respectively taken from SWI2_FREQ and SOST.!
In screenshot 1 : SWI2_FREQ shows old values which are deleted and new values which are added newly. (Which is correct)
In Screenshot 2 : SOST doesn't displayed the old values, but only new values are displayed. (Which is wrong)
Could you please anyone can help me out in this case !!!!. Thank you so much in advance.!!!
Hi Kavi
As mentioned by Anjan and Rahul , these are two different steps.
You need to check your workflow definition and see what data is not passed to the email step leading to missing values in "Old Values" table .....most probably a case of missing binding (however it all depends how this WF is designed).
Regards,
Modak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay Kavi!!!
You can check in SWDD and give the WF number....check the steps....go to email step -> control tab -> see the binding between WF and email task
Well, if you are new to WF and do not know binding, you should involve a workflow guy to resolve this issue because learning workflow and then resolving may take some time
regards,
Modak
Hi Modak Gupta,
Thank you for your inputs. I have to work on it as no workflow consultant is available currently. Now my first question is that ,SOST is a Tcode where we can view the status of the sent mails from SAP right?. Then generally we use to create mail notification triggering for Workplace(SBWP) only, Not to SOST right?. Then is it possible ,because of workflow binding problem only,not displayed the old values in SOST? Pls advise me to give some knowledge regarding this?. And my 2nd question is that there are 2 PO email steps in WF. Below 2 screen shots are the binding values for those 2 PO mail steps. Can you see any discrepancy in those 2 binding screens?. Please advise in this case if you can then. It would be of immense help to me for get close to this issue. Thank you in advance.
Hi Kavi
too many things are going on! I will try to answer as many as possible.
From WF we can send mail to SBWP or even outside (visible in SOST)..... many ways to do that.....I will not confuse with all that stuff right now.
Now coming to your issue of OLD data not showing in the Email.
First, see how it is shown in the Decision Step -> go to the decision step-> control tab -> See the task description -> they must be using some variable (table type) in the task description to populate the Contents of OLD data -> note that variable (most probably a table type - multiline container element). Now, in the decision step control tab-> check the binding from WF to Decision step. See which container element of WF populates the noted element of the decision task description. This would hold the values of OLD content in the workflow instance at runtime.
Now check all email steps which are sent out - check their task description in the same way. Are these building the content the same way as the decision item? if yes, locate the placeholder variable for OLD content and see if binding data contains an input to this variable from the workflow.
Conceptually, consider the whole workflow as a background program -> each step is like a function call -> binding is the passing of signature data to 'functions' and receiving from functions. The task description uses variables to display dynamic data -> the data is passed via binding (signature).
Looking at your email steps, both seems to go to the Workflow Initiator -> is that correct email you are looking for? If not, the design may be sending an email from some exit or something else and may not be in the wf.
Ascertain that when this email is sent out -> on trigger of wf or something else is the trigger?
It would be good if you can get to the documentation of this workflow - that is the Tech Spec or the FS.
Regards,
Modak
AND to learn workflow, get your hands on to this book : Workflow Book - Practical Workflow for SAP
Modak Gupta wrote:
AND to learn workflow, get your hands on to this book : Workflow Book - Practical Workflow for SAP
Ahem, there's a new edition out in the next couple of weeks:
As with the second edition, all authors' proceeds are donated to Médecins Sans Frontières (MSF) International, so by buying the book you will help people all over the world.
Hi Modak Gupta,
Thank you so much for your clear explanation. It helps a lot. I am parallely studying workflow as well, I will try to learn as much as i can. Then coming to your point,
1. I have checked in decision step --> task description. I see the below 1st screen shot where i could see the variable to populate the content of OLD data.
2. In the binding performance also they have used the variables to populate the OLD values(2nd Screen shot).
So the concern is that as above operation is being linked correctly we have got the correct OLD values in SBWP. But not getting the point why in SOST not displayed the OLD values since SOST is a Tcode where we can view the status of the sent mails from SAP. That is in SBWP i could see the OLD value then why i cant view via SOST. Mostly SOST is a reflection of what it have shown in SBWP right?. Thanks in advance.
Hi Kavi
SOST is not a reflection of SBWP.
SBWP is your workflow inbox which contains Work Items and/or notifications (which are not outbound emails....are just "internal" emails)
SCOT contains outbound emails from SAP...and not just workflow!
So, you workflow would have two steps - one - DECISION - which is correctly seen in your SBWP
and the email - which may have missing binding of CTDCONTENTS_OLD
If you do not have any such emails, check if there is any enhancement in your posting transaction which is sending the email (outside of the WF). Or a program exit -> In the decision step-> check 'program exit' tab -> check if there is any EXIT there -> check that in SE24
Or check tab Methods for any post or secondary methods behind sending the email.
regards,
Modak
Hi Modak,
Yes you are right. The CTDCONTENTS_OLD variable & what they have used for binding the old values in decision step are not available in mail step binding(screen shot1 & 2). There are 2 mail step. I dont see the old values binding in both email steps. Even both mail step has the same class(ZCL_MM_PO_WIT_AE_EXIT) in program exit tab. Pls have a look those bindings in mail steps. May be this is the reason for not printing the OLD values ?. Also could you pls mention where we use to designing the output screen for SOST(Screens shot3)?
Hi Kavi
Check the task number of the mail steps (in control tab) . Go to TCode PFTC and supply the task type as TS and number (without the leading TS). Then click on tab Description. There is where you provide the email content.
Make sure that the current task of the email steps look similar to your email, if not, then I guess the email is not set out from here. If it matches, see if the task Container tab has a variable to receive the OLD content (same type as CTDCONTENTS_OLD) from workflow to task binding AND the same container element is listed in Container Description at the right place
Did you check ZCL_MM_PO_WIT_AE_EXIT methods? Are they generating the email (check the class in SE24).
Regards,
Modak
Hi Modak,
I have checked the task description for both task. Both has the same task number('TS99900075') and both task descriptions are not matched to my current issue email content. So here they have not used to linked. Then i have checked the class(ZCL_MM_PO_WIT_AE_EXIT). I think here they are generating the email content. But i am not sure how to debug it. Because as you know,ABAP debugging is not suitable for Workflow. Below is the class methods and sample coding(After WI Creation). Pls have a look and advise on this.
Hi Kavi
So we found the place where the issue is.... the developer sends a workitem and using exits they sends the email ......now be careful with the program exits as they get triggered for every state change in a work item lifecycle....that is, when it is BEING created , when it IS CREATED, AFTER Execution......
But before you debug, see the code carefully...it is reading the WORK ITEM CONTAINER ....see which variables are being read. How is the LT_WI_CONTAINER Populated?
Simulate it by calling a FM in SE37 - SAP_WAPI_READ_CONTAINER (or something like that... I do not have system access) ... give the work item ID (not the Workflow Work item ID but the decision Item ID of an existing example) ... see if you have the data in container.....also check if in workflow log you see those variables being populated in the decision container.
now coming to debugging....
In your code, there must be a place where the code is checking for state and event ....you have to debug after that.
The approach to debug is dirty...and can be done in development only .. You have to put an endless loop... do. if lv1 = lv2. exit. endif. enddo ....where lv1 and lv2 have default values as 1 and 2. The wrkitem will go in an endless loop when the state reaches (the state after which you have put the endless loop) then go to SM50 and debug the hung process.....make sure you have rights to change variables in debugging...change lv1 accordingly and debug the rest and see why OLD Container elements are NOT read in the email. MAKE SURE THAT YOU REMOVE THE CODE THE MOMENT YOU ARE DONE all instances triggered after you activate the code will hang....and will stay hanged even if you change it back.....so be careful that no one else is testing the workflow.
Regards,
Modak
Hi Modak,
Thank you for your valuable inputs...It helps immensly I will get back to you once i done that. And , Is there any way to debug that coding place in display mode(not to give the loop condition to coding)? Like,Can i put debug point to the particular coding line to check? So that if i do any PO changes manually,it will trigger that line so that i can debugg that place right?.Is it possible?
Hello,
The first screenshot shows the workitem content and the second one is definitely not the workitem text. They are 2 different steps. You need to check the method other than the workitem.
Regards,
Rahul Kulkarni
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you have to check how email sent and How email data was populated
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anjan paul,
Thanks for your swift response. My question is why the change details on the SAP is different from the email notification. Because the email notification which was sent via workflow is correct with showing the old values. But in SAP tcode SOST where doesnt show the old value which was deleted.
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.