Infoset query logical database and transparent table
Hi!
We have an infoset with the data source logical database=PNP.
We get some fields from the infotype 0768, P0768-PERNR, P0768-BEGDA, etc.
Now we need add another table to make a join within infotype 0768 and table T5F99SE.
For instance, in infotype 0768 I have one record with the fields PERNR and BEGDA and in the T5F99SE I have 3 records related to the unique record of infotype 0768, the fields of the table are PERNR, BEGDA, ACTDT and ADDAT .
The fields values in the example can be:
Infotype 0768: PERNR=00101800, BEGDA=20110401, DICOT=20, BACHE=1200
Table T5F99SE: record 1 PERNR=00101800, BEGDA=20110401, ACTDT=20110401, ADDAT=PB E
record 2 PERNR=00101800, BEGDA=20110101, ACTDT=20110405, ADDAT=PC E01
record 3 PERNR=00101800, BEGDA=20110401, ACTDT=20110409, ADDAT=PA E
The result we want get with infoset query is
PERNR BEGDA DICOT BACHE ADDAT
00101800 20110101 20 1200 PB E
00101800 20110101 20 1200 PC E01
00101800 20110101 20 1200 PA E
I would like to get the fields of the infotype and some fields of the table T5F99SE.
Is possible do this action with ABAP modifying an infoset that already exists adding the fields of the transparent table?
What should I do?
Kind regards,
Julian.
My guess is that it would not be possible to include a transparent table into the LDBs PNP and PNPCE. Would need input from a technical expert there.
However, instead of using the LDB, why don't you explore just using a direct table join? You may need to join PA0000, PA0001, PA0002 along with PA0768 and your other tables. An infoset can then be created on this table join.
To go to the mode where you can create the table join, in your infoset transactions, choose 'Table join' instead of 'LDB'.
Similar Messages
-
Using Logical Databases and the Tables or Nodes Statement
I want to start using Logical Databases whenever possible, but it seems that I need to use the Tables or Nodes statement for the Get statement to work. Is there anyway to avoid Tables/Nodes statement since they are obsolete (and still use LDBs)?
Message was edited by: Jason DeLucaHi Jason,
1) table statement is obligatory:
-> look at abap-docu to GET:
node is a node in the logical database that is assigned to the report (type 1 program) in the program attributes. <b>You must declare the node in the report using the NODES statement (or the TABLES statement, if the node is of the type "table").</b>
2) some ldb-selections from the selection screen
depends on the table-statement too, i remember...
regards Andreas -
Logical Database and Logical Thing
Hi,
i want to access KONV which is cluster table and the field is KWERT.
The thing is that i want to access it by taking customers from KNVV and giving it to VBRK (SALES Table). Now in VBRK i want to have a selection on FKDAT to get a list of Customers stored in the field called KUNAG.
on VBRK-KUNAG basis i want to access the table KONV-KWERT.
If i am doing queries then the System stops responding cuz it has got alot of overhead. So i tried to use Logical Database called VFV.
If this is the best solution means using LDB then how to use it, can anyone help me with this. I tried it by Function module but it is showing all data without considering selection criteria.
If anyone can help me then plz do answer or refer me to any web site so that i can figure this thing out. If anyione has got a good book on that then plz feel free to mail me.
Thanks,
Muhammad Usman Malik
ABAP Consultant
Siemens
[email protected]
+92-333-2700972Thanks Shibba that was very helpful, i applied that but the system overhead was so much.
can u help me with Dynamic selection code.
I used FREE_SELECTION_INIT, FREE_SELECTION_DIALOG and then FREE_SELECTIONS_RANGE_2_WHERE to get ther Selections in one table.
if u want me to send u the code then i can do that cuz i am getting so much mad that this work is not done yet.
The Scenario here is that we want to take BILLED Customers and VKORG as Industrial Billing Customer and then taking VBRK and giving all these Customers and then taking selection on FKDAT range.
Now after that the data should be collected from KONV-KWERT and i want to perform some calculation over it. I am using VFV (Logical Database) to perform this thing because i know that it would be very fast then applying my own queries.
If you can mail me any book on Logical Database and Dynamic selection then it will be very Helpful.
Thanks once again for being such helpful.
Muhammad Usman Malik
SAP Consultant
[email protected]
+92-333-2700972 -
How to retrieve data using logical database and custom select options
Hi all,
I have a selection screen which is displayed by logical database PSJ and I have two select options of my own. I need to retrieve data based on both selection screen of logical database and my own select options. How can I do it?
Thanks in advance.Hai Gupta
Check the following Document & Links
1. A logical database is in fact
a program only.
2. This LDB provides two main things :
a) a pre-defined selection screen
which handles all user inputs and validations
b) pre defined set of data
based upon the user selection.
3. So we dont have to worry about from
which tables to fetch data.
4. Moreover, this LDB Program,
handles all user-authorisations
and is efficient in all respects.
5. tcode is SLDB
good info about Logical Database. you can check the link.
http://www.geekinterview.com/question_details/1506
http://help.sap.com/saphelp_46c/helpdata/EN/35/2cd77bd7705394e10000009b387c12/frameset.htm
Re: How to Create and Use ldb in reports?
Re: Logical databases
http://help.sap.com/saphelp_46c/helpdata/en/9f/db9bed35c111d1829f0000e829fbfe/frameset.htm
Functions for displaying and changing logical databases:
Call Transaction SE36 or
Choose ABAP Workbench -> Development -> Programming environ. -> Logical databases
Interaction between database program and report:
During program processing, subroutines are performed in the database program and events are executed in the report.
To read data from a database tables we use logical database.
A logical database provides read-only access to a group of related tables to an ABAP/4 program.
advantages:-
The programmer need not worry about the primary key for each table.Because Logical database knows how the different tables relate to each other,and can issue the SELECT command with proper where clause to retrieve the data.
i)An easy-to-use standard user interface.
ii)check functions which check that user input is complete,correct,and plausible.
iii)meaningful data selection.
iv)central authorization checks for database accesses.
v)good read access performance while retaining the hierarchical data view determined by the application logic.
disadvantages:-
i)If you donot specify a logical database in the program attributes,the GET events never occur.
ii)There is no ENDGET command,so the code block associated with an event ends with the next event
statement (such as another GET or an END-OF-SELECTION).
1. transaction code SLDB.
2.enter name z<ldb-name>
3.create
4.short text
5.create
6. name of root node (here Ekko)
7. enter short text (f6)
8.node type -> data base table.
9.create
10 change logical DB
riht click on ekko and insert node
here node name ekpo
11.create
12. click on selections
13. press no Should the changed structure of Z<ldb name> be saved first.
14.select tables which you want to join.
15.transfer
16 now you have to o to coding part.
17. save
activate.
19.click to src code
double click on first include and activate
Regards
Sreeni -
In Answers am seeing "Folder is Empty" for Logical Fact and Dimension Table
Hi All,
Am working on OBIEE Answers, on of sudden when i clicked on Logical Fact table it showed me as "folder is empty". I restarted all the services and then tried still showing same for Logical Fact and Dimension tables but am able to see all my reports in Shared Folders. I restarted the machine too but no change. Please help me out to resolve this issue.
Thanks in Advance.
Regards,
Rajkumar.First of all, follow the forum etiquette :
http://forums.oracle.com/forums/ann.jspa?annID=939
React or mark as anwser the post that the user gave.
And for your question, you must check the log for a possible corrupt catalog :
OracleBIData_Home\web\log\sawlog0.log -
Hi
Can some one explain me what is meant by cluster and transparent table
Points will be rewarded.
Regards
Raghu Ram.hi Raghu,
just make a search about this in the ABAP Forum, there are tons of threads about the topic, here is just the most recent example:
transparent vs pooled vs cluster tables
hope this helps
ec -
How to find last executed query on database and or schema.
hi,
how to find last executed query on database and or schema.
yours sincerelySessionwise if you wanna see means use v$session.. Because it will show execution time also so you can analyze it easily and get sql based on SID and serial number ..
Try :
select * from v$session;
Regards.. -
SAP QUERY using ASSHR and ASSOB tables
We currently have SAP query that reports on additional payments (Info type 0015). The user wants to report the cost center held on the cost assignment (Tables ASSOB and ASSHR).
The existing query uses infoset created using PNP logical database.
How do I add or join the ASSOB and ASSHR tables to Info type 0015 to report the cost center?
Thanks in advance
ShamshudinHi Sham
You may need to create custom fields in the infoset and create some code to pull out and display details from ASSHR and ASSOB corresponding to the ifnotype record. -
Regarding Logical database and select statement..
Hi
Experts.
i would like to know the diff b/w logical data base & select statement while using report.
wt is the use of logical databases in R/3. is there any advantage used in the reports.
Thanks & Regards..
Spandana.Dear Spandana,
Go through the below description of LDB. I hope you wil get a fair amount of idea.
SAP comes loaded with all the extras. Among the extras that are most helpful to IT managers are all the access routines needed to pull any business object that managers can think of out of SAP databases. However, SAP has not thought of everything where your particular applications are concerned. SAP organizes its standard database tables to service business units based on conventional business applications. Itu2019s likely your business requires something new, perhaps even something exotic. In that case, you will need to create a new database, using information from different places. Basically, you need a logical database. You need to create a virtual business data object repository consisting of a new kind of record or table that suits your purposes. In addition, the repository should be composed of information that is actually stored in a number of different locations, none of them necessarily logically associated with one another. Letu2019s take a closer look at creating logical databases.
A case for a logical database
Suppose my company manufactures widgets of the most obscure variety, and they are components of other widgets. I sell my widgets as raw material for the more sophisticated widgets built by others, but in some cases I actually partner with other manufacturers in creating yet another class of widget. Now, in my world, I consequently have customers who are also partners. I sell to them and I partner with them in manufacturing and distribution. Also, I need an application that uses both of these dual-use relationships.
Essentially, I have a customer database and a partner database. Neither contains records that are structured to contain the identifying particulars of the other. Thus, I need a hybrid database that gives me tables detailing these hybrid relationships. What can I do? I can go the long way around and write a new database, pulling information from both and creating new objects with a customized program that I write by hand. However, this process is cumbersome and contains maintenance issues. On the other hand, I can use SAPu2019s logical database facility, create my logical database in a couple of minutes, and have no maintenance issues at all.
Logical database structures
There are three defining entities in an SAP logical database. You must be clear on all three in order to create and use one.
u2022 Table structure: Your logical database includes data from specified tables in SAP. There is a hierarchy among these tables defined by their foreign keys (all known to SAP), and you are going to define a customized relationship between select tables. This structure is unique and must be defined and saved.
u2022 Data selection: You may not want or need every item in the referenced tables that contributes to your customized database. There is a selection screen that permits you to pick and choose.
u2022 Database access programming: Once youu2019ve defined your logical database, SAP will generate the access subroutines needed to pull the data in the way you want it pulled.
Creating your own logical database
ABAP/4 (Advanced Business Application Programming language, version 4) is the language created by SAP for implementation and customization of its R/3 system. ABAP/4 comes loaded with many predefined logical databases that can construct and table just about any conventional business objects you might need in any canned SAP application. However, you can also create your own logical databases to construct any custom objects you care to define, as your application requires in ABAP/4. Hereu2019s a step-by-step guide:
1. Call up transaction SLDB (or transaction SE36). The path you want is Tools | ABAP Workbench | Development | Programming Environment | Logical Databases. This screen is called Logical Database Builder.
2. Enter an appropriate name in the logical database name field. You have three options on this screen: Create, Display, and Change. Choose Create.
3. Youu2019ll be prompted for a short text description of your new logical database. Enter one. Youu2019ll then be prompted to specify a development class.
4. Now comes the fun part! You must specify a root node, or a parent table, as the basis of your logical database structure. You can now place subsequent tables under the root table as needed to assemble the data object you want. You can access this tree from this point forward, to add additional tables, by selecting that root node and following the path Edit | Node | Create. Once youu2019ve saved the structure you define in this step, the system will generate the programming necessary to access your logical database. The best part is you donu2019t have to write a single line of code.
Watch out!
The use of very large tables will degrade the performance of a logical database, so be aware of that trade-off. Remember that some tables in SAP are very complex, so they will be problematic in any user-defined logical database.
Declaring a logical database
Hereu2019s another surprising feature of logical databases: You do not assign them in your ABAP/4 Code. Instead, the system requires that you specify logical databases as attributes. So when you are creating a report, have your logical database identifier (the name you gave it) on hand when you are defining its attributes on the Program Attributes screen. The Attributes section of the screen (the lower half) will include a Logical database field, where you can declare your logical database.
Logical databases for increasing efficiency
Why else would you want to create a logical database? Consider that the logical databases already available to you begin with a root node and proceed downward from there. If the data object you wish to construct consists of items that are all below the root node, you can use an existing logical database program to extract the data, then trim away what you donu2019t want using SELECT statementsu2014or you can increase the speed of the logical database program considerably by redefining the logical database for your object and starting with a table down in the chain. Either way, youu2019ll eliminate a great deal of overhead.
Regards
Arindam -
Logical database and program selection filter
Hi experts ,
In my program i have to select pernr through logical database selection and payroll area through manual coding .
Could you tell me how to give the filter condition in program.I am using PNPCE Logical database .
Thank you.
Devika.I guess you mean to modify the screen layout during AT SELECTION-SCREEN OUTPUT via
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
screen-active = 0.
MODIFY SCREEN.
ENDLOOP.
This does hides all screen elements but the screen is still displayed. -
Performance issue in BI due to direct query on BKPF and BSEG tables
Hi,
We had a requirement that FI document number fieldshould be extracted in BI.
Following code was written which has the correct logic but performance is bad.
It fetched just 100 records in more than 4-5 hrs.
The reason is there was a direct qury written on BSEG and BKPF tables(without WHERE clause).
Is there any way to improve this code like adding GJAHR field in where clause? I dont want to change the logic.
Following is the code:
WHEN '0CO_OM_CCA_9'." Data Source
TYPES:BEGIN OF ty_bkpf,
belnr TYPE bkpf-belnr,
xblnr TYPE bkpf-xblnr,
bktxt TYPE bkpf-bktxt,
awkey TYPE bkpf-awkey,
bukrs TYPE bkpf-bukrs,
gjahr TYPE bkpf-gjahr,
AWTYP TYPE bkpf-AWTYP,
END OF ty_bkpf.
TYPES : BEGIN OF ty_bseg1,
lifnr TYPE bseg-lifnr,
belnr TYPE bseg-belnr,
bukrs TYPE bseg-bukrs,
gjahr TYPE bseg-gjahr,
END OF ty_bseg1.
DATA: it_bkpf TYPE STANDARD TABLE OF ty_bkpf,
wa_bkpf TYPE ty_bkpf,
it_bseg1 TYPE STANDARD TABLE OF ty_bseg1,
wa_bseg1 TYPE ty_bseg1,
l_s_icctrcsta1 TYPE icctrcsta1.
"Extract structure for Datasoure 0co_om_cca_9.
DATA: l_awkey TYPE bkpf-awkey.
DATA: l_gjahr1 TYPE gjahr.
DATA: len TYPE i,
l_cnt TYPE i.
l_cnt = 10.
tables : covp.
data : ref_no(20).
SELECT lifnr
belnr
bukrs
gjahr
FROM bseg
INTO TABLE it_bseg1.
DELETE ADJACENT DUPLICATES FROM it_bseg1 COMPARING belnr gjahr .
SELECT belnr
xblnr
bktxt
awkey
bukrs
gjahr
AWTYP
FROM bkpf
INTO TABLE it_bkpf.
IF sy-subrc EQ 0.
CLEAR: l_s_icctrcsta1,
wa_bkpf,
l_awkey,
wa_bseg1.
LOOP AT c_t_data INTO l_s_icctrcsta1.
MOVE l_s_icctrcsta1-fiscper(4) TO l_gjahr1.
select single AWORG AWTYP INTO CORRESPONDING FIELDS OF COVP FROM COVP
WHERE belnr = l_s_icctrcsta1-belnr.
if sy-subrc = 0.
if COVP-AWORG is initial.
concatenate l_s_icctrcsta1-refbn '%' into ref_no.
READ TABLE it_bkpf INTO wa_bkpf WITH KEY awkey(10) =
l_s_icctrcsta1-refbn
awtyp = COVP-AWTYP
gjahr = l_gjahr1.
IF sy-subrc EQ 0.
MOVE wa_bkpf-belnr TO l_s_icctrcsta1-zzbelnr.
MOVE wa_bkpf-xblnr TO l_s_icctrcsta1-zzxblnr.
MOVE wa_bkpf-bktxt TO l_s_icctrcsta1-zzbktxt.
MODIFY c_t_data FROM l_s_icctrcsta1.
READ TABLE it_bseg1 INTO wa_bseg1
WITH KEY
belnr = wa_bkpf-belnr
bukrs = wa_bkpf-bukrs
gjahr = wa_bkpf-gjahr.
IF sy-subrc EQ 0.
MOVE wa_bseg1-lifnr TO l_s_icctrcsta1-lifnr.
MODIFY c_t_data FROM l_s_icctrcsta1.
CLEAR: l_s_icctrcsta1,
wa_bseg1,
l_gjahr1.
ENDIF.
ENDIF.
ELSE. " IF AWORG IS NOT BLANK -
concatenate l_s_icctrcsta1-refbn COVP-AWORG into ref_no.
READ TABLE it_bkpf INTO wa_bkpf WITH KEY awkey(20) =
ref_no
awtyp = COVP-AWTYP
gjahr = l_gjahr1.
IF sy-subrc EQ 0.
MOVE wa_bkpf-belnr TO l_s_icctrcsta1-zzbelnr.
MOVE wa_bkpf-xblnr TO l_s_icctrcsta1-zzxblnr.
MOVE wa_bkpf-bktxt TO l_s_icctrcsta1-zzbktxt.
MODIFY c_t_data FROM l_s_icctrcsta1.
READ TABLE it_bseg1 INTO wa_bseg1
WITH KEY
belnr = wa_bkpf-belnr
bukrs = wa_bkpf-bukrs
gjahr = wa_bkpf-gjahr.
IF sy-subrc EQ 0.
MOVE wa_bseg1-lifnr TO l_s_icctrcsta1-lifnr.
MODIFY c_t_data FROM l_s_icctrcsta1.
CLEAR: l_s_icctrcsta1,
wa_bseg1,
l_gjahr1.
ENDIF.
ENDIF.
endif.
endif.
CLEAR: l_s_icctrcsta1.
CLEAR: COVP, REF_NO.
ENDLOOP.
ENDIF.Hello Amruta,
I was just looking at your coding:
LOOP AT c_t_data INTO l_s_icctrcsta1.
MOVE l_s_icctrcsta1-fiscper(4) TO l_gjahr1.
select single AWORG AWTYP INTO CORRESPONDING FIELDS OF COVP FROM COVP
WHERE belnr = l_s_icctrcsta1-belnr.
if sy-subrc = 0.
if COVP-AWORG is initial.
concatenate l_s_icctrcsta1-refbn '%' into ref_no.
READ TABLE it_bkpf INTO wa_bkpf WITH KEY awkey(10) =
l_s_icctrcsta1-refbn
awtyp = COVP-AWTYP
gjahr = l_gjahr1.
Here you are interested in those BKPF records that are related to the contents of c_t_data internal table.
I guess that this table does not contain millions of entries. Am I right?
If yes, the the first step would be to pre-select COVP entries:
select BELNR AWORG AWTYP into lt_covp from COVP
for all entries in c_t_data
where belnr = c_t_data-belnr.
sort lt_covp by belnr.
Once having this data ready, you build an internal table for BKPF selection:
LOOP AT c_t_data INTO l_s_icctrcsta1.
clear ls_bkpf_sel.
ls_bkpf_sel-awkey(10) = l_s_icctrcsta1-refbn.
read table lt_covp with key belnr = l_s_icctrcsta1-belnr binary search.
if sy-subrc = 0.
ls_bkpf_sel-awtyp = lt_covp-awtyp.
endif.
ls_bkpf_sel-gjahr = l_s_icctrcsta1-fiscper(4).
insert ls_bkpf_sel into table lt_bkpf_sel.
ENDLOOP.
Now you have all necessary info to read BKPF:
SELECT
belnr
xblnr
bktxt
awkey
bukrs
gjahr
AWTYP
FROM bkpf
INTO TABLE it_bkpf
for all entries in lt_bkpf_sel
WHERE
awkey = lt_bkpf_sel-awkey and
awtyp = lt_bkpf_sel-awtype and
gjahr = lt_bkpf_sel-gjahr.
Then you can access BSEG with the bukrs, belnr and gjahr from the selected BKPF entries. This will be fast.
Moreover I would even try to make a join on DB level. But first try this solution.
Regards,
Yuri -
How can i compare two databases and their tables
i have a text.txt file then
i will insert it into db_header and db_details
db_header has tbl_pcountheader with fld_Rack_No(char) PK and fld_DateAdded(date) PK
db_details has tbl_pcountdetails with fld_Rack_No(char) PK, fld_Barcode(char) PK and fld_Quantity(int)
then i will lookup in db_products
db_products has tbl_products and tbl_barcodes
tbl_products has fld_ItemCode
tbl_barcodes has fld_Barcode and fld_ItemCode
now i want to make a prompt contains
Rack No: Date:
Counter No:
Barcode | Item Code | Item Description | Quantity
how can i fill up this by comparing db_details and db_products?
Private Sub bt_upload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_upload.Click
If saveCheckBox.Checked = False Then
MsgBox("Please click the box to continue.")
Return
End If
If lb_file.SelectedItem Is Nothing Then
MessageBox.Show("Please select a file.")
Exit Sub
End If
' Obtain the file path from the list box selection.
Dim filePath = lb_file.SelectedItem.ToString
' Verify that the file was not removed since the Browse button was clicked.
If System.IO.File.Exists(filePath) = False Then
MessageBox.Show("File Not Found: " & filePath)
Exit Sub
End If
' Obtain file information in a string.
Dim fileInfoText As String = GetTextForOutput(filePath)
'LookUP db_header, db_details and db_products
Dim cs As String = "Database=;Data Source=localhost;" _
& "User Id=root;Password=1234"
Dim conn As New MySqlConnection(cs)
Dim ds As New DataSet
Dim da As New MySqlDataAdapter
Dim cmd As New MySqlCommand
Dim dt As New DataTable
Dim stm As String = "SELECT tbl_pcountheader.fld_Rack_No, tbl_pcountheader.fld_DateAdded, tbl_pcountdetails.fld_Barcode, tbl_products.fld_ItemCode, tbl_products.fld_ItemDesc, tbl_pcountdetails.fld_Quantity FROM db_header.tbl_pcountheader INNER JOIN db_details.tbl_pcountdetails ON db_details.tbl_pcountdetails.fld_Rack_No = db_header.tbl_pcountheader.fld_Rack_No INNER JOIN db_products.tbl_barcodes ON db_details.tbl_pcountdetails.fld_Barcode = db_products.tbl_barcodes.fld_Barcode INNER JOIN db_products.tbl_products ON db_products.tbl_barcodes.fld_ItemCode_fk = db_products.tbl_products.fld_ItemCode GROUP BY tbl_pcountheader.fld_Rack_No, tbl_pcountheader.fld_DateAdded ORDER BY tbl_pcountheader.fld_Rack_No"
ds = New DataSet
Try
conn.Open()
da = New MySqlDataAdapter(stm, conn)
da.Fill(ds, "tbl_pcountheader")
DataGridView1.DataSource = ds.Tables("tbl_pcountheader")
Dim headers = (From header As DataGridViewColumn In DataGridView1.Columns.Cast(Of DataGridViewColumn)() _
Select header.HeaderText).ToArray
Dim rows = From row As DataGridViewRow In DataGridView1.Rows.Cast(Of DataGridViewRow)() _
Where Not row.IsNewRow _
Select Array.ConvertAll(row.Cells.Cast(Of DataGridViewCell).ToArray, Function(c) If(c.Value IsNot Nothing, c.Value.ToString, ""))
Using sw As New IO.StreamWriter("c:\report.txt", append:=True)
sw.WriteLine(String.Join(",", headers))
For Each r In rows
sw.WriteLine(String.Join(",", r))
Next
End Using
ds.WriteXmlSchema("Sample.xml")
Dim cr As New CrystalReport1()
cr.SetDataSource(ds)
CrystalReportviewer1.ReportSource = cr
CrystalReportviewer1.Refresh()
Catch ex As MySqlException
MsgBox("Error: " & ex.ToString())
Finally
conn.Close()
End Try
' Show the file information.
Dim PrintPrompt As String
PrintPrompt = MsgBox(fileInfoText, MsgBoxStyle.YesNo, "ProofList")
If PrintPrompt = vbYes Then
'fileInfoText.print()
If saveCheckBox.Checked = True Then
' Place the log file in the same folder as the examined file.
Dim bakFolder As String = System.IO.Path.GetDirectoryName(filePath)
Dim bakFilePath = System.IO.Path.Combine(bakFolder, "back-up.bak")
Dim bakText As String = "Backed-Up: " & Date.Now.ToString & vbCrLf & fileInfoText & vbCrLf & vbCrLf
' Append text to the log file.
'System.IO.File.AppendAllText(bakFilePath, bakText)
My.Computer.FileSystem.WriteAllText(bakFilePath, bakText, append:=True)
'My.Computer.Network.UploadFile(bakFilePath, "C:\Documents and Settings\SAPC-TECH\My Documents\back-up file.bak", "", "", False, 1000)
'My.Computer.FileSystem.DeleteFile(bakFilePath)
'Form2.Show()
End If
'Note: This message box shows that you've uploaded a file and back up it.
MessageBox.Show("Already backed-up to ")
Else
'Me.Close()
'Application.Exit()
'End
End If
'Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
'Form2.Close()
'Me.Close()
End Sub
here's my final code that solves my problem.
i just make the environment of vb into mysql console
so that i can call all the database that i wanted.Private Sub bt_upload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_upload.Click
If saveCheckBox.Checked = False Then
MsgBox("Please click the box to continue.")
Return
End If
If lb_file.SelectedItem Is Nothing Then
MessageBox.Show("Please select a file.")
Exit Sub
End If
' Obtain the file path from the list box selection.
Dim filePath = lb_file.SelectedItem.ToString
' Verify that the file was not removed since the Browse button was clicked.
If System.IO.File.Exists(filePath) = False Then
MessageBox.Show("File Not Found: " & filePath)
Exit Sub
End If
' Obtain file information in a string.
Dim fileInfoText As String = GetTextForOutput(filePath)
'LookUP comparison db_details to db_products
'Dim connString As String = "Database=db_products;Data Source=localhost;" & "User Id=root;Password=1234"
'Dim conn As New MySqlConnection(connString)
'Dim cmd As New MySqlCommand()
'Try
' conn.Open()
' cmd.Connection = conn
' cmd.CommandText = "SELECT Database1.dbo.TableName.ColumnName, Database2TableName.Name, 'The reason why Database 2 isnt defined is the fact that it has been defined in the connection" _
' FROM Database2TableName INNER JOIN _
' Database2TableName2 INNER JOIN _
' WHERE (Database1.dbo.TableName.ColumnName = '')"
' cmd.Prepare()
' cmd.ExecuteNonQuery()
' conn.Close()
'Catch ex As Exception
'End Try
' Show the file information.
Dim PrintPrompt As String
PrintPrompt = MsgBox(fileInfoText, MsgBoxStyle.YesNo, "ProofList")
If PrintPrompt = vbYes Then
'fileInfoText.print()
If saveCheckBox.Checked = True Then
' Place the log file in the same folder as the examined file.
Dim bakFolder As String = System.IO.Path.GetDirectoryName(filePath)
Dim bakFilePath = System.IO.Path.Combine(bakFolder, "back-up.bak")
Dim bakText As String = "Backed-Up: " & Date.Now.ToString & vbCrLf & fileInfoText & vbCrLf & vbCrLf
' Append text to the log file.
'System.IO.File.AppendAllText(bakFilePath, bakText)
My.Computer.FileSystem.WriteAllText(bakFilePath, bakText, append:=True)
'My.Computer.Network.UploadFile(bakFilePath, "C:\Documents and Settings\SAPC-TECH\My Documents\back-up file.bak", "", "", False, 1000)
'My.Computer.FileSystem.DeleteFile(bakFilePath)
Form2.Show()
End If
'Note: This message box shows that you've uploaded a file and back up it.
MessageBox.Show("Already backed-up to ")
Else
Me.Close()
Application.Exit()
End
End If
Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
Form2.Close()
Me.Close()
End Sub
here's my code wherein i have to compare the two database and save it into .txt file
i just have to get this items
Rack No:
Date:
Counter No:
Barcode:
Item Code:
Item Description:
Quantity:
as a prooflist to be print out. -
Any logical database including BKPF table
Hi,
please write me about the logical database that includes BKPF table in it.
Thanks.
deniz.Hi Deniz,
The following LDBs have included BKPF table in E6S IDES.
BMM Documents for Number
BRF Document Database
BRM Accounting Documents
DDF CUSTOMER DATABASE
KDF Vendor Database
SDF G/L Account Database.
by
Prasad GVK. -
Can anyone give ex's for poolled and cluster and transparent tables
Hi ,
Can u help me by providing ex's for poolled and cluster and transparent tablesHi,
Following are the examples for each type.
Transparent table - VBAK.
Cluster Table -BSEG
Pooled Table - KAPOL
Regards,
Ankur Parab -
URGENT:HOW TO COMBINE CLUSTER AND TRANSPARENT TABLE..WITHOUT USING FOR ALL
how can we join bkpf and bseg without using FOR ALL ENTRIES.HOW DO I COMBINE THE 2 TABLES SO THAT I GET BETTER PERFORMANCE.
START-OF-SELECTION.
SELECT bukrs belnr gjahr budat FROM bkpf INTO TABLE i_bkpf
WHERE bukrs = p_bukrs AND "COMPANY CODE
gjahr = p_gjahr AND "FISCAL YEAR
budat IN s_budat. "POSTING DATE IN DOC
IF sy-subrc = 0.
SELECT bukrs belnr gjahr hkont shkzg dmbtr FROM bseg INTO TABLE
i_bseg FOR ALL ENTRIES IN i_bkpf
WHERE bukrs = i_bkpf-bukrs AND "COMPANY CODE
belnr = i_bkpf-belnr AND "A/CING DOC NO
gjahr = i_bkpf-gjahr AND "FISCAL YEAR
hkont = p_hkont. "General Ledger Account"
IF sy-subrc = 0.
SELECT bukrs belnr gjahr hkont shkzg dmbtr FROM bseg INTO TABLE
i_bseg1 FOR ALL ENTRIES IN i_bseg
WHERE bukrs = i_bseg-bukrs AND "COMPANY CODE
belnr = i_bseg-belnr AND "A/CING DOC NO
gjahr = i_bseg-gjahr. "FISCAL YEAR
ENDIF.
ENDIF.
IF NOT i_bseg1[] IS INITIAL.
LOOP AT i_bseg1.
IF i_bseg1-hkont = p_hkont AND i_bseg1-shkzg = 'S'.
v_sumgl = v_sumgl + i_bseg1-dmbtr.
ELSEIF i_bseg1-hkont = p_hkont AND i_bseg1-shkzg = 'H'.
v_sumgl = v_sumgl - i_bseg1-dmbtr.
ELSEIF i_bseg1-hkont NE p_hkont .
IF i_bseg1-shkzg = 'H'.
i_bseg1-dmbtr = - i_bseg1-dmbtr.
ENDIF.
i_alv-hkont = i_bseg1-hkont.
i_alv-dmbtr = i_bseg1-dmbtr.
APPEND i_alv.
v_sumoffset = v_sumoffset + i_bseg1-dmbtr.
ENDIF.
ENDLOOP.
regards
Essam.([email protected])Hi Friend,
I see your code.. there is no other way than using for all entries for your situation.. how ever i saw ur code and a small recommandation in the change of code.
SELECT bukrs belnr gjahr budat FROM bkpf INTO TABLE i_bkpf
WHERE bukrs = p_bukrs AND "COMPANY CODE
gjahr = p_gjahr AND "FISCAL YEAR
budat IN s_budat. "POSTING DATE IN DOC
IF sy-subrc = 0.
if not p_hkont is initial.
SELECT bukrs belnr gjahr hkont shkzg dmbtr FROM bseg INTO TABLE
i_bseg1 FOR ALL ENTRIES IN i_bkpf
WHERE bukrs = i_bseg-bukrs AND "COMPANY CODE
belnr = i_bseg-belnr AND "A/CING DOC NO
gjahr = i_bseg-gjahr. "FISCAL YEAR
ENDIF.
i_bseg[] = i_bseg[]1.
delete i_bseg where hkont ne p_hkont.
else.
Your existing logic...
endif.
In this way you can avoide writing two selects on bseg..
Thanks
Mahesh
Maybe you are looking for
-
Setting UserField values in document rows
Hi all This is the discription of my problem: I have SP1 PL4, moreover I created 2 user Fields in the rows of documents they are named: U_AnzVE, U_AnzPal By code I try to do the following: I add a new entry for example a Purchase Order (or any other
-
Cross company production with subcontracting
Hello Experts, I have two company codes say C1 & C2. When I get the requirement of 1000 nos of FG X, all material will be procured in C1 & 1st operation will be performed in C1. Due to capacity issue, 2nd operation have 1 production line in C1 & 1 pr
-
Why are certain channels not coming out of the master when they are playing?
the sound isnt coming out of the speakers, headphones or not and the bar which shows when its playing, moves in time with what should be playing. why wont it play outloud?
-
Hi mates Just need help/feedback on SAP NetWeaver XI Bootcamp and I need to hear mostly from people who have been to the camp. Indormation from reliable sources is welcomed too. 1. What are the benifts of the bootcamp to a non-basis ABAPer? PS: We ar
-
Please help with resource files!!!
As I was trying to modify the menubar I took out the SArtFile.Bin and Extras2.rsrc from their respective folders. I did this without replacing them first, which prior to this time work perfectly. Now when I try to replace them with the prefer file or