Displaying record from custom table
I have a custom table ztable (kunnr, vbeln, erdat, erzet, flag). Using these values I would like to display the following
Client Number (4) = '1234'
Filler (6) = space.
Record Type (1) = 'A'
Client Number (15) = vrkpa-kunnr
Customer Name (30) = adrc-name1
This information should be displayed in the following way:
1234 A0012345 Walmart
Can someone help me with this code.
Thank you!
Okay, I see. Is your client number always going to be '1234'? If not, then do not assign a value to it. Otherwise, you'll want to assign the value during your selection statement because the field will be emptied each time you clear the itab line.The same thing goes for your record type 'A'. You need an address number, a date, and a nation as the key for table ADRC (so you need to put the necessary values into w_nation and w_begda). I'm not sure if your customer number corresponds to the address number. Try this:
DATA wa_ztable TYPE ztable.
DATA wa_adrc TYPE adrc.
DATA w_nation type adrc-nation.
DATA w_begda type sy-datum.
DATA: begin of itab occurs 0,
clientnumber(4) type c,
filler(2) type c,
recordtype(1) type c,
customernumber(15) type c,
customername(30) type c,
customeraddress1(30) type c,
customeraddress2(30) type c,
customercity(17) type c,
customerstate(2) type c,
customerzip(9) type c,
customercountry(17) type c,
customercountrycode(3) type c,
customerphnum(10) type c,
end of itab.
w_begda = (put your date here).
w_nation = (put your nation code here).
SELECT * FROM ztable INTO wa_ztable WHERE flag = space.
itab-clientnumber = '1234'.
itab-filler = space.
itab-rectype = 'A'.
itab-customernumber+0(10) = wa_ztable-kunnr.
itab-customernumber+10(5) = space.
SELECT SINGLE * FROM TABLE adrc INTO wa_adrc WHERE
ADDRNUMBER = wa_ztable-kunnr AND NATION = w_nation AND DATE_FROM = w_begda.
itab-customername = wa_adrc-name1.
itab-customeraddress1 = wa_adrc-
itab-customeraddress2 = wa_adrc-
itab-customercity = wa_adrc-city1.
itab-customerstate = wa_adrc-regiogroup.
itab-customerzip = wa_adrc-post_code1.
itab-customercountry = wa_adrc-
itab-customercountrycode = wa_adrc-country.
itab-customerphnum = wa_adrc-tel_number.
append itab.
clear itab.
ENDSELECT.
LOOP AT itab.
*Insert your code to display line here (can just list each itab field, or use column numbers if you want to create spaces between the fields)
ENDLOOP.
Note on the * lines: I don't see a field for the country text. For the address lines, you will probably have to concatenate values from ADRC-HOUSE_NUM1 and ADRC-STREET, and possibly also use ADRC-PO_BOX as well.
- April
Message was edited by:
April King
Similar Messages
-
How to delete the records from custom table???
My requirement is,
I have a custom table, assume as ZABC, I have updated this by my custom program, This data having table can be extracted by BI etract program(Assume ZZZ). Here I am not writing any code for extracting data from table to BI extract program, That they will do by BI extract program. But I want to write the code for
<b>Cleanup of Z tabledelete records 30 days after the BI data extractor has run.</b>
How this is possible suggest me any method having for these???
Thanks SanjuHell Sanjana,
Ask your basis people to do the clean up after 30 days. If you want the clean up only to be done 30 days after BI extract has been done, then u need some sort of indicator to say that BI Extract has been done , like flag and date in a custom table which will be set as soon as extract is done. Then based on that info u need to delete a the records.
Regards -
How to display records from base table as well as some other table?
Hello expert,
I have a requirement to develope a form described below:
One control block and database block.
DB block is based on table T1 (USER, Table_name, Column_name, ACCESS);
In control block, there are three fields,
User, Table user will enter , and DB block will query based on control block fields(user, table_name).
In table it is not necessary that all the columns of any table will be given.
suppose there is a Table X consist of 10 column.
Initially user give access for all the 10 columns through this form.
if we query for user , table, all the record will come from table T1.
now consider the case, when access given to table X number of columns were 10. after that 2 new columns added later.
now there is no info of added column in table T1. i want if user query DB block, these newly added column must display in DB Block.
Please help me out.
Thanks
Dhirender>i want if user query DB block, these newly added column must display in DB Block.
You need to modify your form and add the two columns as base table items. Forms does not add two base table items by itself. -
Display records from database table
My database table has 495K records i want to display them all in se11 tcode and than download into excel ...but because of huge records it timeout.
Do I need to write a program for this?
Or is there any other smarter way.
Regards,
DNPHi,
Please follow the steps below:
1. Go to the selection screen of SE11 and provide your selection criteria (if required).
2. Click on Settings menu->User parameters->ALV Grid display.
3. Now click on Program menu->Execute in background->Provide output device name as LP01 or LOCAL or any valid printer parameters->Click continue->Click Immediate button->Click Save.
4. You can see the background job for this in SM37.
5. Once the background job is completed, it will appear in gleen color.
6. Click on the completed job and then click on Spool button.
7. Once the output is displayed in spool you can now easily download it to excel by clicking on System menu->List->Save->Local File.
Hope this will help you.
Regards,
Venkat -
Display records from two tables in a Repeat Region
I have 2 tables tblNames and tblResults
tblNames
NamesID PK
FirstName
LastName
Address1
Addrees2
tblResults
ResultsID PK
NamesID FK
ResultsInfo
ResultsDate
Results table has a foreign key NamesID containing primary
key of Names table.
I am trying to show a repeat region of results, with a column
showing LastName of tblNames depending on the ResultsID
I have 2 recordsets, rsNames and rsResults but I'm having
trouble showing relevant LastName.Create a new recodset or modify one of the old ones with this
sql:
SELECT LastName, ResultsInfo, ResultsDate
FROM tblResults INNER JOIN tblNames USING (NamesID)
ORDER BY LastName
This will produce a list of LastNames and associated info
Dave Buchholz
I-CRE8
www.i-cre8.co.uk
Skype ID: I-CRE8
"Swn-Y-Mor" <[email protected]> wrote in
message
news:f1ndo2$cp9$[email protected]..
>I have 2 tables tblNames and tblResults
>
> tblNames
> --------
> NamesID PK
> FirstName
> LastName
> Address1
> Addrees2
>
> tblResults
> ----------
> ResultsID PK
> NamesID FK
> ResultsInfo
> ResultsDate
>
> Results table has a foreign key NamesID containing
primary key of Names
> table.
>
> I am trying to show a repeat region of results, with a
column showing
> LastName
> of tblNames depending on the ResultsID
> I have 2 recordsets, rsNames and rsResults but I'm
having trouble showing
> relevant LastName.
> -
Allow multiple records from this table to be displayed in the form is greyed out.
I'm trying to add a second table to my main data source in an InfoPath 2010 form (database template), but the option to allow multiple records from this table to be displayed in the form is greyed out and I can't select it.
Can someone please tell me how to correct this? I'm guessing that there might have to be something change in MS SQL because on other occasions I've have not encountered this problem when adding a second table.
Any help would be greatly appreciated.
Thanks.So I've found a work around, but I still don't know why I'm having the problem in the first place.
I've been trying to relate the two tables by using the primary key in the parent table to a view of the child table that also includes primary key in the parent, e.g. the ORDER ID in the order table relating to the ORDER ID in the view of the order detail
table. For whatever reason whenever I did that InfoPath prohibited the data source from returning multiple order details.
My work around is to use views of both the order table and order details table that include the customer ID and to relate the two table in InfoPath using the customer ID. Now I get a data source that allows multiple order detail records. In order to get
just the order details that I want that relate to a particular order, I use a rule that sets the order id in both the order and order details query data sets before executing the query (as opposed to just the order data set).
Hope that's a clear explanation. -
Need assistance searching records from multiple tables - Please Help!
Hi, I've been trying to solve this problem for several weeks now, and I have exhausted all of my knowledge and experience. I need help, and I hope someone here can give me some direction.
I am using VB 2008, and the CR that comes bundled with VS 2008 Pro. My database is a SQL Server 2005 CE v3.5 (a *.sdf file). I am connecting to the database through a dataset, and I am displaying the report in a CrystalReportViewer.
My dataset consistes of two tables:
1) tblCustomers which has a primary key "CustID", and contains only customer contact and personal information.
2) tblDateVisited which has a primary key of "VisitID", but it also has a column titled "CustID". Basically, every time a customer visits the business, details of that visit are recorded in tblDateVisited, and that record is associated with the customer by their CustID.
Here's what I'm trying to accomplish: I want to be able to display only Customer records when the customer has visited and that visit matches certain criteria. Right now, I am trying to match visits from the "tblVisitDate.PlayerType" column. If the customer has ever had a visit where they matched a particular player type, I want to see those customer records.
I don't know what I'm doing wrong, though. I can search a dataset if I am only querying one table and pulling records from that table. However, whenever I try to add a second table and perform queries on that table to get records from the first table, I can't return any records.
If it helps, I am trying to use one CrystalReportViewer to display multiple reports (user choice) and here's how I'm loading the report into the viewer:
Me.tblCustomersTableAdapter.Fill(Me.dsPlayerTypeReports.tblCustomers)
Me.tblDateVisitedTableAdapter.Fill(Me.dsPlayerTypeReports.tblDateVisited)
Me.ReportFile.SetDataSource(dsPlayerTypeReports.Tables(1))
I am suspicious that my problem is in the Tables(1) method. It confuses me that I can only assign one table as a datasource when I obviously need access to two tables to make this selection work.
Whatever the case, I'm at the end of my rope with this one. I'm not prone to giving up, but I'm at a dead end currently.
Any attempt to assist me with this will be greatly appreciated, successful or not.
Thanks in advance!
-WillNo, I am connected via ADO.NET. I don't think SQL CE can connect through ODBC (or if it can, I haven't been able to figure out how, yet). So this isn't a stored procedure.
When I examine the link, I can only choose an Inner Join or a Left Outer Join. Right Outer and Full Outer are not available. Could this be a problem with the dataset I'm using?
Could you explain what you mean by display all of the records and then choose the selection criteria? -
Issue with fetching a record from IHPA table with PARNR value as condition
Hi All,
I am trying to fetch a particular record from IHPA table where i am giving the OBJNR number, PARVW and PARNR as customer no. , But I am not getting any record but if i will give OBJNR and PARVW it will generate a record with having same PARNR value.
Example :
case 1st :-
when i am passing following values in IHPA table,
OBJNR = IE000000000010070910
PRAVW = BP
PARNR = 620000562
it is not generating any record
case 2nd:-
But if i will pass
OBJNR = IE000000000010070910
PRAVW = BP
it will generate a record?(one row) which will include PARNR as same 620000562 along with other value.
Q1 - Why it's not generating in case 1st,
Q2 - How I will resolve this issue ? as i have to link some table as EQUI -
IHPA -
VCKUN
VCNUM ?
I have written a code for this to join :
SELECT A~EQUNR
B~PARVW
C~CCNUM
D~CCNUM
FROM EQUI AS A JOIN IHPA AS B ON AOBJNR = BOBJNR
INNER JOIN VCKUN AS C ON BPARNR = CKUNNR
INNER JOIN VCNUM AS D ON CCCNUM = DCCNUM
APPENDING CORRESPONDING FIELDS OF TABLE IT_OBSO
WHERE A~EQUNR IN S_EQN.
AND PARVW = 'BP'.
But it is not generating any record but when i am commenting the PARVW i am getting the mixed record of PARVW as (BP,SP,SH)
Let me know if any more clarification required.
Highly appreciate your help
Thanks & Regards
ShawHi Santosh,
Thanks for your quick response.
But I am Sorry, I already checked with putting Zero before PARNR.
The issue is still as it is.
Thanks
Shaw -
Retrieve and display info from 3 tables
Been struggling with this for some days now. Setting up a calendar with football fixtures. For some reason, the team names do not appear in the table and this is really killing me. I thought I knew something about sql and php, guess not.
So for building up this page, I use 3 tables, Season, Teams & Calendar containing a.o. these columns. The first table, season, has only 1 record/row, being the season that's up, in this case 2010-2011:
Season
id (primary key - AI)
current
Teams
id (primary key - AI)
season
leagueid
teamid (unique value)
teamname
Calendar
id (primary key - AI)
season
leagueid
hometeamid
awayteamid
So, what the query should look like is, based on that 1 record from the table season, it has to select all games from the table calendar, selecting all the columns as displayed above. Now that's the easiest part, the hardest part is, replacing the hometeamid AND awayteamid by their names from the teams table. The teamid you see in the table teams is also used in the table calender. Below some basic input from the tables in question, to get a better feel of it:
Season
1
2010-2011
Teams
ID
Season
League ID
Team ID
Team Name
1
2010-2011
u12
1245-u12aa
Team XYZ
2
2010-2011
u8a
9521-u8a
Team ABC
3
2010-2011
u12
1245-u12a
Team HFH
Calendar
ID
Season
League ID
Hometeam ID
Awayteam ID
1
2010-2011
u12
1245-u12aa
5874-u12a
2
2010-2011
u12
9521-u12ab
7436-u12abSo far you have 4 tables, so the links between the 4 tables is:
1)id from season table(parent) is linked to seasonid from teams table(child)
2)id from season table(parent) is linked to seasonid from calendar table(child)
3)id from league table(parent) is linked to leagueid from teams table(child)
So the joins between them are:
JOIN1: season.id=teams.seasonid
JOIN2: season.id=calendar.seasonid
JOIN3: league.id=teams.leagueid
To extract from multiple tables, SQL query would be as follows:(criteria 1 is optional)
SELECT * FROM teams,season,league,calendar
WHERE [CRITERIA 1] AND JOIN1 AND JOIN2 AND JOIN3
To create relational tables, change all the tables ENGINE=INNODB
then
ALTER TABLE foreign table name ADD FOREIGN KEY(' insert foreign key') REFERENCES(' insert database.primary table.primary key ')
ON DELETE CASCADE ON UPDATE CASCADE -
Create a procedure which requires displaying information from two tables
What if we want to create a procedure which requires displaying information from two tables. In this situation,
I need to display all the details of an employee from an 'emp' table based on the deptno. and also their salary information which is
stored in "Salgrade" Table. Is the use of "And" the correct way of using it?
Do I need to declare all the attributes before begin or I can just access them directly? Thanks
Create Procedure findDept
( I_deptno IN number
) As
Begin
Select Ename, Job, MGR, Hiredate, Sal, Comm, Dept_no from emp and exp, grade , location from salgrade where dept_no
= I_Deptno;
Exception
When NO_Data_Found then
DBMS_Output.Put_Line(' Department not found"|| I_deptno);
End findDept;Hi,
Besides Qwerty's remark, you've also got a quoting error:
Change
DBMS_Output.Put_Line(' Department not found"|| I_deptno);
{code}
into
{code}
dbms_output.put_line(' Department not found: '|| i_deptno);
{code}
Which leads to the question:
What do you want to do when a record is found?
Display it? -
How to fetch corresponding records from 2 tables using ADF Toplink & EJB
Hi,
I am unable to fetch records from 2 tables, which has a foregin key.Used the custom query in toplink, But the output is the cartition of the first table draged and the first row of the second table.The output required should be in the form of ADF Table. I am able to find the output in JSF data table.
Two tables:
Table name:Solutions
sol_id varchar2(PK)
sol_name varchar2
Table name:Solution_details
sol_id varchar2(FK)
common_asum_id varchar2(PK)
common_detail varchar2
Output Required:
sol_id,sol_name,common_asum_id,common_detail
Custom query:
SELECT * FROM solutions a
,solution_details b
WHERE a.sol_id=b.sol_idHi,
I am unable to fetch records from 2 tables, which has a foregin key.Used the custom query in toplink, But the output is the cartition of the first table draged and the first row of the second table.The output required should be in the form of ADF Table. I am able to find the output in JSF data table.
Two tables:
Table name:Solutions
sol_id varchar2(PK)
sol_name varchar2
Table name:Solution_details
sol_id varchar2(FK)
common_asum_id varchar2(PK)
common_detail varchar2
Output Required:
sol_id,sol_name,common_asum_id,common_detail
Custom query:
SELECT * FROM solutions a
,solution_details b
WHERE a.sol_id=b.sol_id -
SQLite - populating a list with records from a table
I'm fairly new to FB and AIR but have run myself through some tutorials regarding event handling and code structure. I have made some progress with an app for my Android 'phone which uses and SQLite database.
I've created the DB and stored it under assets.
I can open and read from it and store the records from a table in the DB to an array and then put the records into an arraycollection.
via the list dataprovider I then can assign the records to the list and they show up at runtime in the list.
I then presumed that the list changehandler event would allow me to assign the selecteditem in the list to a label control. Unfortunately the label control just gets 'object object' displayed when a list item is selected - almost a sif the list were empty.
I cannot work out how to paste the code into this forum message but any advice on either of these problems would be greatly appreciated.
ThanksI'm fairly new to FB and AIR but have run myself through some tutorials regarding event handling and code structure. I have made some progress with an app for my Android 'phone which uses and SQLite database.
I've created the DB and stored it under assets.
I can open and read from it and store the records from a table in the DB to an array and then put the records into an arraycollection.
via the list dataprovider I then can assign the records to the list and they show up at runtime in the list.
I then presumed that the list changehandler event would allow me to assign the selecteditem in the list to a label control. Unfortunately the label control just gets 'object object' displayed when a list item is selected - almost a sif the list were empty.
I cannot work out how to paste the code into this forum message but any advice on either of these problems would be greatly appreciated.
Thanks -
Incomplete Data on report (report does not show all records from the table)
Hello,
I have problem with CR XI, I'm running the same report on the same data with simple select all records from the table (no sorting, no grouping, no filters)
Sometimes report shows me all records sometimes not. Mostly not all records on the report. When report incomplete sometimes it shows different number of records.
I'm using CR XI runtime on Windows Server 2003
Any help appreciated
Thanks!Sorry Alexander. I missed the last line where you clearly say it is runtime.
A few more questions:
- Which CR SDK are you using? The Report Designer Component or the CR assemblies for .NET?
- What is the exact version of CR you are using (from help | about)
- What CR Service Pack are you on?
And a troubleshooting suggestion:
Since this works on some machines, it will be a good idea to compare all the runtime (both CR and non CR) being loaded on a working and non working machines.
Download the modules utility from here:
https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip
and follow the steps as described in this thread:
https://forums.sdn.sap.com/click.jspa?searchID=18424085&messageID=6186767
The download also includes instructions on how to use modules.
Ludek -
Display data from diferent tables
My requirement is to display data from diferent tables supose tables likeVBAK and VBAP.it will allow for all entries concept oops abap?.
how to write code for display data from diferent tables .
method WDDOINIT.
data:
node_sflight type ref to if_wd_context_node,
Itab_sflight type standard table of SFLIGHT.
select * from SFLIGHT into table Itab_sflight.
node_sflight = wd_context->get_child_node( name = 'SFLIGHT_NODE' ).
node_sflight->bind_table( itab_sflight ).
endmethod.
Thanks,
RamaHI,
IS IT CORRECT WAY OF DONIG CODING?
IF I AM WORNG PLEASE SUGEST ME.
method WDDOINIT.
data:
node_sflight type ref to if_wd_context_node,
final type standard table of vbap.
types: begin of t_vbak,
vbeln type vbak-vbeln,
end of t_vbak.
endmethod.
data wa_vbak type t_vbak.
data i_vbak type standard table of t_vbak.
types: begin of t_vbap,
vbeln type vbap-vbeln,
posnr type vbap-posnr,
matnr type vbap-matnr,
end of t_vbap.
data wa_vbap type t_vbap.
data i_vbap type standard table of t_vbap.
select vbeln from vbak into table I_vbak.
select vbeln posnr matnr from vbap into table I_vbap
for all entries in I_vbak
where vbeln = i_vbak-vbeln.
loop at I_vbak.
read table i_vbap with key vbeln = I_vbak-vbeln.
final-vbeln = I_vbap-vbeln.
final-posnr = I_vbap-posnr .
final-matnr = I_vbap-matnr .
append final.
clear final.
endloop.
node_sflight = wd_context->get_child_node( name = 'NODE_VBAP' ).
node_sflight->bind_table( final ).
endmethod.
Thanks,
rama -
How to get large no of records from adf table
Hi All,
I'm working on adf.I'm using jdeveloper 11.1.1.5 version.In my adf application i have 1000 records in my adf table.I want to get the 500 selected records from that table at a time.But im not able to get huge number of records.How can i get the records from adf table.Please give me ur valuable suggestions.
Thanks!Hi.
for large record check the oficial doc.
http://docs.oracle.com/cd/E24382_01/web.1112/e16182/bcadvvo.htm#CEGDBJEJ
PAGE_RANGING is the best option for large tables.
and these maybe will help you
Re: Performance scrolling large ADF tables
Re: Expert opinion needed: Best practices to handle huge rowsets on UI
Maybe you are looking for
-
I have two iPod Nano's, recent versions, each sync'd to its own Mac. In the past, I just downloaded the update and then copied it to the same folder on the other computer (thus avoiding having to download the update twice). Ususally, this is the ipsw
-
API for getting diagnotic server info
Is there an API for getting diagnostic information about the server (memory usage, etc.). We'd like to write a program to monitor the server.
-
TS1702 my apps won't update errors message reads "could not be downloaded at this time
I been having this problem for a week now
-
Please Help, Genius Maxfire gamepad won't work in Mac os Yosemite in MacPro.
I have a Genius Maxfire 3 gamepad and this work fine in Mavericks in a new MacPro, after update to Yosemite this don't work, please if someone have a solutions, please help. Thanks, Juan.
-
Do I need to installl classic for .sit files?
.sit files don't work for me. Do I need to install classic or what should i do?