Material on SAP Query
Hi,
I need material on SAP Query (not BW!!).
Can you provide me with a link, or training material?
Thank you.
Tad
You can use simple SAP Querry from SQVI , but it is client dependant and user dependant can not be transportable.
use MARA, MARC,MBEW combination with outer loop option to get maximum results.
Paartha
Similar Messages
-
Display only the last record per material in SAP query
Hi,
I have created a SAP Query using the quickviewer that is a join between 2 tables (MSEG and MKPF) that consist of material document information and date of posting.
The results are fine however I would like only the last record per material to be displayed.
Can anyone tell what do I need to add so for only the last record per material be displayed in the output.
Thanks,
MarkHi Mark,
May be if you use Control Level processing .........I think you will be able to get the result you want. Try displaying as Below,
LOOP AT XXXXX.
AT FIRST material.
ENDAT.
AT LAST material.
*...Display what ever you want here. It will display at end of every material.
ENDAT.
ENDLOOP.
Before using sort the table with key material in ascending.
Hope what I had to say is helpful to you.
Cheers,
Raga Suman. -
SAP Query - material costs split by labour/ingredients
Hi,
Is it possible to create a SAP query to show the following;
Material / Lab unit cost / Material lab cost
I'd also like to be able to select r show 1 or 2 cost variants.
I essentially need a list of materials and their costs broken down into their constituent parts.
How can I do this please?
ThanksHi Commandante
You can not have WIP split in the FI GL accounts.....
However, there is a work around possble which can give you the break up in report
You need to do small tweaking to get WIP by cost component
1. Define as many LINE IDs as your cost components in OKTZ
2. For eg: If you have cost components like raw material, packing material, labor, machine cost.... then define similar LINE IDs and do the relevant configuration for WIP as per these line IDs.... Assign the specific cost elements in WIP config instead of masking....
3. Assign cost comp str in OKN0 and choose product group = Material Group.. Transport it to production
4. Run KKRV to collect the data
5. Now run the WIP reports in KKO0
When you execute your KKO0 reports, WIP would be with the same breakup as your cost components
This is a tried and tested approach!!
Regards
Ajay M -
Creation of SAP Query in SQ02 with Single Table With Condition
Hi All,
I want to Create SAP Query in SQ02 using single Table MCHA.
ii) I dont want all entries of MCHA Table I mean , I have to apply some Condition on this Table.
i.e Suppose I am having actual data in MCHA table is like this for Material M1.
Plant Material Batch BatchCreationdate
P1 M1 B1 20.06.2007
P2 M1 B1 04.05.2009
P3 M1 B1 04.05.2009
But I want the Output of SAP Query is like this:
Material Batch BatchCreationdate
M1 B1 20.06.2007
That is irrespective of Plant if Material & Batch are equal ---> 1st record with Lowest date shoud get at the output.
Please help me How write the code on single table in the SAP Query.
Thanks,
Kiran ManyamHi,
Your query should be like this:
Select MATNR CHARG HSDAT
from MCHA
into table t_mcha
where matnr = Materlal number from selection screen.
The structure of t_mcha should contain the fields that you select.
Then sort the table by date ascending
Sort t_mcha by HSDAT.
Hope this solves your problem.
Thanks,
Sowmya -
Addition of new column into SAP query program
Hi freinds,
There is a query program(joins EKKO,EKPO) which contains columns like vendor,purchase doc,item,material and material description etc..
I need to insert a new column 'Supplying plant' in 2nd position after vendor column...When I try to add a field into internal table,am getting short dump error...
Kindly suggest on this problem...
Thanks in advance...
Bharat.Hi,
the program you got is it a copy from a SAP QUERY created on TCode SQ01 ?
If yes got to Tcode SQ01 draw a new one and see the report generated
Best Regards
Jaime -
SAP Query - Additional field that collects information from table RESB
Hello gurus. I have a question.
I want to create a SAP Query that shows me the stock level of a list of materials, and also show me the total quantity of order reservations in an additional field.
I created an InfoSet with table MARD, which is the one that holds the Stock information in a plant. Then I created an additional field which would read information from table RESB, the table that holds order reservations per material.
So I wrote this piece of code:
SELECT * FROM RESB
WHERE MATNR EQ MARD-MATNR and
WERKS EQ MARD-WERKS.
ENDSELECT.
if ( sy-dbcnt NE '0').
MOVE RESB-BDMNG to ZQTY.
ELSE.
MOVE '' to ZQTY.
ENDIF.
This works fine. However, this is currently just catching the first record in table RESB that matches my condition.
What I would like is to collect every instance of RESB-BDMNG and add them to field "ZQTY", have it loop in RESB until it finishes finding every record that match the MATNR and WERKS. With this I could get the total number of order reservations that this material has in that table.
Could someone share some coding that would help me achieve this?Yes! That did it. That's what I needed to do. Thank you so much.
While I'm at it, let me ask you a related question.
When I execute the query, in the first records of the query where there's no value from RESB to transfer, the value of field ZQTY appears empty. Once it finds the first record in RESB and it populates ZQTY with a value, then the rest of the records with no hit get the proper value of 0.
Do you know why the first records in the query appear empty and not with a 0? Is there anything I should add to the coding to fix this? -
Help needed on creating a SAP query
Hi All,
Can somebody give me the step by step procedures of creating a SAP query and Infoset.
My requirement is to display asset master details with Asset number or Asset class as input.
Any pointers or links to create an infoset and query will br highly helpful.
Thanks,
ArunHere are couple of fields you might be needed :
AGKO Cleared Accounts
ANAR Asset Types
ANAT Asset type text
ANEK Document Header Asset Posting
ANEP Asset Line Items
ANEV Asset downpymt settlement
ANKT Asset classes- Description
ANLA Asset Master Record Segment
ANLB Depreciation terms
ANLC Asset Value Fields
ANLH Main asset number
AT02T Transaction Activity Category- Description
AT02A Transaction Code for Menu TIMN
AT10 Transaction type
AT10T Name of Transaction Type
BKDF Document Header Supplement for Recurring Entry
BKORM Accounting Correspondence Requests
BKPF Accounting Document Header
BLPK Document log header
BLPP Document log item
BLPR Document Log Index and Planned Order (Backflush)
BNKA Bank master record
BP000 Business Partner Master (General Data)
BPBK Doc.Header Controlling Obj.
BPEG Line Item Total Values Controlling Obj.
BPEJ Line Item Annual Values Controlling Obj.
BPEP Line Item Period Values Controlling Obj.
BPGE Totals Record for Total Value Controlling obj.
BPJA Totals Record for Annual Total Controlling Obj.
BSAD Accounting- Secondary Index for Customers (Cleared Items)
BSAK Accounting- Secondary Index for Vendors (Cleared Items)
BSAS Accounting- Secondary Index for G/L Accounts (Cleared Items)
BSEC One-Time Account Data Document Segment
BSEG Accounting Document Segment
BSID Accounting- Secondary Index for Customers
BSIK Accounting- Secondary Index for Vendors
BSIM Secondary Index, Documents for Material
BSIS Accounting- Secondary Index for G/L Accounts
CEPC Profit Center Master Data Table
CEPCT Texts for Profit Center Master Data
COBRA Settlement Rule for Order Settlement
COBRB Distribution Rules Settlement Rule Order Settlement
COKA CO Object- Control Data for Cost Elements
COSP CO Object- Cost Totals for External Postings
COSS CO Object- Cost Totals for Internal Postings
CRCO Assignment of Work Center to Cost Center
CSKA Cost Elements (Data Dependent on Chart of Accounts)
CSKB Cost Elements (Data Dependent on Controlling Area)
CSLA Activity master
FEBEP Electronic Bank Statement Line Items
FPLA Billing Plan
FPLT Billing Plan- Dates
GLPCT EC-PCA- Totals Table
KNA1 General Data in Customer Master
KOMK Pricing Communication Header
MAHNV Management Records for the Dunning Program
REGUT TemSe - Administration Data
SKA1 G/L Account Master (Chart of Accounts)
SKAT G/L Account Master Record (Chart of Accounts- Description)
SKB1 G/L account master (company code)
T003T Document Type Texts
T007S Tax Code Names
T087J Text
TAPRFT Text tab. for investment profile
TKA01 Controlling Areas
TKA09 Basic Settings for Versions
TKVS CO Versions
TZB0T Flow types text table
TZPAT Financial Assets Management product type texts
VBSEGS Document Segment for G/L Accounts Document Parking
VTBFHA Transaction
VTBFHAPO Transaction Flow
VTBFHAZU Transaction Activity
VTBFINKO Transaction Condition
VTIDERI Master Data Listed Options and Futures
VTIFHA Underlying transaction
VTIFHAPO Underlying transaction flows
VTIFHAZU Underlying transaction status table
VTIOF Options Additional Data
VWPANLA Asset master for securities -
This problem is about sap query. I have created an additional field in an infoset. The initial header text of this additional field is english. Then I created a query which use the additional field as an output field. If I use this query in other language, however the additional field header remains english. How can I maintain addtional field header to support mutil-language?
Thanks in advance!
--Alex MiaoHi Alex
Please see if below example helps you to understand:
Supposing, we are displaying material description within our query.
1. So we define the join with MARA & MAKT while creating infoset in transaction SQ02.
2. We create feild groups to identify the fiels we use for selection and display.
3. Here after selecting language key from MAKT, by default this will take SY-LANGU always for the case.
4. To make it applicable for different languages we can code in INITIALIZATION Event.
5. To do so we can do it by two options: Use menupath: Goto->Code->Initialization
i) First option using variable: <b>MAKT-SPRAS = SY-LANGU.</b>.
ii) Second option using Parameter-Id: <b>SET PARAMETER ID 'SPR' FIELD SY-LANGU</b>.
6. Save & Generate.
Now when we execute the query, we are defaulting the language as System Language.
Hope the above info helps you for better understanding.
Kind Regards
Eswar -
Sap query and additional fields.
Hello guys.
ABAP it's not my strong skill, but i need to develop some report.
What i need:
input: material, SLED, plant
output: material, SLED, plant, values from characteristic field.
I have created sap query with additional field type c.
Below my code:
TYPES: BEGIN OF charast,
ATNAM(50) TYPE c,
ATWTB(8) TYPE n,
X(50) TYPE n,
C(50) TYPE n,
ATINN(50) TYPE n,
END OF charast.
DATA: char TYPE TABLE OF charast WITH HEADER LINE.
CALL FUNCTION 'VB_BATCH_GET_DETAIL'
EXPORTING
MATNR = MCH1-MATNR
CHARG = MCH1-CHARG
GET_CLASSIFICATION = 'X'
TABLES
CHAR_OF_BATCH = char.
LOOP AT char into TEST (This is an additional field type C.
ENDLOOP.
Questions:
1. How i can return internal table into standard abap type, because i can create additional field only with standart types.
2. Need i fetch exporting parameters before calling FM? Or sap query do it automatically, based on given values on selection screen of the report?
3. How i can return only needed field from FM output? Now, when i'm executing FM via SE37 it's show desired result, but when i'm getting it from code i see strange values.
4. If i don't know exactly return by an FM values, how i can fill structure dynamically?
5. How i can return result of a program not only to additional field but to layout?
Sorry for noob questions and thank you in advance guys!Well, seems like it work fine for me.
Below my crappy, but working code:
DATA: material TYPE MCHB-MATNR,
batch TYPE MCHB-CHARG,
plant TYPE MCHB-WERKS,
sloc TYPE MCHB-LGORT,
gtdt TYPE STANDARD TABLE OF clbatch,
gtdit TYPE clbatch.
SELECT MATNR INTO material FROM MCHB
WHERE MATNR = MCHB-MATNR.
ENDSELECT.
SELECT CHARG INTO batch FROM MCHB
WHERE CHARG = MCHB-CHARG.
ENDSELECT.
SELECT WERKS INTO plant FROM MCHB
WHERE WERKS = MCHB-WERKS.
ENDSELECT.
SELECT LGORT INTO sloc FROM MCHB
WHERE LGORT = MCHB-LGORT.
ENDSELECT.
CALL FUNCTION 'VB_BATCH_GET_DETAIL'
EXPORTING
MATNR = material
CHARG = batch
WERKS = plant
GET_CLASSIFICATION = 'X'
TABLES
CHAR_OF_BATCH = gtdt.
READ TABLE gtdt INTO gtdit
WITH KEY atnam = 'BATCH_SHELF_LIFE_EXPIRY_DATE'.
GTD = gtdit-ATWTB. -
Hello,
I am working on SAP Query in infoset I want to link the MVKE-MATNR to DRAD-OBJKY,
but the length of the two fields are different. So the Query is not allowing the join. Hw can I over come the issue.
Note. One material will have multiple docments.
Thanks,
Ravi.Hi,
Define the final internal table with the fileds of the both internal table it1 and it2.
the programming logic is like as following.
Loop at it1 with every line item.
move line item of it1(work area) into it_final.
read table it2 with key wa_key (the same primary key field in any table it1 and it2).
move line item of it2(work area) into it_final.
endloop.
try this to fill the it_final like this.
regards,
Pulak. -
SAP Query-for Reporting how to create and use it
Hi SAP Gurus,
i need your help. in my project, client is asking to create queries to generate reports, i am not familiar with queries, so would appreciate it if any one can guide me and tell me the procedure for writing and creating queries soon.
also if you have any study material on steps on How to write and create queries for PP module
thank you very muchHi
Please refer below document
http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp
Also refer below
How to Create Infoset Query (SAP Query)
Steps on how to proceed to create a Query:
ADHOC QUERY
A query can be created to extract information from master records i.e Infotypes. For example, by creating a query , the data relating to an employee contained in various Infotypes can be extracted.
Proceedure :
Decide on the various Infotypes we want to make the query. Decide on the area where we want to query i.e Global area or Standard area. Standard area is client specific and globel area will include all clients.
Menu : HR PM Admn - Information System - Adhoc Query
Select area standard and select the user group already created
Creation of new query :
TC SQ03 - Select Environment Select Standard Area - Enter -- If new user group is to be created, enter name of the user group, click on create and enter necessary information and exit after saving
TC SQ02 - Enter name of the Infoset Create enter name of Infoset - Data source -- > Table join by basis table give name of table e.g pa0000 - Enter - Click on insert table if we want to include more tables give name of table one by one and after finishing, place cursor on the joining lines and right click to delete unwanted relationships - check - and go back - field groups - include all table fields - click on generate button - go out
TC SQ03 - Select user group - eg. Payroll
Infoset - Enter name of newly created Infoset
Assign users and Infosets - Assign infosets - put tick on payroll - save and go back
TC PAAH - Expand the nodes and put tick on relevant fields depending upon necessity
Save the query by giving the same name as infoset for easyness..
For executing a query which is already created
1. Go to SQ01 transaction
2. Go to Environment menu->query areas->std areas
3. Then choose the user group where the query is created
4. It will display all the queries created for the group.choose the query you want to executeand click execute.
5. will take to the initial screen
6. Enter the required parameters and execute
Regards
Ranga
Message was edited by:
Ranganathan Srinivasamurthy -
SAP Query format issue (with ABAP list)
Hi All,
I had a requirement to remove all unecessary formatting and text from a SAP query report which can be read by a third party software system. We need only Header line and report data (spaced by Tab).
I have removed all formatting from the report and changed the output format from "SAP list viewer" to "ABAP list" .
The issue is that the report shows material number with 12 digits in output but when we download to file then it adds extra six "0" and makes the Material Number field as 18 digit.
we have already maintained new length as 12 againts the standard length 18 for material number(under field output option)
Please suggest how to get rid of extra digits generated during downloading.
Please help,
Thanks,
RohitHi Brad,
Currently we execute query with SQ01 and from the output screen the user direclty saves the file as "local file..."
The output format is "abap list". We are able to get the exact format but the only problem is with material number. I cant make changes in the program. Is there a way to download it without changing the 12 character ( as displayed on the report output)
Thanks for help.
Rohit -
Need to include Structures in SAP Query
Hi,
I need to extract data of material master from a 3.1 System, where there is a Structure which contains my required information.
How can i include the fields of the Strucutre into my query?
thanks,
ChintanHi,
As Christopher mentioned, structures do not contain saved information. You must read the tables for getting the information.
I assume that you´re working with SAP Query (SQ00). If this is so, you need to create or modify an InfoSet (Environment --> Infosets), where you´re gonna declare the necessary table or view.
When that part is done, go back to your query and assign the infoset, so that you can use the fields that you need. -
SAP Query (SQ02) - Repeated Data
Hi Gurus,
I'm using the SAP Query tools to build a report.
I have to compare four table but I have a problem: Data comes repeated.
In the outbound delivery, I need to check for one position and material number the stock that I have in two differente storage type in the WM module.
When I execute the query, the item line of the delivery as well as its quantity is repeated as much as storage bin found for this material:
Oubound Delivery Number Item Material Delivery Quantity Storage bin Storage bin quantity
80000000230--1XXXXXXXX1AD1--
60
80000000230--1XXXXXXXX1AD2--
40
80000000230--1XXXXXXXX1AD3--
35
80000000230--1XXXXXXXX1AD4--
60
I would like the result to appear as follows, but i don't any programming knoledge. I know there is an option to put some coding in the query. Could anyone guide me or give me a piece of the code that I would have to put ?
80000000230--1XXXXXXXX1AD1--
60
AD2----
40
AD3----
35
AD4----
60
Best regards,
RemiAssuming that you are outputting your query as an ALV list, use the sorting functionality to get the display to look exactly as you have depicted. In the ALV display, select the first two columns and click on the sort button.
-
SAP query , want a new calculation
Hi,
I have a SAP query which displays the material quantity , shipping instructions etc.
what i want is not a new field or column, but just display at the end of the shipping instructions column 2 lines showing the ratios of 2 values.
How do i do this? I know to add additional columns but how am i to add just 2 rows with custom calculations?Hi,
In SQ02, you hae the option to add your own code lines. You will find this icon in the toolbar after teh 'Extras' button.
You can write the code in any event that you wish. Check the node where you are writing this code.
Regards,
Subramanian
Maybe you are looking for
-
Horizontal lines across video in Adobe Premiere Pro 2.0
I had used a software called Virtualdub to deinterlace and remove lots of garbage from the edges of a video. I had also used a software called Neat Video inside of Virtualdub to remove a lot of grains from my vhs video. I prefer to use Adobe Premie
-
I have master detail scenario. I have two forms. First one for the master and the second for the detail. I am first inserting the master data and then i navigate to the other form to insert the detail data. If i make commit from the second form it wo
-
Application storage directory for CS Extensions?
hi, I want to convert my AIR app. into a CS Extension. I have local configuration xml files in my AIR app and I use File.applicationDirectory, File.applicationStorageDirectory..etc to read and write to those configuration files. I have external web s
-
Display faux spreadsheet on front-panel
Hey, thanks to all that have been helping me answer all my LV questions. This site is awesome. My newest question: I am writing data to a spreadsheet in my program... I recieve a measurement from my scale via rs232... then, I display the data (floati
-
Novice designer looking for a simple way to design a question/ answer guide?
I have Adobe CS3 and need to put together a question / answer generator. Looking to write something similar to the Microsoft Help Center but more functionality picts ,diagrams and possibly videos. most likely will host the project on a sever and then