BAPI commit without using Wait? need to get the data for created order
I am using BAPI to create or change sales order and by using 'BAPI_TRANSACTION_COMMIT' updating the database.
Immediately after that there is some requirement to fetch VBAP with the created order number, but there is no data found.
If i use call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'.
then i am able to fetch data from VBAP, but its impacting the performance. Is there any alternative way to get data without fetching or without using wait.
Can i use ABAP memory or SAP memory to get the details?
Please help...........
Hi Tapas379,
Yes technically you can:
set data before commit
DATA memory_id(20) TYPE c.
CONCATENATE 'VBAP_01_' sy-uname INTO memory_id.
DELETE FROM DATABASE indx(as) ID memory_id.
EXPORT vbap_tab = vbap_tab "<-input
TO DATABASE indx(as)
CLIENT sy-mandt
ID memory_id.
Get data from anywhere after setting it.
data memory_id(20) type c.
concatenate 'VBAP_01_' sy-uname into memory_id.
import vbap_tab = vbap_tab " ->output
from database indx(as)
client sy-mandt
id memory_id.
delete from database indx(as) id memory_id.
Thanks,
Duy
Similar Messages
-
Hi All,
I have a simple query which is below:-
Declare @reportdate date
set @reportdate= (DATEADD(dd,-5,getdate()))
select * from dbo.Table
where date IN (@reportdate)
I need this query to pull the data for the last 3rd business day .So lets say today is monday then i need the data for last week wednesday which is 3 business days back from monday, if today is a tuesday it would be for last thursday ( as 3 business days for
tuesday would be thursday). But if today is wednesday then i need to be last 3rd business day which is last friday and i also need to get the data for saturday and sunday.
Can someone please help me how cani change my filter to do this?
Please let me know if i am still unclear.
ThanksHi SqlDev12,
Based on my understanding on your requirement, you can reference the below sample.
CREATE TABLE BusinessTable
Bdate DATE,
Wd VARCHAR(10)
;WITH Cte(DT,WD) AS
SELECT CAST('20150401' AS DATE),DATENAME(WEEKDAY,CAST('20150401' AS DATE))
UNION ALL
SELECT DATEADD(DAY,1,DT),DATENAME(WEEKDAY,DATEADD(DAY,1,DT)) FROM Cte
WHERE DT<GETDATE()
INSERT INTO BusinessTable SELECT * FROM Cte
SELECT * FROM BusinessTable
SET DATEFIRST 7 -- Set Sunday as the first day of a week
DECLARE @givenDay DATE ='20150415' --Wednesday
SELECT * FROM BusinessTable
WHERE Bdate BETWEEN
--For Monday and Sunday, select last wednesday
(CASE WHEN DATEPART(WEEKDAY,@givenDay) IN(1,2) THEN DATEADD(DAY,2,DATEADD(WEEK,DATEDIFF(WEEK,0,@givenDay)-1,0))
--For Tuesday and Wednesday, last week's Thursday and Friday
WHEN DATEPART(WEEKDAY,@givenDay) IN(3,4) THEN DATEADD(DAY,-5,@givenDay)
--For Thursday and Friday, current week's Monday and Tuesday
WHEN DATEPART(WEEKDAY,@givenDay) IN(5,6) THEN DATEADD(DAY,-3,@givenDay)
--For Saturday, current week's Wednesday
ELSE DATEADD(DAY,2,DATEADD(WEEK,DATEDIFF(WEEK,0,@givenDay),0)) END)
AND
(CASE WHEN DATEPART(WEEKDAY,@givenDay) IN(1,2) THEN DATEADD(DAY,2,DATEADD(WEEK,DATEDIFF(WEEK,0,@givenDay)-1,0))
WHEN DATEPART(WEEKDAY,@givenDay) IN(3) THEN DATEADD(DAY,-5,@givenDay)
WHEN DATEPART(WEEKDAY,@givenDay) IN(4) THEN DATEADD(DAY,-3,@givenDay)
WHEN DATEPART(WEEKDAY,@givenDay) IN(5,6) THEN DATEADD(DAY,-3,@givenDay)
ELSE DATEADD(DAY,2,DATEADD(WEEK,DATEDIFF(WEEK,0,@givenDay),0)) END)
DROP TABLE BusinessTable
If you have any feedback on our support, you can click
here.
Eric Zhang
TechNet Community Support -
Unable to get tha data for Residual Order Plan query-0PS_C04_Q0008
Hi Xperts,
i have activated standard query-0PS_C04_Q0008.
But when i am executing the query i am unable to get the data for "Residual order plan" in the report output..
As i checked the transformation and the queries for this, every thing seems ok.
Could please suggest me the best way to check further or How can i get the data for this field?
Regards,
SAPCheck whether you have data for "Residual order plan" in 0PS_C04.
-
Need to get the date's.
Hi,
I need to get the dates in interval of 7.
My Scenario:
When my user gives the date as 04/01/2013. My output should be like
04/01/2013
04/02/2013
04/03/2013
04/04/2103
add of 4 dates. How can i acheive this in sql query? Could any one pls help me?
Regards,
Prasad k T,wilhelm wundt wrote:
Hi,
I need to get the dates in interval of 7.Your expected output is not talking about th einterval of 7 days..
>
My Scenario:
When my user gives the date as 04/01/2013. My output should be like
04/01/2013
04/02/2013
04/03/2013
04/04/2103Is this date dd/mm or mm/dd
If you need 4 consecutive dates, use
select input_date+level-1
from dual
connect by level <= 4;>
add of 4 dates. How can i acheive this in sql query? Could any one pls help me?
Regards,
Prasad k T, -
Upload the data for sales order using BAPI
hi experts,
how to upload the data for sales order using BAPI.
what is the FM?
it would be much helpful if i have the sample code as i am very new to BAPI.
thanks and Regards
ShyamHi Shyam
Its very useful for u
BAPISDORDER_GETDETAILEDLIST
BAPI_ACC_SALES_ORDER_CHECK
BAPI_ACC_SALES_ORDER_POST
BAPI_ACC_SALES_QUOTA_CHECK
BAPI_ACC_SALES_QUOTA_POST
Reward all the helpful answers..
With Regards
Navin Khedikar -
How to get the date for the first monday of each month
Dear Members,
How to get the date for the first monday of each month.
I have written the following code
SELECT decode (to_char(trunc(sysdate+30 ,'MM'),'DAY'),'MONDAY ',trunc(sysdate+30 ,'MM'),NEXT_DAY(trunc(sysdate+30 ,'MM'), 'MON')) FROM DUAL
But it look bith complex.
Abhishek
Edited by: 9999999 on Mar 8, 2013 4:30 AMUse IW format - it will make solution NLS independent. And all you need is truncate 7<sup>th</sup> day of each month using IW:
select sysdate current_date,
trunc(trunc(sysdate,'mm') + 6,'iw') first_monday_the_month
from dual
CURRENT_D FIRST_MON
08-MAR-13 04-MAR-13
SQL> Below is list of first monday of the month for this year:
with t as(
select add_months(date '2013-1-1',level-1) dt
from dual
connect by level <= 12
select dt first_of_the_month,
trunc(dt + 6,'iw') first_monday_the_month
from t
FIRST_OF_ FIRST_MON
01-JAN-13 07-JAN-13
01-FEB-13 04-FEB-13
01-MAR-13 04-MAR-13
01-APR-13 01-APR-13
01-MAY-13 06-MAY-13
01-JUN-13 03-JUN-13
01-JUL-13 01-JUL-13
01-AUG-13 05-AUG-13
01-SEP-13 02-SEP-13
01-OCT-13 07-OCT-13
01-NOV-13 04-NOV-13
FIRST_OF_ FIRST_MON
01-DEC-13 02-DEC-13
12 rows selected.
SQL> SY. -
How to get the date for the last day of a week?
Is there a easy way to get the date for the last day of week?
eg a week starts on monday and end on sunday
January 11, 2005 is the start date for the week
January 17, 2005 is the end date for the week
or
say
February 26, 2003 is the start date for the week
March 5, 2003 is the end date for the week
I just need a simple way of figuring that out....
I figured out how to get the start date for the week but just can't get the latter..
formatting of the date is not of a concern.. that I know how to do
thanks in advanceHow about something like the following?
Calendar someDay = new GregorianCalendar(2005,0,11);//2005 Jan, 11
//Note above that January is 0, not 1, as counting starts from 0.
someDay.add(Calendar.DAY_OF_MONTH,6); //add 6 days
java.util.Date lastDayOfWeek = someDay.getTime();
//If someDay was the start of a week, lastDayOfWeek should now be
//the last day of that week.
System.out.println(lastDayOfWeek.toString() ); -
Getting the data for the infotype 0006 and Subtype 4 in HR ABAP
Hi All,
I need to get the data from the info type 0006 and the subtype 4 , only i need to fetch the data in communications . Could you any one tell me best way to fetch that data.
Thanks,
SAP SAR.Write a select single on PA0006 for the given pernr begin and end dates and for subtype 4 ...
select single * from PA0006
where pernr = p_pernr
and SUBTY = '0004'
and ENDDA >= s_date-low
and BEGDA <= s_date-high. -
Where can we get the data for pre calculated reports
Hi,
i want to see the data for pre calculated reports (Reporting agent)
where can we get the data for pre calculated reports
Thanks & Regards,
Shaliny. MDear,
This feature of precalculating reports is to enhance the report performance. You will need to schedule this periodically, so that the report is fetched and cached. This allows faster retrieval of report data. Plz. understand that, this scheduling needs to run after every data load in the corresponding cube, so that, the latest data is cached, else the report data will be obsolete.
Thanks -
HT6154 I deleted my Imexchange from my phone I need to get the data back with the app
I deleted a IMexchane App from my phone by mistake. I need to get the app and the data back.
Please HelpTalk to the app developer. From what I can see, that app is designed to sync with Outlook. The data should still be in Outlook
-
Getting the data for last month of every year
Hi,
How to declare the date if we want to pull the data from the December of every year.
For example if the query is run in march 2015 and they want the historical data it should pull only the data from dec 2014.
In the same way if they ran the query in future jun 2016 and if they want to historical data it should pull only data from dec 2015.
It should not coded manually. Please help me with date format that need to used.
BALUSUSRIHARSHAPlease follow basic Netiquette and post the DDL we need to answer this. Follow industry and ANSI/ISO standards in your data. You should follow ISO-11179 rules for naming data elements. You should follow ISO-8601 rules for displaying temporal data. We need
to know the data types, keys and constraints on the table. Avoid dialect in favor of ANSI/ISO Standard SQL. And you need to read and download the PDF for:
https://www.simple-talk.com/books/sql-books/119-sql-code-smells/
A table has to have a key to be table. Here is my guess at a repair job:
CREATE TABLE Test_Data
(pu_id INTEGER NOT NULL
REFERENCES PU(pu_id),
pu_date DATE DEFAULT CURRENT_TIMESTAMP NOT NULL,
PRIMARY KEY (pu_id, pu_date),
x_count INTEGER,
y_count INTEGER);
Identifiers are not numeric in a good schema. What math do you do with them? They are also the key in the table that models the entity they identify. Where is the PU table (and what is a PU anyway)?
INSERT INTO Test_Data
VALUES
(28, '2014-01-01', 10, 20), -- crap! No key in this mess!!
(28, '2015-01-01', 30, 20), --
(28, '2014-12-12', 10, 20),
(28, '2015-02-02', 10, 20);
A PIVOT is not a query and not even part of SQL. It is how Microsoft programmers who do not know RDBMS or have a report writer violate the tiered architecture of SQL. We also do not use XML mixed in SQL. It is a bitch to maintain, has poor performance and again
violates the tiered architecture principle.
A query is not sorted because it is a table. A file in COBOL can be sorted and that seems to be what you really want to write.
Old COBOL love the Sybase CONVERT() string function to avoid SQL temporal data.
We never use SELECT * in production code; Google it. Not only are you generating code, you are generation bad code.
Since SQL is a database language, we prefer to do look ups and not calculations. They can be optimized while temporal math messes up optimization. A useful idiom is a report period calendar that everyone uses so there is no way to get disagreements in the DML.
The report period table gives a name to a range of dates that is common to the entire enterprise.
CREATE TABLE Month_Periods
(month_name CHAR(10) NOT NULL PRIMARY KEY
CHECK (month_name LIKE <pattern>),
month_start_date DATE NOT NULL,
month_end_date DATE NOT NULL,
CONSTRAINT date_ordering
CHECK (month_start_date <= month_end_date),
etc);
These report periods can overlap or have gaps. I like the MySQL convention of using double zeroes for months and years, That is 'yyyy-mm-00' for a month within a year and 'yyyy-00-00' for the whole year. The advantages are that it will sort with the ISO-8601
data format required by Standard SQL and it is language independent. The pattern for validation is '[12][0-9][0-9][0-9]-00-00' and '[12][0-9][0-9][0-9]-[01][0-9]-00'
This will port and waste time calling string function row by row.
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL -
PL/SQL I need to find the data for practice
Please don't laugh at my question, since it is sort of nieve question. I had bought a call Oracle database 10g pl/sql programming so that I can practice on my laptop by installing the express edition.
I installed oracle express edition and hard coded as per book, but I don't have the data file where the sql or pl/sql command will pull as per its commands.
I looked the book here and there and the publisher's website. What I find they have codes in the website whic I can download or copy from the book or write on my own,
Can anyone will help me or show the rope how I can get the data and continue my practice with enjoyment, Thank you in anticipationHi!
What data r u taking about? Is it data from Employees,Department ... tables or data from any other table? If it is the first one - and if u installed Oracle in your labtop. Then u may find there is another scheama called HR which is generally locked. U have to unlock that account and then u can proceed with ur query which will give the exact data that u r looking for. Hope that will help.
Regards.
Satyaki De. -
How to approach in getting the dates for the user given periods
Hi All,
I have areuirement where the calendar would be like as 466 for a period
for eg. period 1(Jan) has 4 weeks
period 2(Feb) has 6 weeks
period 3(Mar) has 6 weeks
again period 4(Apr) has 4 weeks
period 5(May) has 6 weeks
period 6(June) has 6 weeks
How to get the dates (from date and end date) for the periods.
Anybody's help will be appreciated
Regards
SaugataI have areuirement where the calendar would be like as 466 for a periodWhat does that mean? Is 466 the format of the data?
The end date depends on the start date. This query might be helpful for you
SQL> WITH data AS(
2 SELECT 1 period, 4 duration FROM dual UNION ALL
3 SELECT 2, 6 FROM dual UNION ALL
4 SELECT 3, 6 FROM dual UNION ALL
5 SELECT 4, 4 FROM dual UNION ALL
6 SELECT 5, 6 FROM dual UNION ALL
7 SELECT 6, 6 FROM dual)
8 SELECT
9 period,
10 duration,
11 SYSDATE + SUM(duration) OVER (ORDER BY period RANGE UNBOUNDED PRECEDING) * 7 AS end_date
12 FROM data
13 ;
PERIOD DURATION END_DATE
1 4 16-NOV-07
2 6 28-DEC-07
3 6 08-FEB-08
4 4 07-MAR-08
5 6 18-APR-08
6 6 30-MAY-08
6 rows selected.
SQL> -
Using analytic function to get the data
Hi
Version is 11g
My table has this data
NAME SALARY LAST_UPDA
a 1000 01-JAN-07
a 2000 01-JAN-09
a 2500 01-JUN-10
b 2000 01-AUG-10
c 5000 01-JUN-07
c 6000 08-JAN-09
c 4500 01-FEB-10
I want to pick the salary and name of the person when it was last updated (max(last_update_date)).
Couple of ways of doing this I think are
SELECT distinct name,
TRUNC(
AVG(salary) KEEP (DENSE_RANK LAST
ORDER BY TO_CHAR(last_update_Date,'YYYY') )
OVER (PARTITION BY NAME)
) t
FROM kmdebug;
OR
SELECT * FROM KMDEBUG
WHERE (LAST_UPDATE_DATE, NAME) IN (SELECT MAX(LAST_UPDATE_DATE), NAME
FROM KMDEBUG
GROUP BY NAME);
They give the desired result.
NAME SALARY LAST_UPDA
a 2500 01-JUN-10
b 2000 01-AUG-10
c 4500 01-FEB-10
But the problem with the first version is DISTINCT. I want to get result set without using DISTINCT
The problem with second version is, it could be inefficient way of doing it espeically when KMDEBUG table would be big.
Thank you
MSKA couple of thoughts.
1. 11g is not a version number.
SELECT * FROM v$version;2. Read the FAQ and learn how to use tags to format your listing so others can read it. (blue circular icon to the right)
3. Post DDL to create your table and DML to load your sample data.
Then, perhaps, someone can try your query and consider how to get you what you want.
And, when you make requests like "without using DISTINCT" you need to explain why. Because otherwise this just looks like someone trying to get us to do their homework for them. -
Need to get the date minus 300 seconds
Hi,
I need help writing the following select statement.
I am trying to get the time from a date field minus 300 seconds. Please help me format this select statement.
Thanks!select my_date_column - (300 * (1/24/60/60))
...
Maybe you are looking for
-
Macbook Pro running extremely slow
While still on Mavericks my Macbook Pro 13 mid 2010 (2.4 Intel core 2 duo) sporadically began running extremely slow functions, even the mouse cursor moved in jolts and steps, to type a word in google search engine I had to wait a few seconds after b
-
How can i print a result in one line
hi guys i have a small procedure as below create or replace procedure test_sp is l_str varchar2(2000) := replace('14522|||Lessig|||Minna|||Lessig, Minna','|||','|'); i pls_integer; l_start_pos INTEGER := 1; l_end_pos INTEGER :=1; field_v varchar2(255
-
Hi experts, I see that both in Master data of Business partner, Tcode BP, and Security class, Tcode FWZZ, you can populate with credit ratings, normally provided with some external rating agencies, like S&P, Fitch, Moody's, etc. May questions: --- is
-
I had to reinstall a failed harddrive in a PowerBook G4 and lost all my apps. Where can I get Apple Works?
-
Setting Sidebar's Width to Zero?
Does someone know a way to set permanently the sidebar's width, and forall Finder windows? This question has already been asked in the past and didn't receive a positive answer as far as I know. There doesn't seem to be a global variable anywhere, ei