Multiple condition checking question
Hi I have a newbie question -
if ((temp == null) && (!temp.text.equals(""))) {
statement;
If temp really is null, would this give a compiler error? or would it simply break after the first condition?
Thanks,
Mike
whatsupdoc wrote:
Hi I have a newbie question -
if ((temp == null) && (!temp.text.equals(""))) {
statement;
If temp really is null, would this give a compiler error?Compile it and see.
I'm curious though what you're trying to accomplish. You seem to be confused about the meaning of &&.
or would it simply break after the first condition?&& and || are "short-circuit" operators. They stop evaluating once the truth of the operation is known. So if the first operand to && is false, it stops there and does not evaluate the second, since the result of the && must be false, regardless of what the second operand is. Likewise, if the first operand to || is true, then it doesn't evaluate the second one, because the result is true regardless.
Similar Messages
-
Multiple condition check using if statement.
Hi
i NEED to check two conditions using if statment. I was wondering whether it is possible.
say fields zx and zy in an internal table itab. if one of those is intiial i have to display a message.
i tried this way
if itab-zx or itab-zy is initial.
error message.
endif.
It gives me error in syntax check.
I think i can check for first field using if and second one with elseif but for that matter of fact i have like 10 fields .out of which even one is initial i have to throw a message saying 'DATA CANNOT BE SAVED'.
Please suggest me how to go about this.
Thanks in advance.Hi Swathi,
You have to loop your internal table and then check.
Try this code.
LOOP AT itab.
IF itab-z1 IS INITIAL OR
itab-z2 IS INITIAL OR
itab-z3 IS INITIAL OR
itab-z4 IS INITIAL OR
itab-z5 IS INITIAL OR
itab-z6 IS INITIAL OR
itab-z7 IS INITIAL OR
itab-z8 IS INITIAL OR
itab-z9 IS INITIAL OR
itab-z10 IS INITIAL.
MESSAGE 'DATA CANNOT BE SAVED' TYPE 'E'.
ELSE.
" Processing if none of the fields are Initial
ENDIF.
ENDLOOP.
Regards,
Arun Sambargi. -
Multiple condition check using decode
HI All,
I have a new requirement and need your help .
need to check the follwing condidtions in a sql statement.
a) we have a status coulmn which has values like 1,2,3,4,5,6,7 based on some other coulmns . this status will keep on repeat based on values in other coulmns.
each status will update one by one. ( ie, update of status1 to status2 takes 3 min of time ) and status4 to status5 takes 10 min of time.
i need to select the rows which exceeds the above time limit.
ie )
if Time taken for (status1 to status2) change is > 3min then select that row.
and if Time taken for (status14 to status5) change is > 10min then select that row.the query will run on every 10 min,and if any of the status not changed ,
ie )
for eg), trunc( (sysdate-modifieddate)*24*60 ) > 15, we need to select those rows.
Below shows example of the data . , if you see the record3 ( which in status2)
if modidifeddate <sysdate by 15 min , that record need to be selected.
its applicable for other status also . Plz help me
paytrxkey Groupid Payref status Modifieddate
15198595 GHK02793 Q0003119 1 12/6/2006 8:49
15198673 GHK02793 Q0003120 1 12/6/2006 8:49
15275420 GSG00764 Q0007162 2 12/6/2006 8:49
15275421 GSG00764 Q0007163 1 12/6/2006 8:49
15275425 GSG00764 Q0007167 2 12/6/2006 8:49
15275427 GSG00764 Q0007169 1 12/6/2006 8:49
15310160 GHK04571 Q0000138 3 12/6/2006 9:00
15275426 GSG00764 Q0007168 1 12/6/2006 9:02
15275424 GSG00764 Q0007166 4 12/6/2006 9:02
15275423 GSG00764 Q0007165 1 12/6/2006 9:02
15275422 GSG00764 Q0007164 4 12/6/2006 9:02
15404354 GAE00099 Q0014834 1 12/6/2006 9:06 -
Void multiple PY checks not through off cycle work bench
Hello,
We had a scenario where we had to void nearly 60 regular PY checks in our previous period. The postings to FI did not happen yet. We went to off cycle work bench and voided 60 checks one after the other.
Is there any quicker way to void multiple PY checks (If we know the check number to void). What if we run into a scenario where we need to void few hundreds.
Any advice is greatly appreciated.Hi Priya,
I feel you have got answer of this query.... as it was processed through another thread. I will request you to close this thread as for a question 2 threads are there. And if moderator will see it then they may block the thread.
- Praveen -
Deleting data from another table with multiple conditions
Hi frnds
I need to delete some data from a table based on multiple condition I tried following sql but its deleteing some rows which is not meeting the criteria which is really dangerours. When i trying = operator it returns ORa- 01427 single -row subquery returns more than one row
delete from GL_TXNS
where TRN_DT in (Select trn_Dt from GL_MAT)
and BR in (select ac_branch from GL_MAT)
and CODE in (select CODE T from GL_MAT)
and (lcy_amt in (select lcy_amt from GL_MAT) or
fcy_amt in(select fcy_amt from GL_MAT)
rgds
ramyaMy answer is the same as Avinash's but I will explain a little bit more.
ORa- 01427 single -row subquery returns more than one rowmeans that you have a subquery that Oracle is expecting one value from that is returning multiple values. In your case you need one value for the equijoin ("=") and you are getting more than one value back. The error happens even if all the values are the same - multiple values being returned will cause the error.
The solution is to either allow multiple values to be returned (say, use the IN condition istead of "=") or only return one value if possible (say, forcing one value by using DISTINCT, GROUP BY, or a WHERE clause condition of ROWNUM=1) - but these workarounds must be checked carefully to make sure they work correctkly -
Mail step should be sent to all the users in multiple condition
hi experts,
I have a requirement on invoice posting.Say if invoice amount is 1000 then person A can post the invoice.
if >= 1000 person B can post the invoice.
If >=2000 person C can post the invoice.
what i have did is, created a multiple condition and then based on the inv amount assigned 3 methods for invoice posting.My problem is if a person posts an invoice amount of 1000.A mail has to be sent to Person B and C informing that an amount of 1000 is posted with user id.Same for person B, ie mail should be sent to person A and C informing regarding invoice posting.Now inside the multiple condition i cannot assign mail step.Coz based on the condition it will go to a particular user for invoice posting but where as mail should be sent to all the users.So how can i achieve this??.Hi Priyanka,
I am getting 1 thing why you need need multiple conditions. No need to create any multiple conditions.
1. Create a rule using transaction PFAC. (you can use the example as Rule: 0000168).
a. Create an function module with table parameters as ACTOR_TAB (type SWHACTOR) and AC_CONTAINER (Type
SWCONT). You can aswell copy the FM used in 168 rule and change it. check the logic mentioned below.
b. In PFAC transaction, go to container tab and create 2 container elements. For amount and Mail_indicator (type should be
same as that of the amount field in your workflow) .
2. Use this Rule in your workflow to send mail.
Logic:
""Lokale Schnittstelle:
*" TABLES
*" ACTOR_TAB STRUCTURE SWHACTOR
*" AC_CONTAINER STRUCTURE SWCONT
*" EXCEPTIONS
*" NOBODY_FOUND
INCLUDE <CNTAIN>.
DATA BEGIN OF ORG_OBJECT OCCURS 0.
INCLUDE STRUCTURE SWHACTOR.
DATA END OF ORG_OBJECT.
DATA: BEGIN OF NEW_AC_CONTAINER OCCURS 3.
INCLUDE STRUCTURE SWCONT.
DATA: END OF NEW_AC_CONTAINER.
DATA: V_AMOUNT TYPE <AMOUNT FIELD>.
DATA: V_MAIL_INDICATOR TYPE <FLAG>.
REFRESH: actor_tab.
Get the org-object under consideration. AMOUNT is the container name defined in your PFTC transaction
SWC_GET_ELEMENT AC_CONTAINER 'AMOUNT' 'V_AMOUNT'.
Get the org-object-type and the org-object id.
SWC_GET_ELEMENT AC_CONTAINER 'MAIL_INDICATOR' V_MAIL_INDICATOR .
Pass the org-object, the org-object-type and the org-object-id
to a new container.
The org object get a new name: ORG_AGENT.
SWC_SET_ELEMENT NEW_AC_CONTAINER 'AMOUNT' 'V_AMOUNT'.
SWC_SET_ELEMENT NEW_AC_CONTAINER 'MAIL_INDICATOR' V_MAIL_INDICATOR .
check for V_AMOUNT and V_MAIL_INDICATOR.
if the v_amount = 1000 .'
if v_mail_indicator = ' '.
actor_tab-OTYPE = 'US' .
actor_tab-OBJID = 'SAPUSER1'.
append actor_tab
else.
actor_tab-OTYPE = 'US' .
actor_tab-OBJID = 'SAPUSER2'.
append actor_tab
actor_tab-OTYPE = 'US' .
actor_tab-OBJID = 'SAPUSER3'.
append actor_tab
endif.
endif.
Similarly write the logic for other conditions.
This way you can use same for different purposes.
If you pass the indicator that means you are sending mail to other approvers for information.
Revert back if u need more help.
Regards,
Gautham -
I need your expert opinion on how to create a map with multiple conditions.
Hello.
I need your expert opinion on how to create a map with multiple conditions.
I have a procedure (which i cannot import or re-create in OWB due to the bug), so i am trying to create a map instead :-(
How can i create a cursors within the map?
My function creates table and cursor.
Then it will have to check for duplicates in the tables (the one created and another table) - the criteria for finding duplicates is a number of fields.I then need to place few different conditions (if some attributes are not available) and it has to load cursor based on this conditions. The next step is to fetch the data into the cursor based on what attributes are missing.
The next thing it will do is insert the data into table (if record doesn't exist), output the error in separate table is record is corrupted, or update the record with changed information.
In short i need to re-create match / merge but with conditions, iterations etc 'built into' it.
I can read up on available functions - it's just what would be the best options? and what would be the best approach to do so?
In my function i use %rowtype - but cannot use it in owb - so what would be the alternative? i don't really want to create a lot of variables and then have a nightmare of maintaing it. are there any tips regarding this?
having looked through Oracle dedupe - it's not really what i need because it is just DISTINCT.
I would appreciate any help / advise on this.
Thank you very muchthanks a lot for your reply - i will look into this option :-)
it is a bit more complicated now as i have to re-create the match / merge and then somehow 'tweak' it to achieve the result i need.
At the moment i am looking to breakdown the package into smaller chunks 'functions' and try creating the map that way.
Anyway, thank you very much for your suggestion. -
Multiple condition : Error when starting a SWITCH branch
Hi,
In our Z Leave Workflow,I am facing the errors listed below.
Error when starting a SWITCH branch
Error during CASE evaluation in SWITCH mode for node 0000000158
Operator 'EQ': The value of the left operand cannot be determined
Error in the evaluation of expression '<???>&REQ.STATUS&' for item '1'
Unable to determine the value of component ''
It gives error in Multiple condition Request Approved? which is similar to standard WF12300111 node number 158 (u can say copy of WF12300111
This multiple condition works in some scenario But it gives dump at other scenario .
I have checked the value of REQ.STATUS in runtime. It populates the value as 'POSTED' in runtime,
Please suggest if any solution on this.
Regards,
KalpeshHi There was some problem with task which was comprising class CL_PT_REQ_WF_ATTRIBS and APPROVE method. This method is to change the status of particular leave workitem.After running this particular task ,the status was not changin instantly.This method locks particular workitem and was releasing the workitem once the WF gets completed.Hence I was getting REQ.STATUS as sent.
I have changed that task with following code in new task...
DATA:
REQUEST_ID TYPE PTARQ_DEDUCTION-REQUEST_ID,
request TYPE REF TO if_pt_req_request,
new_status TYPE tim_req_status.
SWC_GET_ELEMENT CONTAINER 'REQUEST_ID' REQUEST_ID.
CALL FUNCTION 'ENQUEUE_EPTREQ'
EXPORTING
mode_ptreq_header = 'E'
request_id = request_id
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE w058(hrtim_abs_req) WITH request_id.
ELSE.
CALL METHOD ca_pt_req_header=>agent->get_request
EXPORTING
im_request_id = request_id
IMPORTING
ex_request = request.
execute state transition
CALL METHOD request->initiate_state_transition
EXPORTING
im_transfer_event = 'APPROVE'
IMPORTING
ex_new_status = new_status.
COMMIT WORK.
CALL FUNCTION 'DEQUEUE_EPTREQ'
EXPORTING
request_id = request_id.
ENDIF.
This will create new status for leave item during WF processing.
Apart from that also added Wait for 2 minutes after that task....
Thanks for your help.
Regards,
Kalpesh -
Table Rows with Multiple Conditions Not Showing Up in RH
Hi everyone,
I'm currently evaluating TCS2 (Framemaker 9 and RoboHelp 8 on Windows XP) and have come across the following issue:
One of our FrameMaker source files contains a table in which one of the rows has multiple conditions applied. When one of the conditions is shown in Framemaker, and the others are hidden, the row is displayed in Framemaker as expected. However, when the file is then imported or linked into Robohelp, the same table row vanishes, even though the Apply FrameMaker Conditional Text Build Expression check box is selected in the Framemaker Conversion Settings > Other Settings screen. This only appears to affect table rows - when paragraph text is tagged with the same conditions, it is imported correctly into RoboHelp.
For example, when Condition B is shown and Condition A is hidden in the Framemaker file, the content appears like this in Frame:
Unconditional
Unconditional
Condition A and Condition B applied
Condition A and Condition B applied
Condition B applied
Condition B applied
Paragraph text with Condition A and Condition B applied.
Paragraph text with Condition B applied.
When the same file is imported into RoboHelp, the row with both conditions applied is absent from the table:
Unconditional
Unconditional
Condition B applied
Condition B applied
Paragraph text with Condition A and Condition B applied.
Paragraph text with Condition B applied.
Installing patches 8.0.1 and 8.0.2 did not resolve the issue (and actually caused other, unrelated issues) and I see the same behavior regardless of whether I import or link the FrameMaker document.
Has anyone else seen this issue? Any help would be much appreciated.
Thanks
DaveBIt just seems that the items I select as align to top in the
property inspector should force the items to the top of their
cells, unless I'm missing something. -
About case and switch in multiple condition step in workflow.
i ve some information about case and switch in multiple condition in workflow.
case - static determination
switch - runtime determination.
but i want brief explanation about case and switch and difference please help me.....hi velmurugan............
in case,
we can have only one value for comparison and can have any number of branches for it.
in switch,
we can compare any number of values and have any number of branches.
eg:
consider i am triggering a workflow for purchase order change and i am having a multiple condition step.
if i am going for a case:
i can have only on value (ie po number/vendor number.....) as a parameter and can check different values with it. ( eg vendor number < 1000
vendor number > 1000.... so on)
a branch will be created for each condition.
if i am going for a switch:
i can take any parameter needed. (eg: vendor number > 1000
order type = 'NB' .... so on)
so a single branch can have any number of comparisons with the help of 'and' and 'or' operators and i can have any parameter for my condition.
---regards,
alex b justin -
How to set a Multiple condition for a single CFL
Hi everyone,
Hey guys, i have a problem filtering a CFL (ChooseFromList)
where i have to select records
WHERE U_SalesmanCode = <ConVal>
AND U_Status = <ConVal>
so i've some up with an idea setting up multiple conditions on a single CFL.
i have a function "SetCFLConditions" that will be called after the CHOOSEFROMLIST_EVENT was triggered. this will set the conditions on a loop method.
the CODE works fine. but it only accepts the last condition.
Public Sub SetCFLConditions(ByVal _chooseFromList As String, _
ByVal _alias As String, _
ByVal _operation As SAPbouiCOM.BoConditionOperation, _
ByVal _condVal As String)
Dim oCFLCollection As SAPbouiCOM.ChooseFromListCollection = _form.ChooseFromLists
Dim oCFL As SAPbouiCOM.ChooseFromList = oCFLCollection.Item(_chooseFromList)
Dim oCons As SAPbouiCOM.Conditions
Dim oCon As SAPbouiCOM.Condition
Dim asAlias() As String = _alias.ToString.Split(",")
Dim asCondVal() As String = _condVal.ToString.Split(",")
Dim i As Int16
oCFL.SetConditions(Nothing)
'oCons = oCFL.GetConditions()
For i = 0 To asAlias.Length - 1
oCons = oCFL.GetConditions()
oCon = oCons.Add
'//LOOP CONDITIONS
With oCon
.Alias = asAlias(i)
.Operation = _operation
.CondVal = asCondVal(i)
End With
Next i
oCFL.SetConditions(oCons)
End Sub
Pls. Help
Thanks
Edited by: Roger Arce on Apr 17, 2009 12:14 PM
Edited by: Roger Arce on Apr 17, 2009 12:15 PMHai Roger Arce
Better you post your question in SDK forum
Edited by: Prasanna s on Apr 17, 2009 12:52 PM -
Multiple Conditions\Actions in a Workflow
I am in the process of creating an expense approval form with a workflow that has two Approval stages. In the first stage, however, the approver would be dynamic based on a selection in the form. The second stage approval would go to the same
person\group. What's the best\correct way to do multiple\conditions\actions in a single step? As an example of the workflow:
If Field1 equals Value1 Assign a task to Person1. If Associated Task is Approved create a new Task and Assign it to Person 10
there would be about 12 different iterations of the first step, Value2 Assign to Person 2 and so on.Hi pjs, it depends on who the person is/how they're related to the selection on the form. If it's the user's manager, you can get that information by using the link below. If there's no real correlation to the selection made, then you'd have to make a list
with two columns- "selection" and "person to email." Then check that list against the selection and get the corresponding email for the particular approver.
http://www.sharepointanalysthq.com/2011/04/user-profile-data-in-sharepoint-designer-workflows/
cameron rautmann -
Multiple conditional incorrect response feedbacks
I am a Flash novice using the Flash Quiz template and trying
to create multiple conditional incorrect feedback responses for
each question. Currectly the array only has one asset dedicated to
providing feedback for an incorrect response. Is there a quick and
easy way to add two more conditional incorrect feedback responses?
:Hi,
I was wondering if you had found a solution to the Multiple conditional incorrect feedback responses? I would like to know if it is possible to assign an incorrect statement to a specific option. For example if the user selects A) they get one answer and if they select C) they receive a different response. I found away to have 2 incorrect statements but they are not specific to a response: (Example, If the user gets the question wrong the first time they get one answer and if they get the question wrong a second time they get another answer but the answers are not specific to the option chosen.
Thanks, -
Multiple condition does not work
Hi,
I took a copy of the standard Leave request workflow (WS12300111) to a new workflow (WS90000002).
The class that was used in this workflow (CL_PT_REQ_WF_ATTRIBS) was also replaced with a copy (ZHR_CL_PT_REQ_WF_ATTRIBS).
The workflow is used for the approval of leave requests.
Now in the workflow there is a multiple condition which verifies whether the request was approved, rejected or withdrawn (this was also there in the standard).
The condition contains the rules:
Approved &REQ.STATUS& = POSTED or &REQ.STATUS& = APPROVED or &REQ.STATUS& = ERROR
Withdrawn &REQ.STATUS& = WITHDRAWN
Other values Rejected
--> REQ is an object of the class mentioned above. The rules were created in the normal way by clicking on the object in the container.
The workflow always stops at this condition, because it can not define the value of REQ.
If I check the container in the workflow report, the field REQ and its STATUS are correctly filled.
What could be wrong here?
Thanks,
WimHi,
I solved it...
Just had to add a commit work to the task that is executing the status change of the request.
Kr,
Wim -
If Statement Multiple Conditions
Using LiveCycle, FormCalc or JavaScript.
I am trying to create an if statement with multiple conditions.
a Sum field calculates a series of numeric input fields. I want the result in the Sum field to determine the expression in a final field.
If the Sum is <30MM then "50000" also if the Sum is >30MM but <60MM then "125000" also if the Sum is >60MM but <100MM then "250000" also if the Sum is >100MM but <300MM then "375000" also if the Sum is >300MM then "500000"
I have only been able to figure out a single if then for the first condition but not able to include the whole set of conditions and the multiple results.
Help would be much Appreciated!
Thank you in advance.Tried a few variations of this and still seem not
to be able to find a solution to this issue. I'm surprised my google searches are bringing up better examples because there seems to be an example of everything else.
Any more detailed advive?
Maybe you are looking for
-
How do I get my money back if my daughter bought a game 4 times?
My daughter had bought a game, but she saw that it didn't do it so she tried three more times. The problem was that y card wasn't listed. So when I listed it, it bought it 4 times. I only got my money back for one, I need it back for the other two to
-
How to get a trial version of the Adobe Acrobat PDF Library ?
And I'm also looking for a trial version of the Adobe Acrobat Capture® SDK Thanks Frederic
-
Line Out Cable for 5th Gen Nano?
Well Apple changed things up again and the line out cables/adapters don't work on the 5th generation Nano. Anyone find any that do?
-
Console Message with Aperture 3
Howdy, Just noticed that I'm getting the message 2/14/10 10:04:03 AM Aperture[1581] Warning: <NSTreeController: 0x11ace0f30>[object class: NSObject] childrenKeyPath cannot be nil. To eliminate this log message, set the childrenKeyPath attribute in In
-
Photoshop elements 12 stopped working after swapping mainboard
Hi everybody! On a Win 7 Pro PC the PSE 12 Photo Editor stopped working after swapping the defective mainboard. I tried uninstall and reinstall as admin, with disabled security software. We always get the welcome screen from where you launch organize