Infoset Coding (SAP Query)
Hi, I need a field in a Query that required programming. I hope someone can help me.
I need to get the first character that is in the header note of the purchasing requisition (ME53N). So I am trying to create a Local field in the infoset with some coding that help me to pull that information for any purchasing requisition.
If any of you guys have and example, please help me.
Regards,
Francisco
Hi Aryat,
Yes it is possible to include code in infoset and fetch data from database tables.
Go to tcode- SQ02, and change query area from global->standard and click change.
Now click on Extras,it will enable all the custom fields on right hand side.
Now select the field from the row and click coding for addition symbol as mentioned in below screen shot, it will take you to the program line screen and you can code here.
After completing coding save and generate the infoset and adjust the query again otherwise new changes will not reflect.
Hope it will solve your issue.
Similar Messages
-
Adding Fields to Custom Infotype Using Custom Infoset in SAP QUERY
Hi All,
We have a requirement to add fileds to a custom infotype for querying Custom Infoset in SAP Query.
We are facing problem as the added field is not getting displayed in the Query set so that we can select and display it in the Basic List along with the other filds.
Kindly suggest a solution.
Full points will be rewarded.
Thanks in Advance
KumarHi Salman,
Thank you for your valuable information. I haven't Configured Dynamic Actions yet. Is it simple to write the Logic for Dynamic Actions. Is this the only way to solve this Issue?
I tried by adding the standard fields, but they are not populating the values; but just appearing as Input Fields with Input help option.
Please let me know if you have any suggestion in this direction?
Regards,
Hems. -
Hello.
I would like to ask about using sap query to extract data from table in infoset. Is it possible to write an abap code and get data from certain table? I ask because I do not have any experience in that. Tried to find any examles, but nothing find.
My question is simple- how to extract data using simple abap program, then creatу an infoset with this query and then how to create attribute list based on infoset?
Thanks a lot.Hi Aryat,
Yes it is possible to include code in infoset and fetch data from database tables.
Go to tcode- SQ02, and change query area from global->standard and click change.
Now click on Extras,it will enable all the custom fields on right hand side.
Now select the field from the row and click coding for addition symbol as mentioned in below screen shot, it will take you to the program line screen and you can code here.
After completing coding save and generate the infoset and adjust the query again otherwise new changes will not reflect.
Hope it will solve your issue. -
Issue with Infoset of sap query
Hi All,
There is an existing 'z' Sap query and the inofet is created using the data source 'Data retreival by program'(Data structure:BAPIEXPLOSIONLIST).
I got the requirement to add onemore radiobutton(for Costing Run) to the selection screen of exsiting query and when the radio button is clicked on, it should display two more fields (Costing Run name and Costing Run date).So,I have added the below lines in the existing Infoset.
1.Under the extras button and in data read program tab,I have added the below code for radio button and the two fields for selection.
PARAMETERS p_cstrun LIKE jest-inact RADIOBUTTON GROUP cost.
SELECT-OPTIONS sp_kaid FOR keko-kalaid MODIF ID s1.
SELECT-OPTIONS sp_kadt FOR keko-kaladat MODIF ID s1.
2.Under the extras button and in code tab and in at seletion-screen output,I have added the below logic to enable those fields dynamically.
LOOP AT SCREEN.
IF p_CSTRUN EQ 'X' AND SCREEN-GROUP1 EQ 'S1'.
screen-invisible = 0.
screen-active = 1.
MODIFY SCREEN.
elseif p_CSTRUN NE 'X' AND SCREEN-GROUP1 EQ 'S1' .
screen-invisible = 1.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
After adding this,the existing selection-screen format has been changed.Please look at the below changes.
->Actually,there are two blocks in the existing screen with block titles.Now they are replaced with some different text
->And one more block for output format and under that the layout field selection was there in previous selection screen.Now this layout field text is changed to 'Sap Listviewer' and some butto has also come additionaly in the output format.
How to retreive the old selection-screen with previous texts and formats.
Can any one suggest to resolve the issue?
Thanks in advance!!
Best Regards,
MounikaThis is the complete code of selection-screen
SELECTION-SCREEN BEGIN OF BLOCK issel
WITH FRAME TITLE text-S01.
SELECTION-SCREEN SKIP.
PARAMETERS p_cstcur LIKE jest-inact USER-COMMAND ex DEFAULT 'X' RADIOBUTTON GROUP cost .
PARAMETERS p_cstfut LIKE jest-inact RADIOBUTTON GROUP cost.
PARAMETERS p_cstprv LIKE jest-inact RADIOBUTTON GROUP cost.
*Begin of Insert CBDK972000
PARAMETERS p_cstrun LIKE jest-inact RADIOBUTTON GROUP cost.
SELECT-OPTIONS sp_kaid FOR keko-kalaid MODIF ID s1.
SELECT-OPTIONS sp_kadt FOR keko-kaladat MODIF ID s1.
*End of Insert CBDK97200
SELECTION-SCREEN SKIP.
PARAMETERS p_niv_g LIKE jest-inact DEFAULT 'X'.
PARAMETERS p_niv_a LIKE jest-inact DEFAULT ''.
PARAMETERS p_niv_f LIKE jest-inact DEFAULT ''.
SELECT-OPTIONS sp_disgr FOR marc-disgr MEMORY ID lev NO-DISPLAY.
SELECTION-SCREEN SKIP.
PARAMETERS p_newfil LIKE jest-inact DEFAULT ''.
SELECTION-SCREEN END OF BLOCK issel.
SELECTION-SCREEN BEGIN OF BLOCK csel
WITH FRAME TITLE text-s02.
SELECT-OPTIONS sp_mtart FOR mara-mtart OBLIGATORY
NO INTERVALS NO-EXTENSION MEMORY ID mta.
SELECT-OPTIONS sp_werks FOR mbew-bwkey OBLIGATORY
NO INTERVALS NO-EXTENSION MEMORY ID bwk.
SELECT-OPTIONS sp_matnr FOR mara-matnr MEMORY ID mat.
SELECTION-SCREEN END OF BLOCK csel. -
Hi ,
I want to change infoset name in sap query sq01.
I dont want to create new query to change infoset name.
Any other option?
Regards,
Satyen TrivediDear Satyen,
Go to menu Edit-->Other user group, choose the user group, where u have assigned the infoset no give the name of ur query and press create button, it will display all the infosets those are assigned with that user group. Now select ur infoset and start developing the query.
see useful tips:
10 Useful Tips on Infoset Queries
Regards,
Abbas. -
Tarnsport infoset and SAP Query
Hi All,
I have created infoset and SAP quesry and user group.
When i created user group it asked me the transport request.IT has been tarnsported to dev to QA.
But infoset and query are not moved to QA.
It is not asking me for create transport reuest.
Please let me know how to tarnsport infoset(SQ02) and Query(SQ01).
ThanksHi all,
Thanks for u r reply.
My query is in global area not in standard area.
Any way i solved the problem but how to transport the variant.
When i read the documentation it is saying that we have create the system variant then only we can transport.
IS it so pleas let me know.
Thanks, -
Hi there. I made a copy of 01 Query from /SAPQUERY/AM usergroup.
But now I've got a problem because there is still a /SAPQUERY/AM01 InfoSet seen as source of new query.
Where can I change that source InfoSet to my own InfoSet? I'd be thankful for help. Greetings. P.Hi,
Sorry to say that its not possible. You can change your query after copying from the standard one. But the the infoset assigned to the query cannot be changed.
Regards,
Soumya. -
Extracting SAP Query,Infoset Data from VB Application
Hi,
I need to get all SAP Queries,Infosets and SAP Query Group data from a VB application.
I have found a Remote Enabled Function called IQAPI_READ_QUERY_CATALOG.
But when I call the Function from a VB application ,the call is not successful and even I am not getting any exception.
The call is getting false with null exception .
Can anyone please guide me.
Or is there any other function module /procedure / table to extract SAP Query ,Infoset,SAP Query Group data??
Thanks in Advance.http://stackoverflow.com/questions/3765373/how-do-i-do-a-select-distinct-using-a-sap-infoset-query
-
How to write ABAP Logic in SAP Query to fetch records from many Tables
Hi Expert,
I have one requirement, want to display all BOM (Equipment BOM, Function Location BOM and Meterial BOM) from a particular plant.
List of tables as below:
EQST: Equipment to BOM Link
TPST: Link Between Functional Location and BOM
MAST: Material to BOM Link
STPO:BOM item
Requirement: When user enters Plant then SAP Query should execute and fetch all BOMs (as mentioned above) from STPO Table.
I have done so far is as follows:
I create User Group, Infoset and SAP Query.
While creating INFOSET, i used 4 tables (EQST,TPST,MAST & STPO) and link between then is as follows:
STPO-STLNR ---> EQST-STLNR : Left Outer Join
STPO-STLNR ---> TPST-STLNR : Left Outer Join
STPO-STLNR ---> MAST-STLNR : Left Outer Join
Now its showing all BOM from all plants though I enter one Plant value.
Please advise me to write SAP Query and Logic to fetch all BOM from selected Plant Value.
Thanks,
Jay.
Edited by: jaykrishna007 on Jul 29, 2011 11:41 AMHi FCannavo,
Thanks for your quick reply.
See, now I changed my Infoset design.
I added one Plant Table (T001W) and then
T001W-WERKS--->EQST-WERKS
T001W-WERKS--->MAST-WERKS
T001W-WERKS--->TPST-WERKS
and then
EQST-STLNR--->STPO-STLNR
MAST-STLNR--->STPO-STLNR
TPST-STLNR--->STPO-STLNR
on selection screen, user will enter Plant Value.
Now its showing some records, but i dont think so i would be correct output or not, please guide me whether it is correct or not?
Thanks,
Jay. -
Hi, Guys!
I'm trying to create a SAP Query, which should display the old and the new position of employee.
The problem is that the SAP Query generates 2 lines for each position, the employee had.
We need a report that display in two or tree a column for each position the employee had. And we have one line for each employee.
Can we do this in SAP Query? Or will we need a development for this report?
Regards,If it is just an addition of previous/old position, I would recommend creating a new field and field group within the infoset of SAP query framework. You may also have to write a small piece of code within the infoset to populate the field value.
If your business scenario is getting complex it is better to have a simple ABAP report rather than enhancing the SAP query.
Thanks
Ravikumar -
SAP Query: InfoSet Filter
Hey experts,
I have an Infoset that contains the JEST table (status of object) and TJ02T (text of the status).
In my query result I only want records in 1 language.
I know I can make a selection criteria on language with a default value.
But now I want to hide the field in the selection criteria.
How can I do this?
I don't find an option to hide selection criteria. And I don't want to make an additional variant.
Is it possible to delete the records in the infoset with some coding?
Thanks
StevenI found the solution in post Re: SAP Query: How to filter records from SAP Query output before display
-
SAP QUERY/INFOSET with OUTER JOIN
Hi,
I have created an infoset (SQ02) using two tables for SAP query.
Table: AGR_TEXTS. Fields: AGR_NAME, SPRAS, LINE, TEXT.
TABLE: AGR_FLAGS. Fields: AGR_NAME, FLAG_TYPE, FLAG_VALUE.
Joined these two tables using outer join. Defined the join condition as AGR_NAME = AGR_NAME. Saved and Generated the infoset.
Created SAP Query (SQ01) using the above created infoset.
In the basic list,
Marked AGR_NAME (AGR_TEXTS), TEXT, FLAG_VALUE as listed fields.
Marked AGR_NAME (AGR_TEXTS), SPRAS, LINE, FLAG_TYPE as selection fields.
Save the query. When execute the query provided the inputs for all the selection fields in the selection screen as given below:
AGR_NAME=Z*
SPRAS=E
LINE=00000
FLAG_TYPE=LICENSE_01
Executed the Query.
Got the results only the matched records as per the selection field FLAG_TYPE.
But I want all the records from table AGR_TEXTS and matched records from table AGR_FLAGS.
I want the report (output) as below,
_AGR_NAME TEXT FLAG_VALUE_
ZCA_BASIC_ACCESS_GLOBAL Non-critical basic access for all users. 53
ZCA_BASIC_ENDUSER_ACCESS UK:CA Basic Enduser Access
ZCA_BASIC_ENDUSER_ACCESS_UK UK:CA Basic Enduser Access UK 52
ZCA_BASIC_ENDUSER_SU52_UK UK:CA Basic Enduser Access to change Parameter ID's
But I got the report (output) as below,
_AGR_NAME TEXT FLAG_VALUE_
ZCA_BASIC_ACCESS_GLOBAL Non-critical basic access for all users. 53
ZCA_BASIC_ENDUSER_ACCESS_UK UK:CA Basic Enduser Access UK 52
Apprecited your help. Thanks.
Code Formatted by: Alvaro Tejada Galindo on Dec 30, 2009 2:20 PMIdentify a KF for which there are non-zero values for all accounts in the cube.
Create the query with Account (from MP coming from both IO and cube) and this KF. KF will have 0 values for accounts not existing in the cube. Create a condition to show only the 0 value for the KF. This should show you all the accounts in the IO which are not in the cube. -
At line-selection in SAP Query ( Infoset ) code
Hi all ,
Here is one for you : can I put somehow the following code in a Sap Query ( at infoset level of course ) :
at line-selection.
set parameter id 'BUK' field XXX-bukrs.
set parameter id 'BLN' field XXX-belnr.
set parameter id 'GJR' field XXX-gjahr.
call transaction 'FB03' and skip first screen.
(In other words I would like to see the documents behind a line in the list)
Some explains : my query's output would be ABAP list , the bukrs, belnr, gjahr fields are on the lines of my resulting list, and my problem is with those XXX 's - I don't know where are stored the lines of my ABAP list.
I'm pretty new at ABAP so any idea and explains about the generated SAP Query code
is appreciated . I looked at the final code but seemed very complex for my level.
Please guide me in this area ( I know the basic things like writing pretty simple reports )
Thanks !
Best of all
ZoliHi,
You need to add extra piece of code as below:
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
I_callback_user_command = 'USER_COMMAND' "see FORM
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
* FORM USER_COMMAND *
* --> R_UCOMM *
* --> RS_SELFIELD *
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
* Check function code
CASE r_ucomm.
WHEN '&IC1'.
* Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = 'EBELN'.
* Read data table, using index of row user clicked on
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
* Set parameter ID for transaction screen field
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
* Sxecute transaction ME23N, and skip initial data entry screen
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM.
"For further information please refer the link below :
http://www.sapdev.co.uk/reporting/alv/alvgrid_ucomm.htm
Thanks,
Sriram Ponna. -
How to add new codes into SAP Query/Infoset
Hi Experts,
First time working with SAP Query.
I need to enhance an existing Query to add a new field into a report. I have added new tables into this Infoset and joined my new tables with existing tables and able to extract the new fields out on the report. But here are my problems:
Example of original output:
X88888 500000
X99999 400000
Example of new output after adding my 2 new tables to get 1 new field to output:
X88888 50000 01/08/2009
X88888 50000 01/25/2009 <--- for X88888 customer, I want only this record w/ latest date to be output
X88888 50000 01/22/2009
X99999 40000 03/09/2009
X99999 40000 04/18/2009
X99999 40000 04/19/2009 < -- for X99999, I want only this record w/ latest date to be output
Where/How i can add the code to control this logic so that only 1 record per customer with the highest date can be output. I looked at the query program and it looks very confusing and hard to understand.
Please advise,
Thanks,
SamHi Sam,
Instead on adding new table/tables , better way to use Direct Read from your single table.
Please read the below steps to suffice your requirement.
Assumption: Let your original table be A and second table is B.
Tables A and B are having field X1 and X respectively, using these fields, they can be joined.
You want field date1 of table B.
Infoset Changes:
1. Go to SQ02 (Enter Infoset name, click on Change button)
2. Create an extra field E_date of type date (Sy-datum), by clicking on 'Extras' (F5) button.
3. Select that field in one of the field group of your Infoset.
4. Click on Code Icon (Shift+F8) displayed on application bar, you will be getting lists events in 'Code section'.
5. In Data Section , declare an internal table like below code (here pseudo code)
data: begin of itab_date occurs 0,
date1 like B-date1,
end of itab_date.
6. In Recod processing Event write the following code.
CLEAR itab_date.
CLEAR E_date.
SELECT date1 FROM B into table itab_date " Retrieving date field from table B
WHERE X = A-X1.
Sort itab_date by itab_date-date1 DESCENDING. "Sort internal table B in decendind order on date1
READ TABLE itab_date index 1. "Read first record of interanal table
E_date = itab_date-date1 "Assigning top most date of internal table into field E_date.
7. Generate the Infoset
Query changes
1.Go To SQ01 (in a new session),
2.Give your Query name, click on change button, and select that field group in which you have added extra field.
3.Select extra field.
4.Go to basic list to select that field in your O/p list.
5.Click on Test button, and see if you are getting desired result.
Please let me know if you need further details.
Regards,
Dinesh -
HI
Is it possible to rename sap query and infoset at a same time instead of changing one by one.?
Thanks
reg
cnsDear Sathya,
SAP does not allow you to rename SAP Query & Info set at a same time.
Note:
The system has to lock the following objects before you are able to use the Rename SAP Info set function:
User group catalog
Info Set catalog
Query catalogs for user groups to which the Info Set that you are renaming is assigned,
Queries using this Info Set
Once all these locks have been set, the system can carry out the function.
Renaming an Info Set can, however, be very time-consuming. These locks may also prevent other users from working in the system for as long as it takes to rename the Info Set.
Thanks & Regards
Dinu
Maybe you are looking for
-
Error deploying logon.par
Hi Experts, I am trying to change the portal logon screen. I followed the insstructions in the documentation to modify the com.sap.portal.runtime.logon.par.bak I exported an par file from nwds and copied to the apps\sap.com\irj\servlet_jsp\irj\root\W
-
Create Third Party Invoice after the Inbound Delivery Creation
Hello, We have a requirement in 3rd party order process, where create invoice with reference to 3rd party order/ items after the inbound delivery completion. Normally 3rd party invoice creation will be done after the MIRO transaction. For this, I hav
-
Hi, I am developing a J2ME game. At the moment i have code which will terminate the game if the game is reaches the time set. Now i want to be able to display the count down on the actual game. I want to display it anywhere on the screen but im not s
-
hi all i am new in this forum and a pl/sql developer and some knowledges of storage structure of oracle.Now i want to learn dba portion including backup etc.. my questions are-- 1.what is nomount and mount state of a database. 2.what is rman why we u
-
Information Broadcasting issue
Hi, I have a BW query which is automated to run in background through Information Broadcasting to send the report to couple of users. The query 'A' runs for 3 hours in Production , it used to run fine. There were no changes done to the Broadcaster se