Use destination table values in source to get data
I have a requirement to get data from source table to destination table. Source is oracle say tablename - 'orasource' fielnames=empid, empname and destination table name is 'sqldest' and field name are empid, empname.
My requirement - I want to fetch only those rows from source based on destination table 'sqldest' and field name is empid. How do I do this?
I am desperatly looking help...
Approach 1 - created two variables - oraquery string, empid string
step1 - ms sql database - created sql task - declare @empid varchar(max)
SELECT @empid=
Stuff((SELECT ',' + empid
FROM
(SELECT DISTINCT convert(varchar(10),empid ) empid FROM emp
) x
For XML PATH ('')),1,1,'')
select @empid = '(' + @empid + ')'
select @empid
resultset=singlerow
resultset=resultname=0; variablename=User::empid (empid is declared as string)
step2 - oracle database - created data flow task
created oledb source
I put this statemnt in oraquery expression - "select * from dept where dept in "
+ @[User::empid] + "
expression=true
[OLE DB Source [1]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E14.
An OLE DB record is available. Source: "Microsoft OLE DB Provider for Oracle" Hresult: 0x80040E14 Description: "ORA-00936: missing expression
If I put this statement in above, then it is working fine.
SELECT top 10 convert(varchar(10),empid ) empid FROM emp
Approach-2
created three variables - oraquery string, empid int, loop object--when I put int then it is automatically setting to 0
step1 - ms sql database - created sql task - SELECT DISTINCT convert(varchar(10),empid ) empid FROM emp
resultset=fullresult
resultset=resultname=0; variablename=User::loop
step2 - created a for each loop container
for loop editor - for each ado ennumerator
enumerator configuration - loop
variablemapping - variable=empid;index=0
step3 - oracle database - created data flow task (outside for each loop. If I put inside it is taking long time)
created oledb source
I put this statemnt in oraquery expression - "select * from dept where dept in "
+ @[User::empid] + "
expression=true
Data inserting in a destination table but empid=0.
Similar Messages
-
Submititng the program to another program using internal table values
Hi All,
How to Submit from one program to another program using internal table values minimum 7 int tables without using the seletion screen
thanks
rajHi All,
Thank you very much for your inputs.
i am facing another issue:
For each 10,000 records it should trigger a job (we are trying to call a program) were the validation will be done only through the other program.
please find the code mentioned below :
TABLES : but000.
DATA: int_bp LIKE but000 OCCURS 0 WITH HEADER LINE.
data released like BTCH0000-CHAR1.
DATA: jobnumber LIKE tbtcjob-jobcount, " Job ID and
jobname LIKE tbtcjob-jobname, " job name.
startdate LIKE tbtcjob-sdlstrtdt, " Start-time
starttime LIKE tbtcjob-sdlstrttm, " window specs.
laststartdate LIKE tbtcjob-laststrtdt,
laststarttime LIKE tbtcjob-laststrttm,
job_released LIKE btch0000-char1. " JOB_CLOSE: Was job released?
DATA : l1 TYPE i,
b_size TYPE i,
b_cursor TYPE cursor.
INITIALIZATION.
b_size = 5000.
START-OF-SELECTION.
OPEN CURSOR WITH HOLD b_cursor
FOR
SELECT *
FROM but000
WHERE bpkind = 'AA'.
IF sy-subrc = 0.
DO.
FETCH NEXT CURSOR b_cursor INTO TABLE int_bp
PACKAGE SIZE b_size.
Note : here in this point we are getting a dump for the second job trigger.
IF sy-subrc = 0.
CLEAR jobname.
CONCATENATE sy-repid sy-datum sy-uzeit INTO jobname.
export int_bp to memory id 'ABC'.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = jobname
IMPORTING
jobcount = jobnumber.
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
authcknam = sy-uname
jobname = jobname
jobcount = jobnumber
report = 'YTEST_RRR'.
variant = lv_variant.
SUBMIT ytest_rrr
VIA JOB jobname NUMBER jobnumber
AND RETURN.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
event_periodic = 'X'
jobcount = jobnumber
jobname = jobname
strtimmed = 'X'
IMPORTING
job_was_released = released
else.
EXIT.
ENDIF.
ENDDO.
calling program :
REPORT YTEST_RRR .
data itab1 like but000 occurs 0 with header line.
data l type i.
import itab1 from memory id 'ABC' .
describe table itab1 lines l.
free memory id 'ABC'.
write:/ 'total records are:', l.
Please give your suggestion why its going for dump in the second iteration.
thanks in advance. -
I updated to ios8 and tried to use Health Application. In Sources I get a message that other applications will show up on the list as they request permission to update your data. How does it happen? No apps are listed on my Sources section
I have an answer to my question. There is a bug in IOS8 that prevents third party applications to talk to the Health Application. Apple is trying to fix it ASAP
-
Someone is using faebook to run java script to get data and email from me in windows 8
someone is using faebook to run java script to get data and email from me in windows 8
Is this a developer question?
Jeff Sanders (MSFT)
@jsandersrocks - Windows Store Developer Solutions
@WSDevSol
Getting Started With Windows Azure Mobile Services development?
Click here
Getting Started With Windows Phone or Store app development?
Click here
My Team Blog: Windows Store & Phone Developer Solutions
My Blog: Http Client Protocol Issues (and other fun stuff I support) -
Use of Table Valued Parameter to restore databases
I'm a noob with table valued parameters. Not sure if I can use TVP for what I need to do. I want to restore/refresh multiple databases from arbitrary number of .BAK files. I can successfully populate a TVP with the needed
source information which includes:
Database name
File/device name (i.e., xxx.BAK file)
Logical data file name
Logical log file name
Now I want to create a stored procedure that contains Restore Database command like this:
RESTORE DATABASE <@database name>
FROM <@path and name of .bak file>
WITH MOVE <@logical data file> TO <new path and file name>,
MOVE <@logical log file name> TO <new path and file name>;
Can I replace those variables with the column values in the TVP? I'm not sure because all the stored proc examples I see simply insert rows from the TVP into rows of an existing table.Yes, but you would need to run a cursor of your TVP:
DECLARE cur CURSOR STATIC LOCAL FOR
SELECT db, path, logical_data_file, new_data_path, logical_log_file,
new_logfile_apth
FROM @TVP
OPEN cur
WHILE 1 = 1
BEGIN
FETCH cur INTO @db, @path, @logical_data_file, @new_data_path,
@new_logical_log_file, @new_logfile_path
IF @@fetch_status <> 0
BREAK
RESTORE DATABASE @db FROM DISK = @path
WITH MOVE @logical_data_file TO @new_data_path,
MOVE @new_logical_log_file, @new_logfile_pth
END
DEALLOCATE cur
Erland Sommarskog, SQL Server MVP, [email protected] -
Using Excel & ODBC data source to get data
I've been using MS Excel to extract MS SQL Server data from our ERP system for years but we are now moving to Oracle 12i. What are my options in the Oracle world? Can it be configured much the same way; that is by configuring an ODBC data source and connecting directly to the database???
Thanks in advance.user11307988 wrote:
I've been using MS Excel to extract MS SQL Server data from our ERP system for years but we are now moving to Oracle 12i. What are my options in the Oracle world? Can it be configured much the same way; that is by configuring an ODBC data source and connecting directly to the database???
Thanks in advance.Adding to sb92075's brief but accurate statement, from one of my recent presentations (note - no need for an ODBC connection):
'Need to add a reference to Microsoft ActiveX Data Objects 2.8 Library before starting
'*** This section might be in the top portion of the user form, worksheet code, or module:
'Declare a connection object in the general section to hold the connection to the database
Dim dbVMFG As ADODB.Connection
'Declare a set of variables to hold the username and password for the database
Dim strUserName As String
Dim strPassword As String
Dim strDatabase As String
Dim i as Integer
Dim intResult As Integer
Dim strSQL as String
Dim lngRow as Long
On Error Resume Next
strDatabase = "MyDB"
strUserName = "MyUser"
strPassword = "MyPassword"
'Connect to the database
'Oracle connection string
Set dbVMFG = New ADODB.Connection
dbVMFG.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=" & strDatabase & ";User ID=" & strUserName & ";Password=" & strPassword & ";ChunkSize=1000;FetchSize=100;"
dbVMFG.ConnectionTimeout = 40
dbVMFG.CursorLocation = adUseClient
dbVMFG.Open
If (dbVMFG.State <> 1) Or (Err <> 0) Then
intResult = MsgBox("Could not connect to the database. Check your user name and password." & vbCrLf & Error(Err), 16, "Excel Demo")
Else
strSQL = "SELECT" & VBCrLf
strSQL = strSQL & " ID AS RESOURCE_ID," & VBCrLf
strSQL = strSQL & " DESCRIPTION" & VBCrLf
strSQL = strSQL & "FROM" & VBCrLf
strSQL = strSQL & " MY_TABLE" & VBCrLf
strSQL = strSQL & "WHERE" & VBCrLf
strSQL = strSQL & " DESCRIPTION LIKE '%10%'" & VBCrLf
strSQL = strSQL & "ORDER BY" & VBCrLf
strSQL = strSQL & " ID"
'Add a new worksheet to the new workbook, add after the last sheet
ActiveWorkbook.Sheets.Add
ActiveWorkbook.ActiveSheet.Name = "JustATest"
snpData.Open strSQL, dbVMFG
If snpData.State = 1 Then
'Slow Method------------------------------------
lngRow = 0
'Header Row
For i = 0 To snpData.Fields.Count – 1
lngRow = lngRow + 1
ActiveSheet.Cells(lngRow, i + 1).Value = snpData.Fields(i).Name
ActiveSheet.Cells(lngRow, i + 1).Font.Bold = True
Next i
'Detail Rows
Do While Not snpData.EOF
lngRow = lngRow + 1
For i = 0 To snpData.Fields.Count - 1
ActiveSheet.Cells(lngRow, i + 1).Value = snpData.Fields(i)
Next i
snpData.MoveNext
Loop
'End Slow Method------------------------------------
'Fast Method----------------------------------------
'Do not use this and the slow method!
For i = 0 To snpData.Fields.Count - 1
ActiveSheet.Cells(1, i + 1).Value = snpData.Fields(i).Name
Next i
ActiveSheet.Range(ActiveSheet.Cells(1, 1), ActiveSheet.Cells(1, snpData.Fields.Count)).Font.Bold = True
ActiveSheet.Range("A2").CopyFromRecordset snpData
'Auto-fit up to 26 columns
ActiveSheet.Columns("A:" & Chr(64 + snpData.Fields.Count)).AutoFit
'End Fast Method----------------------------------------
snpData.Close
End If
End IfA couple of notes:
1. Do not repeatedly connect to the database, execute a SQL statement, and disconnect from the database - connect once and stay connected.
2. Use bind variables where possible in SQL statements for constants (literals) which might change from one execution to the next - let me know if you need s code example showing bind variable usage in Excel.
Charles Hooper
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc. -
Validation by using Database Table Values
Dear Experts,
Please suggest us how can we validate the user input values with our database table values in ADF.
thanks in advance
Shiv NareshTake a look at Edwin Biemonds blogpost.
Using database tables as authentication provider in WebLogic
http://biemond.blogspot.de/2008/12/using-database-tables-as-authentication.html -
Using View Tables in SQ01 and SQ02, getting 'Not Authorized to Read Table'
We are trying to use a SAP Standard View Table (CAUFV) in an SQ01 and SQ02 transaction. Even though there is no Authorization Group assigned to the View we still get "You have no authorization to read table caufv' when running the linked transaction. We tried assigning the CA and KA authorization groups to the role and got the same results. (The tables used to create the View are AFKO and AUKF and thier Authorization groups are CA and KA.) We tried other views and received the same results. Does anyone have any experience with this?
Hello Chuck,
There are 2 ways to restrict this
1: The user should be a part of at least one user group to run the corresponding ABAP query. This automatically restricts the access of the user to specific functional areas, and thus the corresponding underlying logical databases.
2: The authorization object S_QUERY should be used to give proper authorizations to the user for a query. This authorization object has a field named ACTVT, which can take values 02 for Change, 23 for Maintain and 67 for Translate.
This value determines whether the user can create and modify the query. The possible authorizations in the object are as follows:
S_QUERY_ALL Change, maintain and translate query
S_QUERY_UPD Change and Translate -
How to use a table- valued function as a datasource for SSRS report?
CREATE FUNCTION [dbo].[GetNetSheetRegionNetPerCapitaRow](@WeekBeginDate smalldatetime)
RETURNS @RegionNetPerCapitaRow TABLE
(WTD1 DECIMAL(18,6),PYWTD1 decimal(18,6),percentDiff1 float,diff1 float,WTD2 decimal(18,6),YTD2 decimal(18,6),percentDiff2 float,Diff2 float,YTD3 decimal(18,6),PYTD3 decimal(18,6),percentDiff3 float,Diff3 float)
how to use the above function as a data source for SSRS report instead of a stored procedure ?Hi,
In the Dataset - > Query Type - > Text - >
SELECT * FROM [dbo].[GetNetSheetRegionNetPerCapitaRow](@WeekBeginDate)
sathya - www.allaboutmssql.com ** Mark as answered if my post solved your problem and Vote as helpful if my post was useful **. -
How to use nested table values in IN expression?
Hi!
Can someone please give me a hint to the correct syntax for this:
declare
TYPE numtable is table of number;
tt numtable;
begin
select myId bulk collect into tt from some_table;
update some_other_table set name = 'kakadu' where xId in (select * from tt); -- this line is wrong as it is
end;What I am doing is fixing a stored procedure that was like this before:
update table_a set name = 'kakadu' where column_X in (select one.A from table_1 one join table_a on x y z WHERE a b c);
update table_b set name = 'nimfa' where column_Y in (select one.B from table_1 one join table_a on x y z WHERE a b c);The problem is, the first UPDATE changes the result of the SELECT, so I want to "remember" it.
A and B are columns in table_1, A is the primary key. So the fixed code would be like:
-- store the list of selected IDs from table_1
select A bulk collect into tt from table_1 one join table_a on x y z WHERE a b c ; -- same conditions as in old code
-- do the updates
update table_a set name = 'kakadu' where column_X in (select * from tt);
update table_b set name = 'nimfa' where column_Y in (select one.B from table_1 one where one.A in tt);(it can be a varray instead of nested table, as far as I am concerned)
Thanks,
DavidYes, it needs to be a SQL type
Re: How to pass an array to a function from a SELECT statement
Or you can use a built in SQL type (version dependent)
Re: Collection in where not working -
Transaction KSB1(cost line items) - Tables or FM's to get data?
Hi,
For a current report, I need to obtain the data stored in transaction KSB1 - Actual Cost Line items for cost centers.
What tables contain this data? Are there any standard function modules available to obtain the data?
Please help.
Thanks,
JohnThe following content from SAP help file may help you.
Use
You can use Report Painter reports and line item reports from the Cost Center Accounting (CO-OM-CCA) and Internal Orders components (CO-OM-OPA) to evaluate archives. Generally, the following reports can read the relevant data from any archive:
· All Report Painter reports for table CCSS
· The actual line item report for internal orders
· The actual line item report for cost centers
· Document display
The SAP system includes a variety of report and archiving object .combinations. The standard system thus provides only a limited number of reports for given archiving objects. However, it is also possible to execute other reports for an archiving object.
Actions
Reading Report Painter Reports from the Archive via the Component
1. To execute a Report Painter report, choose Information system ®Report selection in the given component and select the desired report.
2. On the report selection screen, choose Data source.
3. On the following dialog box, select Read from archive and choose Continue.
4. On the following dialog box, enter the object from which you want to read the archived data.
Choose F4 Help to obtain a list of the archiving objects to which the report applies.
5. Choose Archive selection to determine the archive files for the report.
6. As in the standard transaction, you can start the report online or in a background job.
Reading Line Item Reports and Documents from the Archive via the Component
1. To execute a line item report or document display, choose Information system ® Report selection in the given component and select the desired line item report or document display.
2. On the report selection screen, choose Extras ® Data source.
3. On the following dialog box, select Archive as the data source.
4. On the following dialog box, enter the object from which you want to read the archived data.
Choose F4 Help to obtain a list of the archiving objects to which the report applies.
5. Choose Archive selection to determine the archive files for the report.
6. As in the standard transaction, you can start the report online or in a background job.
As it is often unnecessary to enter further selection criteria when reading data from an archive, you can enter an asterisk (*) under Cost center and Order where required.
Reading Reports from Archive Administration from the Archive (SARA Transaction)
1. Under Object name, enter the archiving object (such as CO_COSTCTR) and choose Evaluate.
Choose F4 Help for the Read program field to list all the reports for the archiving object.
2. Choose and execute the required report.
3. Branch from the selection screen to the data source selection:
a) For Report Painter reports, choose Data source.
b) For line item reports or for document display, choose Extras ®Data source.
4. The archiving object is already defaulted. Choose Archive selection to determine the archive files for the report.
5. As in the standard transaction, you can start the report online or in a background job.
Assigning Reports to Archiving Objects
The SAP system stores the report assignments to the archiving objects. The assignment controls which objects appear in the F4 Help for the data sources and which reports appear for the read programs in archive administration.
A warning message appears if you choose an archiving object that is not assigned the relevant report or a report that is not assigned the relevant archiving object. You can ignore this warning message. You can execute the report if you wish, but you must bear in mind that incomplete data will be the result.
To view the assignments in the standard SAP system, see the ARCH_REPOW table.
Importing Standard Assignments
The ARCH_REPOW table is a Customizing table that also allows user-defined assignments. Standard assignments are provided therefore in client 000 only. You cannot use reports in other clients for reading data from the archive.
1. To import standard assignments to other clients, go to the SAP initial screen, choose Tools ® ABAP Workbench ®ABAP Editor, and enter and execute program ARCH_REPOW_IMPORT.
2. Enter CO_* as the archiving object.
3. Accept the default settings in the other fields (source client 000, report type RW).
4. Choose Execute.
Creating Custom Assignments
In principle, you can read data from given archiving objects even if the standard SAP system does not have the relevant combination of report and archiving object.
· For Report Painter reports, the prerequisites are:
- The report applies to table CCSS
- The archiving object includes table COSP or COSS
Tables COSP and COSS may also appear in the archiving object definitions as COSPA and COSSA.
Of course, you may also use custom reports to read archiving object data.
· For line item reports, table COEP must be part of the archiving object. Table COEP may also appear in the archiving object definition as view COVP or COVPxy (where u201Cxu201D and u201Cyu201D stand for numerals).
If you want to work with previously unsupported assignments, enter these in table ARCH_REPOW in order to avoid confusion among end-users. In addition, you can include documentation justifying the use of the corresponding report for your own archive reading runs.
To enter a new assignment:
1. Start system transaction SM30.
2. Enter table ARCH_REPOW.
3. ChooseMaintain.
4. Choose New entries to enter the new assignments.
Make the following entries:
a) Under Object name, enter the name of the archiving object.
b) Under Report type, enter:
RW for Report Painter reports
TR for line item reports
c) Under Program name, enter:
The name of the report group for Report Painter reports
KSB1 for the actual line item report for cost centers
KOB1 for the actual line item report for internal orders
KSB5 for document display
d) Leave the Activate archive selection field empty.
Standard Contents of Table ARCH_REPOW
Report
Program Name
Report Type
Object Name
Cost Center Actual Line Items
KSB1
TR
CO_ALLO_ST
CO Documents, Actual Costs
KSB5
TR
CO_ALLO_ST
Cost Center Actual Line Items
KSB1
TR
CO_CCTR_EP
CO Documents, Actual Costs
KSB5
TR
CO_CCTR_EP
Area: Cost elements
1AIP
RW
CO_CCTR_ID
Area: Statistical key figures
1SKL
RW
CO_CCTR_ID
Cost centers: Drilldown by Partner
1SHK
RW
CO_CCTR_ID
Cost centers: Actual/plan variance
1SIP
RW
CO_CCTR_ID
Area: Cost Centers
1KSL
RW
CO_CCTR_ID
Area: Activity types
1SLB
RW
CO_CCTR_ID
Cost Centers: Period Breakdown Actual/Plan
1SMA
RW
CO_CCTR_ID
Cost Center Actual Line Items
KSB1
TR
CO_CCTR_ID
CO Documents, Actual Costs
KSB5
TR
CO_CCTR_ID
Area: Cost elements
1AIP
RW
CO_CCTR_PL
Area: Statistical key figures
1KSL
RW
CO_CCTR_PL
Cost centers: Drilldown by Partner
1SHK
RW
CO_CCTR_PL
Cost centers: Actual/plan variance
1SIP
RW
CO_CCTR_PL
Area: Cost Centers
1SKL
RW
CO_CCTR_PL
Area: Activity types
1SLB
RW
CO_CCTR_PL
Cost Centers: Period Breakdown Actual/Plan
1SMA
RW
CO_CCTR_PL
Area: Cost elements
1AIP
RW
CO_COSTCTR
Area: Statistical key figures
1KSL
RW
CO_COSTCTR
Cost centers: Drilldown by Partner
1SHK
RW
CO_COSTCTR
Cost centers: Actual/plan variance
1SIP
RW
CO_COSTCTR
Area: Cost Centers
1SKL
RW
CO_COSTCTR
Area: Activity types
1SLB
RW
CO_COSTCTR
Cost Centers: Period Breakdown Actual/Plan
1SMA
RW
CO_COSTCTR
Cost Center Actual Line Items
KSB1
TR
CO_COSTCTR
CO Documents, Actual Costs
KSB5
TR
CO_COSTCTR
Order Actual Line Items
KOB1
TR
CO_ITEM
Cost Center Actual Line Items
KSB1
TR
CO_ITEM
CO Documents, Actual Costs
KSB5
TR
CO_ITEM
CO Documents, Actual Costs
KSB5
TR
CO_KSTRG
List: Orders
6L00
RW
CO_ORDER
List: Cost elements
6M00
RW
CO_ORDER
Order: Actual/plan variance
6O00
RW
CO_ORDER
Order: Drilldown by Partner
6O08
RW
CO_ORDER
Order: Drilldown by Period
6Z02
RW
CO_ORDER
Order Actual Line Items
KOB1
TR
CO_ORDER
CO Documents, Actual Costs
KSB5
TR
CO_ORDER -
Hi, i'm new in lab view. i'm using 3'rd party daq card to get data using labview
i'm still green in this field. can anybody help me on how to get various data from daq card(not an ni brand) using my labview programming. i use labview 6 and i don't know how to get the data so i can display it in my programming. i used Pcl 1800 and pcl 836 card of advantech brand.
Greetings,
Below is a link to a KnowledgeBase, which discusses your options:
http://pong.ni.com/public.nsf/websearch/F3009806E2AE416E8525645D0076B962?OpenDocument
It appears that Advantech has a LabVIEW driver available. Below is a link to information about the driver on their Web Site. I would suggest trying this option, as opposed to using the Call Library Function with Advantech's driver DLLs:
http://www.advantech.com/content/0000000175/0000000175.asp?css=corp&name=corp
Good luck with your application.
Spencer S. -
How to use Table valued MSSQL function in OBIEE
Hi all,
Can some one help me to understand how to use table valued function in OBIEE? I want to use a table valued function (MSSQL function, with some input parameter), in the physical layer to pull the data?
I know for MSSQL Stored Procedure we can write as
EXEC SP_NAME @Parameter = 'VLUEOF(NQ_SESSION.Variablename)'
but now I have a table valued function in the query window I can get the data as
select * from myfunction(parametervalue)
In physical layer of OBIEE I have tried as
select * from myfunction('VLUEOF(NQ_SESSION.Variablename)'), but I'm getting error as the NQ_SESSION variable doesn't have a value , but actually I have initialized the variable but still Im getting error.
Can some one help me to solve this.
Thanks,
MithunFollow this link and try yourself. let me know for issues
Substring instr issue in obiee
Appreciate if you mark
Edited by: Srini VEERAVALLI on Feb 20, 2013 8:13 AM -
How do I convert the ASCII character % ,which is 25h, to a hex number 25h. I've tried using the scan value VI but I get a zero in the value field.
You can use String to Byte Array for this.
-
Problem with passing table values to RFC
Hi all,
I am passing values in table in RFC. There are no import/export parameters in RFC. We are passing only tables.
There are two tables in the RFC I_Dept and I_Subdept. Initially RFC is executed for getting the Dept which works fine as for this there is no need to set in input table value. But to get sub department I need to set the dept in I_Dept and after executing RFC I should get values in table I_Subdept. The code is as below:
wdContext.nodeOutput_I_Dept().invalidate();
wdContext.nodeOutput_I_Subdept().invalidate();
Z_Bapi_Dept_Values_Input d_Input = new Z_Bapi_Dept_Values_Input();
wdContext.nodeZ_Bapi_Dept_Values_Input().bind(d_Input);
Zdept dept = new Zdept();
dept.setZname("Sales");
d_Input.addI_Dept(dept);
try
wdContext.nodeZ_Bapi_Dept_Values_Input().currentZ_Bapi_Dept_Values_InputElement().modelObject().execute();
wdContext.nodeZ_Bapi_Dept_Values_Input().nodeOutput().invalidate();
catch (WDDynamicRFCExecuteException e)
msgManager.reportException(e.toString(), true);
Is anything wrong in this code because even after executing the RFC the size of node I_Subdept() is zero. But the RFC works fine in the backend.
Regards,
JaydeepA typical misunderstanding when populating structured input data
via code is the following:
- You have bound a WD context node hierarchy to the model say
N1 > M1
->N2 > ->M2
where N1, N2 are WD Context nodes (N2 is child of N1) and M1, M2 are
model classes bound to the context nodes. Important: M1 has a relation
to M2 on the model side, means there is some method M1.setMyM2(M2)
(assuming the target role of the relation is called "MyM2").
- You create context elements for N1 and N2 which are bound to a model
class instances of M1 and M2 respectively.
Assuming that M1 is the "executable" model class (*_Input) and M2
represents an input structure needed, the M2-input will - using the
above approach - not be available on execution. Why? The relation on the
model side (MyM2) is not available if just maintaining it via the
context, i.e. context and model are not "in sync". As RFC execution is
done via the model the M2 input will not be available.
You best create complex/nested input structures on the model
side and then bind the top-level model object to the resp context node.
In the above sample this would be:
M1 m1ModelObject = new M1();
M2 m2ModelObject = new M2();
m1ModelObject.setMyM2(m2ModelObject);
Hope it helps!
Regards,
Sangeeta
Maybe you are looking for
-
Problems with DVR, STB`s
I had FIOS put in less than a week ago. The multi-room DVR recordings don`t show up on my STB`s. I have tried resetting them all at least 3 times. I tried resetting them through the internet, but it keeps saying login failed. In Home Agent freezes up
-
Okay since last apple software update my safari will not open youtube,yahoo or google
Okay since last apple software update my safari will not open youtube,yahoo or google, an error message comes up saying safari cannot connect to the server. Can anyone help me with this please?
-
Can no longer access wifi with ipod touch
since the most recent upgrade to my ipod touch (4th gen - 8G) i can no longer access any wifi. how do I re-establish those connections?
-
What are the best disc doctor tools
Okay, my G5 is running like a Commodore 64! It is SLOW and freezing all the time! it freezes on iPhoto, Mail, ..... just about anything actually to the point where it won't force quit and we are having to hold down the old international reset button.
-
I have AE cs4 and am needing to export to windows media player. When I choose that option in AE I get a crash error <5188> <ae.blitpipe> <2> rect t:39.000000 l:15.000000 w:1213.000000 h:768.000000 I have the final video as an avi and tried to use AM