Select query on key field for different time format
Hello Experts,
I am working in Sender ABAP proxy <===> SAP PI 7.31 JAVA <===> Oracle database.
Oracle Database stores all records of material sold where the date is maintained in 01/15/2010 01:48:20 which has date and time format.
In ECC , I will be sending a proxy request with system date as the only field and this would be key field to select all the material records sold for 01/15/2010 in Oracle Database i.e. Select statement.As we can observe that the system data of ECC does not have time stamp.
I am clueless how to get this done in Message Mapping or in some way? If I maintain just the date stamp of ECC as the key field, would I be
able to fetch all the records from Database?
Regards
Rebecca
Dear Hareesh and Harish,
Ooopps the names are confusing. but very close..
Yes I changed my receiver structure and added <compareOperation> under the key field Material Number. In the Message Mapping , I assigned a constant EQ to <compareOperation>.
Now tested the proxy will value of Material with no 100 , expecting a response from database for Material 100. But getting error as below.
xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SAP:Category>XIProtocol</SAP:Category>
<SAP:Code area="PARSING">GENERAL</SAP:Code>
<SAP:P1 />
<SAP:P2 />
<SAP:P3 />
<SAP:P4 />
<SAP:AdditionalText />
<SAP:Stack>com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessageExpiredException: Message 53cc7fab-e712-0b20-e100-8000ac10134c(OUTBOUND) expired. at com.sap.aii.adapter.soap.web.SOAPHandler.processSOAPtoXMB(SOAPHandler.java:746) at com.sap.aii.adapter.soap.web.MessageServlet.doPost(MessageServlet.java:505) at
I am not sure whether there was any response from database.
I am close to end of this thread..
Please guide.
Regards
Rebecca
Similar Messages
-
Show different key fields for different caracteristics in the column.
Hi, experts
I am creating a query where there are 4 colomns reprensenting 4 different dates. But I would like to display diffferent key fields for them. For example, under DAY 1, i would like to diplay KeyField 1, for DAY2, DAY3 and DAY4, KeyField 2 et 3 will be added under them.
To do that, i made these key fields "Constant selection" and made some definition in the cells-------
On the line of DAY1 in the colomn KeyField 2 and KeyField 3, I made them "Always Hide".
But I didn't get what i wanted as the two columns (KF2 et KF3) still appear in the report, even if there are no data in these two columns.
Is it possible to realise this requirement:
DAY1 DAY2 DAY3
KF1 KF2 KF3 KF2 KF3
Thanks in advance!!!!There is no need to define a cell for this, use a restricted key figure:
KF1 needs to be restricted by Day1
KF2 restrict it by Day2 and so on,
and use those restricted figure in the key figure section, but to make the column more descriptive use a text variable for the name of the columns.
this should be easier than cell definition.
thanks.
Wond -
Selecting Semantic Group Key Fields for Cube to Cube DTP
Is it possible to use the semantic group key fields selection when performing a DTP between two infoCubes? When I try to select the key field of 0CALWEEK, i am unable to as the selection screen is grayed out like I'm in display mode even though I'm in change mode for the DTP.
Thanks,
MatthewHi,
Have you initialized the planning area for the 11th key figure to be loaded. Make sure that the key figure which you want to load is initialized for the planning version for the respective planning area.
Also check the loading period inside the variant is within the planning area initialized period for that key figure. And make sure that you have made the key figure assignment for the info cube and planning area inside the variant.
thanks and regards
Murugesan -
Query the date field for specific time
I need to be able to run a query on a date field that retrieves specified times.
Any ideas???You could do something like
SELECT *
FROM someTable
WHERE to_char(date_column, 'HH24:MI:SS') = '17:01:04';Justin -
Displaying variable no. of fields for different records
Hi,
I have the requirement of displaying variable no of fields for different type of record in the business object.How can this be done in VC. For example i have to show an extra field for country "IN"
Thanks in advance,
Regards,
AnupamHi Anupam,
Please explain ur requirement more clearly.
If understanding is right ,you are creating a Table/Form with the information of a particular company ,and u r interested to add another column to this table and this column should not be visible when to select another company. Am I right?
What is the data source is it a BAPI or Query or Query View?
1)Drag and drop a table from the Query(if suppose).Or form if u want to include in the form.
2)And if u want another field(if it is to be calculated) in ur table u can have include an expression box by clicking a "+" sign in the table and specify the formula for it in the Expression field uder the Data source field in the General Tab.
3)And if u want to hide this field when u select another country then u can set a visibility condition.
4)Go to control properties window of the new field.U can get this by selecting the new added field and by clicking on configure or by left clicking the new field and then selecting the properties.
5)Inside the General Tab, u have UI Control,below that u have Hidden which is a check box, just check it.And click on condition. Then type the condition for it to be hidden.Then it is hidden.
Please try doing the above.
Reward me with points if its helpful.
Thanks,Regards,
Sripriya Srinivasan. -
How to update key fields for table
Hi,
how to update key fields for a table.The update statement is not working for the same.
Regards,Hi,
See the below example.
TABLES SPFLI.
DATA WA TYPE SPFLI.
MOVE 'AA' TO WA-CARRID.
MOVE '0064' TO WA-CONNID.
MOVE 'WASHINGTON' TO WA-CITYFROM.
UPDATE SPFLI FROM WA.
MOVE 'LH' TO SPFLI-CARRID.
MOVE '0017' TO SPFLI-CONNID.
MOVE 'BERLIN' TO SPFLI-CITYFROM.
UPDATE SPFLI.
CARRID and CONNID are the primary key fields of table SPFLI. All fields of those lines where the primary key fields are "AA" and "0064", or "LH" and "0017", are replaced by the values in the corresponding fields of the work area WA or the table work area SPFLI.
Regards,
raj. -
EEWB: Insert New Table with more than one key field for BP object
Hi Gurus,
I want to enhance Business Partner object with a new table with two key fields, one the address number and another a sequence number, because I need to save several entries for each address belonging to a determined business partner. Something as what happens in communication data (i.e fax number)for an address.
I have run the wizard from EEWB but the only possibility that offers you is to create only one key field for the new custom table. There is something in EEWB to achieve this, two key fields for the new table?
Another question is the following: which Badi or BAPI must I enhance to populate my table with the corresponding address number to which the data belong to?
I mean my custom data are filled through a table control that I have allocated within the screen sequence BUA130 (Detail Address). Thus, when a new address is added to a BP and my particular table control is populated within this address I should fill the key fields from my table (address number and sequence number) when the BP were saved. So, I must know beforehand which address number the system will assign to this new address.
I repeat the question: which Badi or BAPI must I enhance to populate my table with the corresponding address number to which the data belong to?
Thanks in Advance.
Regards,
Rosa FerrandoHi Rosa,
Please go through the following links. It will help you.
<a href="http://help.sap.com/saphelp_crm50/helpdata/en/20/a4ffee7e0fcc4ebb7e5466d3903d38/frameset.htm">http://help.sap.com/saphelp_crm50/helpdata/en/20/a4ffee7e0fcc4ebb7e5466d3903d38/frameset.htm</a>
<b>Reward points if it helps.</b>
Regards,
Amit Mishra -
NOKIA X3-02: Several Alarms for different times
NOKIA X3-02 V6.00: how I can make several Alarms for different times.
Solved!
Go to Solution.Hello,
why nokia does not add different Allarms in Allarm menu?
Best Regards -
How to alter Select Query while altering selectionscreen for same output?
Hi,
i have to change the selection screen fields with some new fields , but i dont know how to change the selection query accordingly, because i need the same output with the same fields but with a different set of fields in the selection screen.
The original code is
TYPES: BEGIN OF ty_output,
mblnr TYPE mseg-mblnr,
mjahr TYPE mseg-mjahr,
zeile TYPE mseg-zeile,
bwart TYPE mseg-bwart,
werks TYPE mseg-werks,
lgort TYPE mseg-lgort,
ebeln TYPE mseg-ebeln,
ebelp TYPE mseg-ebelp,
lfbnr TYPE mseg-lfbnr,
lfpos TYPE mseg-lfpos,
sjahr TYPE mseg-sjahr,
dmbtr TYPE mseg-dmbtr,
menge TYPE mseg-menge,
matnr TYPE mseg-matnr,
mtart TYPE mara-mtart,
matkl TYPE mara-matkl,
bismt TYPE mara-bismt,
meins TYPE mara-meins,
bedat TYPE ekko-bedat,
waers TYPE ekko-waers,
wkurs TYPE ekko-wkurs,
verkf TYPE ekko-verkf,
EFFWR TYPE EKPO-EFFWR,
tax TYPE ekpo-effwr,
maktx TYPE makt-maktx,
budat TYPE mkpf-budat,
usnam TYPE mkpf-usnam,
m_menge TYPE ekpo-menge,
ablad TYPE mseg-ablad,
wempf TYPE mseg-wempf,
END OF ty_output.
TYPES: BEGIN OF ty_mseg_103,
mblnr TYPE mseg-mblnr,
mjahr TYPE mseg-mjahr,
zeile TYPE mseg-zeile,
bwart TYPE mseg-bwart,
werks TYPE mseg-werks,
lgort TYPE mseg-lgort,
ebeln TYPE mseg-ebeln,
ebelp TYPE mseg-ebelp,
lfbnr TYPE mseg-lfbnr,
lfpos TYPE mseg-lfpos,
sjahr TYPE mseg-sjahr,
dmbtr TYPE mseg-dmbtr,
menge TYPE mseg-menge,
matnr TYPE mseg-matnr,
mtart TYPE mara-mtart,
matkl TYPE mara-matkl,
bismt TYPE mara-bismt,
meins TYPE mara-meins,
bedat TYPE ekko-bedat,
waers TYPE ekko-waers,
wkurs TYPE ekko-wkurs,
verkf TYPE ekko-verkf,
EFFWR TYPE EKPO-EFFWR,
tax TYPE ekpo-effwr,
maktx TYPE makt-maktx,
budat TYPE mkpf-budat,
usnam TYPE mkpf-usnam,
m_menge TYPE ekpo-menge,
ablad TYPE mseg-ablad,
wempf TYPE mseg-wempf,
END OF ty_mseg_103.
TYPES: BEGIN OF ty_mseg_105,
mblnr TYPE mseg-mblnr,
mjahr TYPE mseg-mjahr,
zeile TYPE mseg-zeile,
bwart TYPE mseg-bwart,
werks TYPE mseg-werks,
lgort TYPE mseg-lgort,
ebeln TYPE mseg-ebeln,
ebelp TYPE mseg-ebelp,
lfbnr TYPE mseg-lfbnr,
lfpos TYPE mseg-lfpos,
sjahr TYPE mseg-sjahr,
dmbtr TYPE mseg-dmbtr,
menge TYPE mseg-menge,
matnr TYPE mseg-matnr,
mtart TYPE mara-mtart,
matkl TYPE mara-matkl,
bismt TYPE mara-bismt,
meins TYPE mara-meins,
bedat TYPE ekko-bedat,
waers TYPE ekko-waers,
wkurs TYPE ekko-wkurs,
verkf TYPE ekko-verkf,
effwr TYPE ekpo-effwr,
tax TYPE ekpo-effwr,
maktx TYPE makt-maktx,
budat TYPE mkpf-budat,
ablad TYPE mseg-ablad,
wempf TYPE mseg-wempf,
END OF ty_mseg_105.
DATA: Begin with W_ *
DATA : it_fcat TYPE slis_t_fieldcat_alv. " alv field catalog
DATA : listhead TYPE slis_t_listheader WITH HEADER LINE.
DATA: event TYPE slis_t_event WITH HEADER LINE.
INTERNAL TABLES: Begin with IT_ *
DATA : it_output TYPE STANDARD TABLE OF ty_output WITH KEY mblnr mjahr,
it_mseg_103 TYPE STANDARD TABLE OF ty_mseg_103,
it_mseg_105 TYPE STANDARD TABLE OF ty_mseg_103,
it_mseg_106 TYPE STANDARD TABLE OF ty_mseg_103, " LNTDEV1 ADDED
it_mara TYPE STANDARD TABLE OF ty_mara,
it_ekko TYPE STANDARD TABLE OF ty_ekko,
it_ekpo TYPE STANDARD TABLE OF ty_ekpo,
it_makt TYPE STANDARD TABLE OF ty_makt,
it_mkpf TYPE STANDARD TABLE OF ty_mkpf WITH KEY mblnr.
WORKAREAS: Begin with WA_ *
DATA : wa_fcat LIKE LINE OF it_fcat.
DATA : wa_output LIKE LINE OF it_output,
wa_mara LIKE LINE OF it_mara,
wa_ekko LIKE LINE OF it_ekko,
wa_ekpo LIKE LINE OF it_ekpo,
wa_makt LIKE LINE OF it_makt,
wa_mkpf LIKE LINE OF it_mkpf,
wa_mseg_103 LIKE LINE OF it_mseg_103,
wa_mseg_105 LIKE LINE OF it_mseg_105,
wa_mseg_106 LIKE LINE OF it_mseg_106. " LNTDEV1 ADDED
DATA : w_menge LIKE ekpo-menge.
FIELD-SYMBOLS: Begin with FS_ *
PARAMETERS: Begin with PR_ *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS : pr_werks LIKE mseg-werks OBLIGATORY.
SELECT-OPTIONS : so_budat FOR mkpf-budat.
SELECTION-SCREEN END OF BLOCK b1.
SELECT-OPTIONS: Begin with SO_ *
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
SELECT-OPTIONS : so_mtart FOR mara-mtart.
SELECT-OPTIONS : so_matkl FOR mara-matkl.
SELECT-OPTIONS : so_matnr FOR mara-matnr.
SELECT-OPTIONS : so_bismt FOR mara-bismt.
SELECT-OPTIONS : so_ebeln FOR mseg-ebeln.
SELECT-OPTIONS : so_verkf FOR ekko-verkf.
SELECT-OPTIONS : so_bedat FOR ekko-bedat.
SELECT-OPTIONS : so_mblnr FOR mseg-mblnr.
SELECTION-SCREEN END OF BLOCK b2.
*AT SELECTION-SCREEN.
*SO_BUDAT-HIGH = SO_BUDAT-HIGH + 1.
Query for getting all the Document Segment: Material data from MSEG *
Table which having Movement Types 103 and put into it_mseg table, *
Filtering by reference document and material document number *
Filtering by selection criteria (Material Docu No, Purchase order *
and Plant) *
START-OF-SELECTION.
SELECT pmblnr smblnr p~mjahr zeile bwart lfbnr werks lgort ebeln
ebelp lfpos sjahr dmbtr usnam menge sbudat pmatnr q~mtart
pablad pwempf
FROM mseg AS p INNER JOIN mara AS q
ON pmatnr = qmatnr
JOIN mkpf AS s ON smblnr EQ pmblnr
INTO CORRESPONDING FIELDS OF
TABLE it_mseg_103
WHERE bwart EQ 103
AND p~matnr IN so_matnr
AND werks EQ pr_werks
AND ebeln IN so_ebeln
AND q~mtart IN so_mtart
AND p~mblnr IN so_mblnr
AND s~budat IN so_budat.
IF sy-subrc = 0.
ENDIF.
SELECT pmblnr smblnr p~mjahr zeile bwart lfbnr werks lgort ebeln
ebelp lfpos sjahr dmbtr usnam menge sbudat pmatnr q~mtart
pablad pwempf
FROM mseg AS p INNER JOIN mara AS q
ON pmatnr = qmatnr
JOIN mkpf AS s ON smblnr EQ pmblnr
INTO CORRESPONDING FIELDS OF
TABLE it_mseg_105
WHERE bwart EQ 105 OR bwart EQ 104 OR bwart EQ 124 OR bwart EQ 124
AND p~matnr IN so_matnr
AND werks EQ pr_werks
AND ebeln IN so_ebeln
AND q~mtart IN so_mtart
AND p~mblnr IN so_mblnr
AND s~budat IN so_budat.
IF sy-subrc = 0.
ENDIF.
LOOP AT IT_MSEG_103 INTO WA_MSEG_103.
READ TABLE IT_MSEG_105 INTO WA_MSEG_105 WITH KEY LFBNR =
WA_MSEG_103-MBLNR.
IF SY-SUBRC <> 0.
APPEND WA_MSEG_103 TO IT_OUTPUT.
ENDIF.
ENDLOOP.
SELECT pmblnr smblnr p~mjahr zeile bwart lfbnr werks lgort ebeln
ebelp lfpos sjahr dmbtr usnam menge sbudat pmatnr q~mtart
pablad pwempf
FROM mseg AS p INNER JOIN mara AS q
ON pmatnr = qmatnr
JOIN mkpf AS s ON smblnr EQ pmblnr
INTO CORRESPONDING FIELDS OF
TABLE it_mseg_106
WHERE bwart EQ 106
AND p~matnr IN so_matnr
AND werks EQ pr_werks
AND ebeln IN so_ebeln
AND q~mtart IN so_mtart
AND p~mblnr IN so_mblnr
AND s~budat IN so_budat.
LOOP AT it_mseg_103 INTO wa_mseg_103.
READ TABLE it_mseg_106 INTO wa_mseg_106 WITH KEY
lfbnr = wa_mseg_103-mblnr.
IF sy-subrc = 0.
APPEND wa_mseg_106 TO it_output.
clear wa_mseg_106.
ENDIF.
ENDLOOP.
Present selection criteria is
1. Plant
2. Posting Date
3. Material Type
4. Material Group
5. Material No.
6. Old Material No.
7. PO Order No.
8. Old PO No.
9. PO Date
10. Material Document No.
New selection criteria is
1. PO no.
2. PO date
3. PO value (Ex: >=10000 <=50000)
4. Purch org
5. Doc type
6. Vendor
7. Material
8. Account assignment category
9. OrderHi,
i have to change the selection screen fields with some new fields , but i dont know how to change the selection query accordingly, because i need the same output with the same fields but with a different set of fields in the selection screen.
The original code is
TYPES: BEGIN OF ty_output, mblnr TYPE mseg-mblnr, mjahr TYPE mseg-mjahr, zeile TYPE mseg-zeile, bwart TYPE mseg-bwart, werks TYPE mseg-werks, lgort TYPE mseg-lgort, ebeln TYPE mseg-ebeln, ebelp TYPE mseg-ebelp, lfbnr TYPE mseg-lfbnr, lfpos TYPE mseg-lfpos, sjahr TYPE mseg-sjahr, dmbtr TYPE mseg-dmbtr, menge TYPE mseg-menge, matnr TYPE mseg-matnr, mtart TYPE mara-mtart, matkl TYPE mara-matkl, bismt TYPE mara-bismt, meins TYPE mara-meins, bedat TYPE ekko-bedat, waers TYPE ekko-waers, wkurs TYPE ekko-wkurs, verkf TYPE ekko-verkf, * EFFWR TYPE EKPO-EFFWR, tax TYPE ekpo-effwr, maktx TYPE makt-maktx, budat TYPE mkpf-budat, usnam TYPE mkpf-usnam, m_menge TYPE ekpo-menge, ablad TYPE mseg-ablad, wempf TYPE mseg-wempf, END OF ty_output. TYPES: BEGIN OF ty_mseg_103, mblnr TYPE mseg-mblnr, mjahr TYPE mseg-mjahr, zeile TYPE mseg-zeile, bwart TYPE mseg-bwart, werks TYPE mseg-werks, lgort TYPE mseg-lgort, ebeln TYPE mseg-ebeln, ebelp TYPE mseg-ebelp, lfbnr TYPE mseg-lfbnr, lfpos TYPE mseg-lfpos, sjahr TYPE mseg-sjahr, dmbtr TYPE mseg-dmbtr, menge TYPE mseg-menge, matnr TYPE mseg-matnr, mtart TYPE mara-mtart, matkl TYPE mara-matkl, bismt TYPE mara-bismt, meins TYPE mara-meins, bedat TYPE ekko-bedat, waers TYPE ekko-waers, wkurs TYPE ekko-wkurs, verkf TYPE ekko-verkf, * EFFWR TYPE EKPO-EFFWR, tax TYPE ekpo-effwr, maktx TYPE makt-maktx, budat TYPE mkpf-budat, usnam TYPE mkpf-usnam, m_menge TYPE ekpo-menge, ablad TYPE mseg-ablad, wempf TYPE mseg-wempf, END OF ty_mseg_103. TYPES: BEGIN OF ty_mseg_105, mblnr TYPE mseg-mblnr, mjahr TYPE mseg-mjahr, zeile TYPE mseg-zeile, bwart TYPE mseg-bwart, werks TYPE mseg-werks, lgort TYPE mseg-lgort, ebeln TYPE mseg-ebeln, ebelp TYPE mseg-ebelp, lfbnr TYPE mseg-lfbnr, lfpos TYPE mseg-lfpos, sjahr TYPE mseg-sjahr, dmbtr TYPE mseg-dmbtr, menge TYPE mseg-menge, matnr TYPE mseg-matnr, mtart TYPE mara-mtart, matkl TYPE mara-matkl, bismt TYPE mara-bismt, meins TYPE mara-meins, bedat TYPE ekko-bedat, waers TYPE ekko-waers, wkurs TYPE ekko-wkurs, verkf TYPE ekko-verkf, effwr TYPE ekpo-effwr, tax TYPE ekpo-effwr, maktx TYPE makt-maktx, budat TYPE mkpf-budat, ablad TYPE mseg-ablad, wempf TYPE mseg-wempf, END OF ty_mseg_105. *----------------------------------------------------------------------* * DATA: Begin with W_ * *----------------------------------------------------------------------* DATA : it_fcat TYPE slis_t_fieldcat_alv. " alv field catalog DATA : listhead TYPE slis_t_listheader WITH HEADER LINE. DATA: event TYPE slis_t_event WITH HEADER LINE. *----------------------------------------------------------------------* * INTERNAL TABLES: Begin with IT_ * *----------------------------------------------------------------------* DATA : it_output TYPE STANDARD TABLE OF ty_output WITH KEY mblnr mjahr, it_mseg_103 TYPE STANDARD TABLE OF ty_mseg_103, it_mseg_105 TYPE STANDARD TABLE OF ty_mseg_103, it_mseg_106 TYPE STANDARD TABLE OF ty_mseg_103, " LNTDEV1 ADDED it_mara TYPE STANDARD TABLE OF ty_mara, it_ekko TYPE STANDARD TABLE OF ty_ekko, it_ekpo TYPE STANDARD TABLE OF ty_ekpo, it_makt TYPE STANDARD TABLE OF ty_makt, it_mkpf TYPE STANDARD TABLE OF ty_mkpf WITH KEY mblnr. *----------------------------------------------------------------------* * WORKAREAS: Begin with WA_ * *----------------------------------------------------------------------* DATA : wa_fcat LIKE LINE OF it_fcat. DATA : wa_output LIKE LINE OF it_output, wa_mara LIKE LINE OF it_mara, wa_ekko LIKE LINE OF it_ekko, wa_ekpo LIKE LINE OF it_ekpo, wa_makt LIKE LINE OF it_makt, wa_mkpf LIKE LINE OF it_mkpf, wa_mseg_103 LIKE LINE OF it_mseg_103, wa_mseg_105 LIKE LINE OF it_mseg_105, wa_mseg_106 LIKE LINE OF it_mseg_106. " LNTDEV1 ADDED DATA : w_menge LIKE ekpo-menge. *----------------------------------------------------------------------* * FIELD-SYMBOLS: Begin with FS_ * *----------------------------------------------------------------------* *----------------------------------------------------------------------* * PARAMETERS: Begin with PR_ * *----------------------------------------------------------------------* SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME. PARAMETERS : pr_werks LIKE mseg-werks OBLIGATORY. SELECT-OPTIONS : so_budat FOR mkpf-budat. SELECTION-SCREEN END OF BLOCK b1. *----------------------------------------------------------------------* * SELECT-OPTIONS: Begin with SO_ * *----------------------------------------------------------------------* SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME. SELECT-OPTIONS : so_mtart FOR mara-mtart. SELECT-OPTIONS : so_matkl FOR mara-matkl. SELECT-OPTIONS : so_matnr FOR mara-matnr. SELECT-OPTIONS : so_bismt FOR mara-bismt. SELECT-OPTIONS : so_ebeln FOR mseg-ebeln. SELECT-OPTIONS : so_verkf FOR ekko-verkf. SELECT-OPTIONS : so_bedat FOR ekko-bedat. SELECT-OPTIONS : so_mblnr FOR mseg-mblnr. SELECTION-SCREEN END OF BLOCK b2. *AT SELECTION-SCREEN. * *SO_BUDAT-HIGH = SO_BUDAT-HIGH + 1. *---------------------------------------------------------------------* * Query for getting all the Document Segment: Material data from MSEG * * Table which having Movement Types 103 and put into it_mseg table, * * Filtering by reference document and material document number * * Filtering by selection criteria (Material Docu No, Purchase order * * and Plant) * *---------------------------------------------------------------------* *---------------------------------------------------------------------* START-OF-SELECTION. *---------------------------------------------------------------------* SELECT p~mblnr s~mblnr p~mjahr zeile bwart lfbnr werks lgort ebeln ebelp lfpos sjahr dmbtr usnam menge s~budat p~matnr q~mtart p~ablad p~wempf FROM mseg AS p INNER JOIN mara AS q ON p~matnr = q~matnr JOIN mkpf AS s ON s~mblnr EQ p~mblnr INTO CORRESPONDING FIELDS OF TABLE it_mseg_103 WHERE bwart EQ 103 AND p~matnr IN so_matnr AND werks EQ pr_werks AND ebeln IN so_ebeln AND q~mtart IN so_mtart AND p~mblnr IN so_mblnr AND s~budat IN so_budat. ** IF sy-subrc = 0. ENDIF. SELECT p~mblnr s~mblnr p~mjahr zeile bwart lfbnr werks lgort ebeln ebelp lfpos sjahr dmbtr usnam menge s~budat p~matnr q~mtart p~ablad p~wempf FROM mseg AS p INNER JOIN mara AS q ON p~matnr = q~matnr JOIN mkpf AS s ON s~mblnr EQ p~mblnr INTO CORRESPONDING FIELDS OF TABLE it_mseg_105 WHERE bwart EQ 105 OR bwart EQ 104 OR bwart EQ 124 OR bwart EQ 124 AND p~matnr IN so_matnr AND werks EQ pr_werks AND ebeln IN so_ebeln AND q~mtart IN so_mtart AND p~mblnr IN so_mblnr AND s~budat IN so_budat. IF sy-subrc = 0. ENDIF. LOOP AT IT_MSEG_103 INTO WA_MSEG_103. READ TABLE IT_MSEG_105 INTO WA_MSEG_105 WITH KEY LFBNR = WA_MSEG_103-MBLNR. IF SY-SUBRC 0. APPEND WA_MSEG_103 TO IT_OUTPUT. ENDIF. ENDLOOP. SELECT p~mblnr s~mblnr p~mjahr zeile bwart lfbnr werks lgort ebeln ebelp lfpos sjahr dmbtr usnam menge s~budat p~matnr q~mtart p~ablad p~wempf FROM mseg AS p INNER JOIN mara AS q ON p~matnr = q~matnr JOIN mkpf AS s ON s~mblnr EQ p~mblnr INTO CORRESPONDING FIELDS OF TABLE it_mseg_106 WHERE bwart EQ 106 AND p~matnr IN so_matnr AND werks EQ pr_werks AND ebeln IN so_ebeln AND q~mtart IN so_mtart AND p~mblnr IN so_mblnr AND s~budat IN so_budat. LOOP AT it_mseg_103 INTO wa_mseg_103. READ TABLE it_mseg_106 INTO wa_mseg_106 WITH KEY lfbnr = wa_mseg_103-mblnr. IF sy-subrc = 0. APPEND wa_mseg_106 TO it_output. clear wa_mseg_106. ENDIF. ENDLOOP.
Present selection criteria is 1. Plant 2. Posting Date 3. Material Type 4. Material Group 5. Material No. 6. Old Material No. 7. PO Order No. 8. Old PO No. 9. PO Date 10. Material Document No. New selection criteria is 1. PO no. 2. PO date 3. PO value (Ex: >=10000 <=50000) 4. Purch org 5. Doc type 6. Vendor 7. Material 8. Account assignment category 9. Order
I hope the code is readable now.
Thanks in advance. -
Select query in not working for Count(*)
Hi,
Our batch team running one query that is selecting one table TSFHEAD and this query is hanging. Below are diffrent shenario in which the select query is running on this table.
select * from tsfhead where create_id = 'BATCH' and create_date = '26-OCT-12';
--not returning any rows and hanging
select * from tsfhead where create_id = 'BATCH' ---returning rows
select * from tsfhead where create_date = '26-OCT-12'; --- returning rows
select count(*) from tsfhead ----not returning rows and hanging
This table TSFHEAD has 59000 rows.
SQL> explain plan for select * from tsfhead where create_id = 'BATCH' and create_date = '26-OCT-12';
Explained.
SQL> SELECT * FROM TABLE(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 415503093
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 67 | 215 (1)| 00:00:03 |
|* 1 | TABLE ACCESS FULL| TSFHEAD | 1 | 67 | 215 (1)| 00:00:03 |
Predicate Information (identified by operation id):
PLAN_TABLE_OUTPUT
1 - filter("CREATE_ID"='BATCH' AND "CREATE_DATE"='26-OCT-12')
I don't know why this query behaving in this manner.Please help.RanVijai_dba wrote:
Thanks for your reply. But +"select count(*) from tsfhead"+ is hanging and +"select * from tsfhead where create_date = '26-OCT-12' "+ is showing records.It might be showing records, but not necessarily the correct records.
As sb points out, you are treating dates as strings rather than the DATE datatype. That means you could be querying the wrong data, and your query is also not safe in different environments. It could also effect the query execution plan. Also, as pointed out, you should be ideally using 4 digit years. There were many headaches caused by the use of 2 digit years that most companies corrected as part of the millenium bug fixes prior to the year 2000... well over a decade ago, and most good designs now ensure that 4 digit years are used as standard.
So your query would be better written as:
select * from tsfhead where create_date = TO_DATE('26-OCT-2012','DD-MON-YYYY')When you say:
select count(*) from tsfhead... is hanging, you say the table has around 59000 rows in it, and in reality that's a small amount of records, so a count(*) shouldn't take long at all, even doing a full table scan.
Post the explain plan for that simple count(*) query for us. (and ensure you use {noformat}{noformat} tags to keep the formatting on the forum, as described in {message:id=9360002}) -
Sinlge select query in diff schemas for same table(Indentical Structure)
Scenario :
Table XYZ is created in Schema A
After an year, the old data from the previous year would be moved to different schema. However in the other schema the same table name would be used.
For eg
Schema A contains table XYZ with data of 2012 yr
Schema B contains table XYZ with data of 2011 yr
Table XYZ in both the schemas have identical structure.
So can we fire a single select query to read the data from both the tables in effective way.
Eg select * from XYZ where date range between 15-Oct-2011 to 15-Mar-2012.
However the data resides in 2 different schema altogether.
Creating an view is an option.
But my problem, there is ORM layer(either Hibernate or Eclipse Top Link) between the application and the database.
So the queries would be formed by the ORM layer and are not hand generated.
So i cannot use view.
So is there any option that would allow me to use single query on different schema's ?Hi,
970773 wrote:
Scenario :
Table XYZ is created in Schema A
After an year, the old data from the previous year would be moved to different schema. However in the other schema the same table name would be used.
For eg
Schema A contains table XYZ with data of 2012 yr
Schema B contains table XYZ with data of 2011 yr
Table XYZ in both the schemas have identical structure.
So can we fire a single select query to read the data from both the tables in effective way.That depends on what you mean by "effective".
Eg select * from XYZ where date range between 15-Oct-2011 to 15-Mar-2012.
However the data resides in 2 different schema altogether.You can do a UNION, so the data from the two years appears together. The number of actual tables may make the query slower, but it won;t change the results.
Given that you have 2 tables, the fact that they are in different schemas doesn't matter. Just make sure the user running the query has SELECT privileges on both of them.
Creating an view is an option.Is it? You seem to say it is not, below.
But my problem, there is ORM layer(either Hibernate or Eclipse Top Link) between the application and the database.
So the queries would be formed by the ORM layer and are not hand generated.
So i cannot use view.So creating a view is not an option. Or is it?
So is there any option that would allow me to use single query on different schema's ?Anything that you can do with a view, you can do with sub-queries. A view is merely a convenience; it just saves a sub-query, so you don't have to re-code it every time you use it. Assuming you have privilges to query the base tables, you can always avoid using a view by repeating the query that defines the view in your own query. It will not be any slower -
Time Characteristics: MTD and Yesterday (How to adjust for different times
Hi,
I have this report which runs daily without any user input based on
Current Calendar Day (SAP Exit)-1 [for column 1 on the report]
and
Current Calendar Month [for column 2 on the report]
If today I want to run this report for the Jan 20, 2006 how best can this be done without the need for writing ABAP code?
i.e. I want on the report, column 1 as Yesterday(Jan 19, 2006)
and column 2 MTD (Jan 20, 2006)
Any help?Dear Amanda,
The restriction on key figures is done in a similar way as the restriction on characteristics.
I guess that you have a characteristic 0CALDAY "Calendar Day", which is restricted by variable 0DAT. By this you have defined the subset of your InfoProvider, on which you want to report.
Now, add the key figure which you want to restrict by a fixed date. Select "Edit" from the key figure's context menu and drag 0CALDAY upon the key figure. Restrict 0CALDAY by "January, 29th 2006". Add the same key figure a second time and restrict it by variable 0CALMONTH. Add the same key figure a third time and restrict it by the fixed time frame "January, 1 2006" to "January, 20th 2006".
This should work as you intended. If you have more than one key figure which has to be restricted in this way, it could be more appropriate to create a second structure with the above mentioned restrictions instead of restricting the key figures directly.
Greetings,
Stefan -
How to use dynamic select query which queries from 3 different table.
Hi All,
I am new to Toplink, i would like to use a named query to select some of the columns from 3 different tables with dynamic where clause.
I have used the following lines. Please tell me how to get code for the dynamic where clause.
First try :
Vector objPersons = (Vector)session.executeQuery("findPersonByGlobalID",Person.class,vQueryArguments);
The above method is not returning the vector or collection.
Second Try:
ReadAllQuery query = new ReadAllQuery(Person.class);
query.useCollectionClass(LinkedList.class);
LinkedList person = (LinkedList) session.executeQuery(query);
The second try is returning the collection but, this fetches all the record from the table.
1. How to query for range of records?
2. How to query from multiple tables for some range. How to use dynamic range values ?
Please reply with your answers or some pointers would help.
Thanks and Regards,
Vijay.BHi,
Did you try using a SQLCall ? It might be able to satisfy you requirements .. :-
Employee employee = (Employee) session.executeSelectingCall(
new SQLCall("SELECT * FROM EMPLOYEE WHERE EMP_ID = 44")
);You can get more information here :-
http://www.oracle.com/technology/products/ias/toplink/doc/1013/MAIN/_html/qrybas004.htm
Regards,
Sandeep -
Key Fields for Vendor as a Customer
Hi experts,
I have to develope report for vendor payment, my senario is as follows
- vendors which are also our customers,
- payments done at every 15 days
- I have to develope the payment summary report for this please tell me which are the key fields to be used for vendor as a customer to develope this report.
- some deductions are carried out in MM side and some are carried in SD side
Regards
AmolHI,
Vendor Number - LIFNR
Customer Number - KUNNR
These are from table LFA1.
Also from the finance side use tables for payment details regup and reguh
also please check on bsad bsas bsed bseg bses bsik bsis tables.
Thanks& Regards,
Kiran -
Add key fields for FM REUSE_ALV_HIERSEQ_LIST_DISPLAY
Hi everyone,
I would like to ask if it is possible or is there a way to increase the number of key fields used in FM REUSE_ALV_HIERSEQ_LIST_DISPLAY. The table parameter for the key fields is IS_KEYINFO. It can only contain 5 key fields. My program needs to have 7 key fields. I cannot modify type group SLIS to add more fields in its type declaration since it is a global object.
Thanks,
EricHi everyone,
I would like to ask if it is possible or is there a way to increase the number of key fields used in FM REUSE_ALV_HIERSEQ_LIST_DISPLAY. The table parameter for the key fields is IS_KEYINFO. It can only contain 5 key fields. My program needs to have 7 key fields. I cannot modify type group SLIS to add more fields in its type declaration since it is a global object.
Thanks,
Eric
Maybe you are looking for
-
my grand mother has an ipad 1. I updated to ios 5, which is as far it can go. how do I get ibooks loaded on it? current app says it requires ios 7 thanks!
-
Handling Tableviewcolumns event
HI All, I want to do eventhandling for tableviewcolumn, I am giving one link in my tableviewcolumn,when user clicks that column link it should redirect to next page or view. Can anyone tell me how i can acieve this funtionality. This is my view now w
-
Hi All, my folder structure is D:\Work\final\webfiles. i have files in webfolder as RGB mode and i need to save as CMYK in the D:\Work\final folder. Please help us to solve. Regards, Vinoth
-
StackOverflowError - when trying to run a JSP Page in JDeveloper
Hello all, I am experiencing an error when I try to run a .jspx page in JDeveloper (10.1.3.3). Below is the error I am getting. Any idea where I need to look to resolve this memory issue? {color:#ff0000}INFO: Unable to dispatch JSP Page : Exception:o
-
How to reinstate duplicate message on import
Hi guys. First post and fairly new to Mac. I was importing photos from a CD and when it asked me if I wanted to eliminate duplicates I selected yes and hit do not show me this message again. Is there any way to get that message to begin appearing aga