Jusitification of IF statement in code
Hi,
I am working on a code win which i have to display that if the storage location is scrap i.e.(SC01,SC02,SC03,SC04) then it will display the data other wise it will make MGEIG EQ 0.
i am facing the problem at if statement where i had mentioned that if this storage location is not of scrap then it should be zero but it is nod ing so.
Please provide me guidelines as how do i achieve this functionality in my code.
here's the code:-
SELECT A~PRUEFLOS B~MBLNR C~LGORT FROM QALS AS A
INNER JOIN QAMB AS B ON B~PRUEFLOS = A~PRUEFLOS "AND B~ZEILE = A~ZEILE
INNER JOIN MSEG AS C ON C~MBLNR = B~MBLNR AND C~MJAHR = B~MJAHR
INTO TABLE ITSC "(l_PRUEFLOS , l_MBLNR, l_LGORT)
FOR ALL ENTRIES IN STIT
WHERE A~PRUEFLOS EQ STIT-PRUEFLOS." AND ( LGORT = 'SC01' OR LGORT = 'SC02' OR LGORT = 'SC03' OR LGORT = 'SC04' )." AND A~ZEILE EQ STIT-ZEILE. AND ( LGORT = 'SC01' OR LGORT = 'SC02' OR LGORT = 'SC03' OR LGORT = 'SC04' ).
SORT ITSC BY PRUEFLOS.
ITSC1[] = ITSC[].
SORT ITSC1 BY LGORT.
LOOP AT STIT.
IF STIT-MGEIG GE 0.
*LOOP AT ITSC1 WHERE PRUEFLOS EQ STIT-PRUEFLOS.
READ TABLE ITSC1 WITH KEY PRUEFLOS = STIT-PRUEFLOS.
w_tabx = sy-tabix.
L_lgort = ITSC1-LGORT.
IF L_LGORT NE 'SC01' OR L_LGORT NE 'SC02' OR L_LGORT NE 'SC03' OR l_LGORT NE 'SC04' .
* IF ( L_LGORT NE 'SC01' OR 'SC02' OR 'SC03' OR 'SC04' ).
STIT-MGEIG = 0.
MODIFY stit INDEX w_tabx TRANSPORTING mgeig.
endif.
*ENDLOOP.
ENDIF.
modify stit.
clear w_tabx.
clear l_LGORT.
ENDLOOP.
SORT STIT BY MATNR MGEIG.
LOOP AT STIT.
WRITE:/ STIT-PRUEFLOS,STIT-CHARG,STIT-LGORTCHARG,STIT-MGEIG.
ENDLOOP.
Hi Rick
It seems you've post the same questions twice.
Anyway your code is good but u need to use AND instead of OR in your IF condition, because u want to your storage location is not equal to SC01 AND not equal to SC02.....
If you use OR the IF condition will be alway true, infact for example:
IF LOGRT <> 'SC01' OR LGORT <> 'SC02' OR LGORT <> 'SC03' OR LGORT <'SC04>.
IF lgort is SC01, it's not equal to SC02 so IF condition is true.
So your code has to be:
LOOP AT STIT.
IF STIT-MGEIG GE 0.
*LOOP AT ITSC1 WHERE PRUEFLOS EQ STIT-PRUEFLOS.
READ TABLE ITSC1 WITH KEY PRUEFLOS = STIT-PRUEFLOS.
w_tabx = sy-tabix.
L_lgort = ITSC1-LGORT.
*IF L_LGORT NE 'SC01' OR L_LGORT NE 'SC02' OR L_LGORT NE 'SC03' OR l_LGORT NE 'SC04' .
IF L_LGORT NE 'SC01' AND L_LGORT NE 'SC02' AND L_LGORT NE 'SC03' AND l_LGORT NE 'SC04' .
STIT-MGEIG = 0.
MODIFY stit INDEX w_tabx TRANSPORTING mgeig.
endif.
ENDIF.
ENDLOOP.
Max
Similar Messages
-
Hi,
I am currently receiving the following error in BI Answers when I run a query against a Microsoft SQL 2005 Server.
View Display Error
Odbc driver returned an error (SQLExecDirectW).
Error Details
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 16001] ODBC error state: 60 code: 8180 message: [DataDirect][ODBC 20101 driver][Microsoft SQL Server]Statement(s) could not be prepared.. [nQSError: 16001] ODBC error state: 60 code: 102 message: [DataDirect][ODBC 20101 driver][Microsoft SQL Server]Incorrect syntax near 'UserName'.. [nQSError: 16002] Cannot obtain number of columns for the query result. (HY000)
SQL Issued: SELECT 0 s_0, "SD&A_Dashboard_Test"."BORIS_ALIAS_ETMS_Users"."Id" s_1, "SD&A_Dashboard_Test"."BORIS_ALIAS_ETMS_Users"."UserName" s_2 FROM "SD&A_Dashboard_Test" WHERE ("BORIS_ALIAS_ETMS_Users"."UserName" = 'trowe') FETCH FIRST 65001 ROWS ONLY
I am able to connect successfully to the Data Source and run a query against the database using the NQCMD command line tool so believe I have configured the DataDirect 7.0.1 drivers correctly, also I am able to view the Table Data in the RPD Physical Layer in the BI Administration Tool. So don't understand why I am getting this error.
I have also activated the nquery.log but that doesn't really give me any further information.
[2015-04-28T16:37:22.000+00:00] [OracleBIServerComponent] [TRACE:4] [USER-34] [] [ecid: 4a9e440f990ba0a4:-1995d2c5:14d00d3ef04:-8000-00000000000001c6,0:1:1:5] [tid: 5f] [requestid: 6f11000b] [sessionid: 6f110000] [username: borisdev] -------------------- Query Status: [nQSError: 16002] Cannot obtain number of columns for the query result. [[
[nQSError: 16001] ODBC error state: 60 code: 102 message: [DataDirect][ODBC 20101 driver][Microsoft SQL Server]Incorrect syntax near 'UserName'..
[nQSError: 16001] ODBC error state: 60 code: 8180 message: [DataDirect][ODBC 20101 driver][Microsoft SQL Server]Statement(s) could not be prepared..
[nQSError: 43119] Query Failed:
I was wondering if anyone could shed any light on what could possibly be causing the [DataDirect][ODBC 20101 driver][Microsoft SQL Server]Incorrect syntax near 'UserName'.. error ? And also provide any suggestions on how I can troubleshoot this issue further as I am now completely out of ideas of what to do next having tried numerous things i.e. setting IDENTIFIER_QUOTE_CHAR = '' in DBFeatures.INI which I found in similar posts on the subject all to no avail
Regards,
Tom RoweHi Rajagopal,
Thanks for your reply after doing some further investigations this morning I found and corrected the problem...
The DataDirect Driver does not like double quotes in the query for some reason, testing using the BI Answers generated SQL with the nqcmd tool below...
With double quotes “” it fails immediately
Give SQL Statement: select T18706."Id" as c1, T18706."UserName" as c2 from "ETMS_Users" T18706 where ( T18706."UserName" = 'trowe' )
select T18706."Id" as c1, T18706."UserName" as c2 from "ETMS_Users" T18706 where ( T18706."UserName" = 'trowe' )
[102][State: S1000] [DataDirect][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Incorrect syntax near 'Id'.
Statement execute failed
With double quotes removed for just the columns I now get the Error near ‘ETMS_Users’ which still had the double quotes
Give SQL Statement: select T18706.Id as c1, T18706.UserName as c2 from "ETMS_Users" T18706 where ( T18706.UserName = 'trowe' )
select T18706.Id as c1, T18706.UserName as c2 from "ETMS_Users" T18706 where ( T18706.UserName = 'trowe' )
[102][State: S1000] [DataDirect][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]Incorrect syntax near 'ETMS_Users'.
Statement execute failed
With all double quotes removed it works !
Give SQL Statement: select T18706.Id as c1, T18706.UserName as c2 from ETMS_Users T18706 where ( T18706.UserName = 'trowe' )
select T18706.Id as c1, T18706.UserName as c2 from ETMS_Users T18706 where ( T18706.UserName = 'trowe' )
c1 c2
42499 trowe
Row count: 1
Give SQL Statement:
The solution to fix the problem is...
In the BI Admin Tool Physical Layer Database, Properties Features tab is to delete the double quote in the Value column for IDENTIFIER_QUOTE_CHAR, setting this in the DBFeatures.INI file does not resolve the problem possibly it did in earlier versions of the product.
Regards,
Tom Rowe -
Org model by State & Zip code - ORGMAN_7 - set default if no entry
Orgman_7 10000164 works well for us. But if no country, state, zip code is found it errors as no org object is found.
How can I set a default org if no country state zip is found?
in CRMC_ORGPROF I set 10000164 as the org model determination rule, then I tried to create a responsibilitiy rule based on document type and added the document type as an attribute in the org model but did not work.
Thanks,
GlennHi Ashish,
In PPOMA_CRM for the organizational elements that represent our sales offices we maintain the Country, State, & Postal Codes (some have hundreds of entries as some states have multiple sales offices in territory, but a single sales office controls a single postal code).
A new customer calls our ICWC and we create a new BP, using ORGMAN_7 works well when the state & zip code exist as an attribute. It finds that sales office and sales org it is assigned to.
If no entry is found, then the ICWC user gets numerous error messages all related to no organization being found. If an order is created it fails to pass to R/3 until we correct the document. Usually done in the GUI as there is no place in the ICWC to update the sales org.
Basically looking to have a dummy office get found if no entry is found in ORGMAN_7. This would allow the order to pass to R/3 and then we could more easily work entries that his the dummy office (update PPOMA_CRM when a bad zip or state combo is entered.) Sometimes is a typo on the user in creating the BP record.
Thanks,
Glenn -
[nQSError: 16001] ODBC error state: S1000 code: Timeout
Hi, I am getting the following error when I go to make a new subject area
+++Administrator:2b0000:2b0004:----2010/02/12 18:48:02
-------------------- Query Status: Query Failed: [nQSError: 16001] ODBC error state: S1000 code: 12170 message: [Oracle][ODBC][Ora]ORA-12170: TNS:Connect timeout occurred.
I am running OBIEE on Windows connecting to my Linux box
I have the ODBC DSN Setup and tested
Also I am able to connect from BI Administration and update row counts
Help is appreciatedhere is my self written startBI.sh on Oracle Linux64
I am having an EBS R12 Instance for my database
#!/bin/sh
export ORACLE_HOME=/oracle/VIS/db/tech_st/11.1.0
LD_LIBRARY_PATH="/oracle/OracleBI/server/Bin:/oracle/VIS/db/tech_st/11.1.0/lib32"
export LD_LIBRARY_PATH
PATH=$PATH:/oracle/OracleBI/server/Bin
export PATH
TNS_ADMIN=/oracle/VIS/db/tech_st/11.1.0/network/admin/VIS_sgt
export TNS_ADMIN
cd /oracle/OracleBI/setup
./run-saw.sh start
./run-sa.sh start
echo $PATH
echo $LD_LIBRARY_PATH
echo $ORACLE_HOME
cd /oracle/OracleBI/oc4j_bi/bin
. ./oc4j -start
cd $home
Another landmine is that you may need to use lib32
The gateway libraries in NSConfig.ini may point to 10g libraries.
This is OK if you have 10g but for 11g you may have to relink libclntsh.so.10.1
Hope this helps
All these roadblocks make you dig more, google, read docs experiment and try work arounds
Though this is frustrating we get to discover more about the engine. -
Hi Gurus,
Can some one guide me in resolving this issue.
I am facing this issue when i try to view data/update row count from __05 - Sample App Data (TimesTen)__ after implementing TimesTen data base during Sample apps Deployment.
*[nQs error: 16001] ODBC error state: S1000 code:15105 message: [TimesTen][TimesTen 11.2.1.8.0 ODBC driver][TimesTen] TT15105:USER BISAMPLE_TT requesting database creation isnot the instance administrator, only instance administrator can create database. --file "db.c",lineno 7900,Procedure "SbDbCreate",*
Your kind help will be appreciable.
Edited by: 804140 on Jan 26, 2012 10:06 PMHi,
This might help.
Not able to conncet to the dsn
Thanks. -
City, State Zip-code line...
Hi...
New here... Version 8.2.3 running in SAP.
Want to format a single address line from 4 individual fields... City, State Zip-code
Want the City, seperated from the State by a comma and 1 space.... and State seperated from the Zip-code by 1 space.
Examples...
Boston, MA 07884
Fountain Valley, CA 76877
How to do this in the form Layout?
In the Object Layout tab... I set the fields to "Expand to fit" in the width direction... but the City overlays the State...
I do not want... Boston, MA 07884 to accomodate longer City names.
For now... I format the single address line in the Interface ABAP code.
Thanks,
Dave T...Hi DaveT,
For starters you do not need to set the binding to None (Object > Binding palette). I had this in the example, because originally I didn't want the field to take part in the import XML.
When dealing with data, more often than not you really do want the objects set with a binding.
Using $record are you accessing the imported XML or a data connection? If so I would set up the data connection first and then bind the appropriate fields to that data connection.
The XFA Specification may help: http://partners.adobe.com/public/developer/xml/index_arch.html.
Hope that helps,
Niall -
"missing return statement" error code
well... i feel like such a n00b... I can't seem to figure out what the problem is with my code, if someone could help me, that would be great. I get an error saying 'missing return statement'. I know that I have some things in here that I don't need but I will need them as I go on making this program.
with this code:
import java.io.*;
import java.math.*;
public class Tester
public static int time = 0;
public static void main(String[] args) throws IOException
System.out.println("Welcome to the 2008 Java Games!!!");
time=1000;
delay(100);
//Method Name: delay
//Method Arguments: used to wait for a given time
//Goal of Method: Delay for a given time
public static int delay(int time)
try {
Thread.sleep(time);
catch(InterruptedException ex) {}
time++;
}What does the error say? "Missing return statement"? Then I'm going to venture a guess and say that you're missing a return statement. If you don't know what a return statement is, then you have some learning to do:
http://java.sun.com/docs/books/tutorial/java/javaOO/returnvalue.html
Read that, then look at your delay() method and how you call it. And notice that you've made delay() of type "int".
Edit: Or just have someone else give you the answer :P
Edited by: newark on Feb 27, 2008 3:20 PM -
Correct Posting Manual Bank Statement - Transaction Code FF67
Hello,
It would be very grateful if someone can advice me on an issue pertaining to transaction code FF67.
A posting has been made with the wrong posting date. Also, the posted amount has not been recorded in FI because the amount posted was not allocated to any G/L Account.
The status of this posting is "Manual Posting Completed".
The questions, it is possible to delete this posted statement which has no effect on the accounts in FI.
Or, can this completed posting be edited ?
What will be the impact when the item is deleted.
Thanks and regards,
ElvisHi there,
What I mean about posting not hitting the GL accounts is, the balance of statement 99 is 3,000,000.00 and statement 100 is 3,500,000.00 for example, my current balance on the bank account bears the amount of statement 99.
Statement 100 has a status as posting completed, but one way or the other, the line items does not reflect in my bank account balance which should have been 3,500,000.00.
How would you reverse the entry that has a status "Posting completed"?
Thanks,
Elvis -
Hey all,
I attached the Java class we use to collect Coherence stats to display in our admin tool. Hopefully it will be useful to someone else. I'll keep this thread updated with the latest copy as well.
Provides the following stats about each cluster node:
* VM free memory
* VM total memory
* Local time (useful for apps that depend on local time between cluster members being the same on top of Coherence cluster time).
* Packet publisher stats (cpu time, packets sent, packets resent)
* Packet receiver stats (cpu time, packets received, packets repeated)
I also attached a screenshot of our cache admin tool in case anyone finds it interesting. I'll add a screenshot showing the per-cluster node stats in the near future.
Regards,
MattAttached are the files. Note: one thing you'll want to change in the code is the invocation service name be a service that you're already using in your application (so that it's gauranteed to be started on every node).<br><br> <b> Attachment: </b><br>CoherenceInfo.java <br> (*To use this attachment you will need to rename 19.bin to CoherenceInfo.java after the download is complete.)<br><br> <b> Attachment: </b><br>screenshot.png <br> (*To use this attachment you will need to rename 20.bin to screenshot.png after the download is complete.)
-
Batch Input Session empty while posting Manual Bank Statement T.Code FF67
Hi Experts,
I am trying to do the Bank Reconciliation by T.Code FF67.
The statement is getting saved but I could not see the Batch Insput Session (T.Code SM35) to post the entries.
Please help me in this issue.
Thanks in advance
PriyaHi,
Saving Bank Statement Data and Posting Statement are two different transactions.
Once both amounts (in FF67, Amounts Entered, Statement Amount at the bottom) are matched then if you save, it will save the data in FF67 format. In that screen only if you save again then it will post statement and create batch input session. Similarly you also processed or differently?
Check again in FF67 statement screen & revert back.
Sarma BH -
Manual Bank Statement(Match Code)
Hi All,
I am creating a manual bank statement . When i go to specifications and give my variant and match code for customers D and match code for vendors K and processing type 4. It is showing an error match code ID DEBI D does not exist. Please any body answer my question ASAP.
Regards,
Vikas.hi,
As per my idea i dont think so the standard sap provides such facility. -
City, state & zip-code DB
Hi,
Is there a free city, state and zipcode database available for US ?
Basically what I want is that I have two drop downs, 1 for state, 2 for city.
If a state is selected, cities for that state get populated from this database.
In the same way, if a zip code is entered, both the cities and state get populated from this db.
Thanks for all the help !Not that I know of....
-
Profit & Loss account Statement Transaction Code
Is there any separate report T code for Profit & Loss account Statement .
Moderator: Please, avoid asking basic questionsNew GL- S_PL0_86000028
classic gl - F.01
and some other imp tcode for trial balance, balance sheet as follows
Balance sheet and P/L Account
S_ALR_87012249 - Actual/Actual Comparison for Year
S_ALR_87012250 - Half-Year Actual/Actual Comparison
GL account balances
S_ALR_87012279 - Structured Account Balances
T-Code S_ALR_87012277 (Pgm RFSSLD00)
T-Code S_ALR_87012301 (Pgm RFSUSA00)
And Try below reports also, which will be usefull to you in GL, AR, and AP.
F.97, F.98, and F.99.
Hope this will help you. -
IF ELSE statement / CMOD Code in BEX Query
Hi
I have a requirement in Inventory flow.
Material stock value at the end of each quarter has to be calculator based on cycle count indicator. I have all the values on my cube.
In the report, Calender year and quarter is on the selection screen.
When user enters 2014 and Q2, Data for April, May and June are displaying on the report. But user want data only for June.
At the end of quarter 2 is June, so he wants only Material stock value at the end of June.
If a material stock level is changed in April and May and not changed in June, not data is available for June in my Cube.
In this case for Quarter 2, if June data is missing, it has to look for May data. Even if MAY data is missing, it will have to look for April.
Even if April data is missing, it will have to look for March data.
The result should be
Plant Q1 Q2 Q3 Q4
XYZ 100 100 100 100
If there is no change to stock level in April, May & June - at the end of Quarter 2, the stock value should be 100 as it was in end of Q1.
If no change was dont to stock level until December, the stock level should be 100.
Is there a way out using IF ELSE statements or through CMOD customer exit.
Regards,
Elango MurgesanHI Elango,
the user input on CALQuarter always would be Single value??or can we expect ranges as well?
if single value,
then we can achieve it by having one more dummy KF.
lets say. user input is Q2.
-> in your dummy KF, restrict the Calquarter/Calmonth to last quarter(i.e Q1)using customer exit and make the logic as you said above(last value based on calmonth).(make this KF hidden, as this is not required to display)
-> and in another KF restricted with Q2.Same logic, last value on Calmonth.((make this KF hidden, as this is not required to display)
and now you have 2 KFs in your report. So in a formula, you can have condition-> if Q2 KF is blank, then Q1KF, else Q2 KF.
Hope you are getting my idea.. Please try this and let us know.
** if Q1 also null, then we can extend customer exit logic to may be last one year, and having last value on based on calendar month, we can still achieve i guess.
Regards,
Sakthi. -
Type X conversion In Overlay statement(Refer code)
Hi all,
Following are the lines of code where we are getting an 'Type X' error in the system, the exact error description is 'REPLSET is not (of type C, N, D, T)'
PLEASE REFER THE RELEVANT CODE BELOW----
>
DATA: BEGIN OF REPLSET,
LINE0(16) TYPE X VALUE '000102030405060708090A0B0C0D0E0F',
LINE1(16) TYPE X VALUE '101112131415161718191A1B1C1D1E1F',
LINE2(02) TYPE X VALUE '2227',
LINE7(01) TYPE X VALUE '7F',
LINE8(13) TYPE X VALUE '8182838485868788898B8D8E8F',
LINE9(14) TYPE X VALUE '909192939495969798999B9D9E9F',
LINEA(11) TYPE X VALUE 'A0A4A6A8A9AAABACADAEAF',
LINEB(15) TYPE X VALUE 'B0B1B2B3B4B5B6B7B8B9BABBBCBDBE',
LINED(01) TYPE X VALUE 'DF',
END OF REPLSET.
Transfer Variables
DATA: SREP(4000) TYPE C.
DATA: BEGIN OF B0004 OCCURS 1,
CHECKTABLE LIKE DD08VV-CHECKTABLE,
FORTABLE LIKE DD08VV-FORTABLE,
FORKEY LIKE DD08VV-FORKEY.
DATA: END OF B0004.
LOOP AT B0004.
OVERLAY B0004 WITH SREP ONLY REPLSET.--> Error
CONCATENATE
B0004-CHECKTABLE
B0004-FORTABLE
B0004-FORKEY
INTO TRANSREC
SEPARATED BY TRANSSEP.
PERFORM TRANS.
ENDLOOP.Hello Kunal,
your solution
DATA: BEGIN OF replset,
line0 TYPE c LENGTH 32 VALUE '000102030405060708090A0B0C0D0E0F',
line1 TYPE c LENGTH 32 VALUE '101112131415161718191A1B1C1D1E1F',
line2 TYPE c LENGTH 4 VALUE '2227',
line7 TYPE c LENGTH 2 VALUE '7F',
line8 TYPE c LENGTH 26 VALUE '8182838485868788898B8D8E8F',
line9 TYPE c LENGTH 28 VALUE '909192939495969798999B9D9E9F',
linea TYPE c LENGTH 22 VALUE 'A0A4A6A8A9AAABACADAEAF',
lineb TYPE c LENGTH 30 VALUE 'B0B1B2B3B4B5B6B7B8B9BABBBCBDBE',
lined TYPE c LENGTH 2 VALUE 'DF',
END OF replset.
Bye,
Peter
Maybe you are looking for
-
How to Change the Default Font in Firefox 4 ?
How to Change the Default Font in Firefox 4 , for this >> http://store2.up-00.com/Mar11/AJG18655.png << ?
-
Time machine accessing files on an external hard drive
I backed up my iMac desktop at work onto an external hard drive. I can see the files, but they are all locked. When I go to open, I receive the following message "The folder (whatever the name is) can't be opened because you don't have permission t
-
I can't believe it. I've had this 3g iPod with few problems for a couple of years now. I just installed iTunes 7 and the thing no longer works. My PC doesn't recognise it in any way. I've tried the 5Rs and can't get the majority of them to work. Can'
-
Kensington 120W Power Adaptor w/ 30G ipod
Using a new 30G 5thGen ipod. I bought the Kensington 120W power adaptor (#33197) to power my laptop, treo, and ipod on the road from a single device. Pretty handy, since it can charge from 110AC, an auto socket, or an airplane DC jack by changing the
-
How to change the column text in a tree? when the column length is very small, it should show the Heading from the Data Element.As the column length increases, column header should be Short Label,Medium Label,and long field label??