Pass tables values
Hi...
I am trying to call an external function in R/3 via WebDynpro. The function uses a table with associated type W3Query. I execute the function in R/3 by adding name/value pairs to the table.
In WebDynpro, I am setting the same values in table.
When I execute the function, an exception is thrown by the program that indicates that the parameters aren't present.
However, the parameter data is being displayed from the context on my output screen. Any suggestions on how to pass the parameters would be appreciated.....
In the init method, I am binding the input and output:
Www_Get_Report_Input wgri = new Www_Get_Report_Input();
Www_Get_Report_Output wgro = new Www_Get_Report_Output();
wdContext.nodeWWW_GET_REPORT().bind(wgri);
wdContext.nodeOutput().bind(wgro);
In the implementation for testing, I am binding the Query String table:
Vector v = new Vector();
W3Query w3q1 = new W3Query(wdContext.currentWWW_GET_REPORTElement().modelObject().modelInstanceId());
w3q1.setName("_REPORT");
w3q1.setValue("ZM1BOMX2");
v.add(w3q1);
wdContext.nodeQuery_String().bind(v);
W3Query wqnew = new W3Query(wdContext.currentWWW_GET_REPORTElement().modelObject().modelInstanceId());
try {
wdContext.currentWWW_GET_REPORTElement().modelObject().execute();
hello Stephen
instead of creating a Vector object you create the objects of ur internal table that you want to pass ( here i think its "W3Query" )
ie W3Query obj = new W3Query();
obj.setName("_REPORT");
obj.setValue("ZM1BOMX2");
wgri.addW3Query(obj); // wgri is ur "Www_Get_Report_Input" object.
repeate this in a loop for "n" no. of records. hope this will help u. no need of creating " Www_Get_Report_Output" object.
regards,
Piyush
Similar Messages
-
Passing table values from one webdypro screen to the next in BPM flow
Hi,
I have a BPM scenario where in User 1 will be entering data on a java webdynpro view in the form of a table. The user 1 should be able to edit contents of the table.
These set of values in the table from User 1 needs to be passed to User 2 through BPM. The User 2 should be able to read the values edited by User 1 in the table.
Please could you suggest how we could map the table attribute?
With respect to Context Elements, I have a Node created for the table. But, the data doesnot seem to pass from User 1 to User 2.
Any suggestions on this would be extemely helpful.
Thank You.Hi,
Please follow the below mentioned steps:
Create a Human Activity containing the task(WebDynpro Task) to edit the table values.
Create a data context of type (Context of the table node used in the Webdynpro task).
Map the output of the human activity to the input of the data context.
Create another human activity that contains the task to read the values of task1
Assign this task to User 2
Map the output of data context with the input of the second human activity.
Regards,
Gayathri -
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 -
how can i pass tables to RFC as input?
Thanks.Thanks for the replies.
I have actually written the below code, but not getting the output.
Model1 mod=new Model1();
zbapi_Input ip=new Zbapi_Input(mod);
ztable tab1;
tab1=new Ztable(mod);
tab1.setcode("2100");
input.addZtable(tab1);
wdContext.nodezbapi_Input ().bind(ip);
try {
wdContext.currentzbapi_Input Element().modelObject().execute();
} catch (ARFC2ModelExecuteException e) {
// TODO Auto-generated catch block
e.printStackTrace(); -
How to pass table values in Create Bapi Wrapper
Hi All,
Am using create BAPI Wrapper in that how to map the fields inside BAPI Import Structure .
Thanks&Regrads,
ArunHi,
Am using standard RFC " QIBP_INSPCHAR_SETRESULT " for creating result recording in SAP QM. And BAPI_INSPOPER_GETDETAIL for getdetail i want to create BAPI wrapper for these 2 i already created BAPI wrapper for get detail . I dont know how to create Create BAPI wrapper.
In QIBP_INSPCHAR_SETRESULT am passing inupt
INSPLOT LIKE QALS-PRUEFLOS
INSPOPER LIKE QAPO-VORNR
INSPCHAR LIKE QAMV-MERKNR
INSPSAMPLE LIKE QASV-PROBENR
CHAR_RESULT LIKE BAPI2045D2
so i want to know how i can pass 1 . CHAR_RESULT structrue values
2. INSPLOT,INSPOPER,INSPCHAR again repting inside CHAR_RESULT so how to map these
in SDOE_WB
Pls explain how to create BAPI Wrapper for this and how to map details. -
How to pass the values from internal table to field groups
hi all,
how can i pass the internal table values to field groups?
already field groups are holding some values.. INSERT STATEMENT IS NOT WORKING as it is ovewriting the existing values..
Use full answers will be rewared.
Thanks.
Moderator message - duplicate post locked
Edited by: Rob Burbank on Jun 23, 2009 9:51 AMHi,
You can use INSERT statement to put a work area of an Internal table in Field-group
and use Extract to get info out of it.
Hope it helps,
Raj -
How can i pass calculated value to internal table
Hi
i have to pass calculated value into internal table
below field are coming from database view and i' m passing view data into iznew1
fields of iznew1
LIFNR LIKE EKKO-LIFNR,
EBELN LIKE EKKO-EBELN,
VGABE LIKE EKBE-VGABE,
EBELP LIKE EKBE-EBELP,
BELNR LIKE EKBE-BELNR,
MATNR LIKE EKPO-MATNR,
TXZ01 LIKE EKPO-TXZ01,
PS_PSP_PNR LIKE EKKN-PS_PSP_PNR,
KOSTL LIKE EKKN-KOSTL,
NAME1 LIKE LFA1-NAME1,
NAME2 LIKE LFA1-NAME2,
WERKS LIKE EKPO-WERKS,
NETWR LIKE EKPO-NETWR,
KNUMV LIKE EKKO-KNUMV,
GJAHR LIKE EKBE-GJAHR,
and now i want to pass
one field ED1 which i has calculated separatly and i want to pass this value into iznew1
but error is coming that iznew1 is a table with out header line has no component like ED1.
so how can i pass calculated value to internal table iznew1,When you declare your internal table , make an addtion occurs 0
eg . data : begin of iznew occurs 0 ,
fields ...
add the field here ed1.
end of iznew.
now when you are calculating the value of ed1,
you can pass the corresponding value of ed1 and modify table iznew.
eg
loop at iznew.
iznew-ed1 = ed1.
modify iznew.
endloop. -
SSRS How to pass subtotal value in matrix into another table just for display?
Hi all,
I have two matrix with subtotal for two grouping. I need to pass the value of this two group subtotal into another matrix table to display and perform simple calculation to get the differences.
How can I pass the subtotal amount into the other matrix?
In Crystal report I can define two variable where i can set the total to the value and call the two variable anywhere in the same report. But how can I do it in SSRS?
Appreciate can help
Thank youYes, basically both are same grouping, i just want to capture the subtotal for comparision with scenario 2.
I can do it in SQL, but if possible, I hope to do it in report. Thank you
Simulation as below
Matrix for scenario 1
Group 1
Detail
Detail
Subtotal Group 1
9999
group 2
Detail
Detail
SubTotal Group 2
8888
Matrix for scenario 2
Group 1
Scenario2
Scenario 1
Differences
Detail
Detail
Subtotal Group 1
2000
9999
2000-9999
group 2
Detail
Detail
SubTotal Group 2
3000
8888
3000-8888 -
Passing Dynamic Internal Table values to another program
Hi,
I have a program ZSAPNEW.
In this I have created a Dynamic internal table <fs_emp>. The number of fields differ for each run. The values are passed into <fs_emp> in this program. Now I need to submit thsi program from a main program ZHEAD and then display the values got from ZHEAD. For this I need to access the values retrieved from ZSAPNEW in <fs_emp> in ZHEAD. I cant figure out how to do this. I tried IMPORT ing the reference of teh field symbol too/ But its not allowing references in IMPORT/EXPORT. And since the table is of type ANY( as structure varies) I cant assign it to an internal table and then pass. Can some one suggest a solution please.
SuzieHi
You need to know how the strcture of your table is generated In both programm:
- Calling program:
DATA: LR_VALUE_DESCR TYPE REF TO CL_ABAP_ELEMDESCR,
COMPONENT TYPE CL_ABAP_STRUCTDESCR=>COMPONENT,
LT_COMPONENTS TYPE CL_ABAP_STRUCTDESCR=>COMPONENT_TABLE.
DATA: LT_STRUC TYPE REF TO CL_ABAP_STRUCTDESCR,
LT_TAB TYPE REF TO CL_ABAP_TABLEDESCR.
DATA: L_INDEX TYPE C.
DATA: W_LINE TYPE REF TO DATA,
INT_TABLE TYPE REF TO DATA.
FIELD-SYMBOLS: <WA> TYPE ANY,
<ITAB> TYPE TABLE,
<VALUE> TYPE ANY.
DO 4 TIMES.
CLEAR COMPONENT.
MOVE SY-INDEX TO L_INDEX.
CONCATENATE 'FIELD' L_INDEX INTO COMPONENT-NAME.
MOVE CL_ABAP_ELEMDESCR=>GET_C( P_LENGTH = 4 ) TO LR_VALUE_DESCR.
COMPONENT-TYPE = LR_VALUE_DESCR.
INSERT COMPONENT INTO TABLE LT_COMPONENTS.
ENDDO.
* Workarea
LT_STRUC = CL_ABAP_STRUCTDESCR=>CREATE( P_COMPONENTS = LT_COMPONENTS
P_STRICT = 'X' ).
CREATE DATA W_LINE TYPE HANDLE LT_STRUC.
ASSIGN W_LINE->* TO <WA>.
* Table
LT_TAB = CL_ABAP_TABLEDESCR=>CREATE( P_LINE_TYPE = LT_STRUC ).
CREATE DATA INT_TABLE TYPE HANDLE LT_TAB.
ASSIGN INT_TABLE->* TO <ITAB>.
DO 3 TIMES.
CLEAR <WA>.
DO 4 TIMES.
MOVE SY-INDEX TO L_INDEX.
CONCATENATE 'FIELD' L_INDEX INTO COMPONENT-NAME.
ASSIGN COMPONENT COMPONENT-NAME OF STRUCTURE <WA> TO <VALUE>.
MOVE SY-INDEX TO <VALUE>.
ENDDO.
APPEND <WA> TO <ITAB>.
ENDDO.
DATA: WA_INDX TYPE INDX.
WA_INDX-USERA = SY-UNAME.
WA_INDX-PGMID = 'MAXMAX'.
EXPORT TAB = <ITAB>
TO DATABASE INDX(XY)
FROM WA_INDX
CLIENT SY-MANDT
ID 'TABLE'.
Called program:
DATA: LR_VALUE_DESCR TYPE REF TO CL_ABAP_ELEMDESCR,
COMPONENT TYPE CL_ABAP_STRUCTDESCR=>COMPONENT,
LT_COMPONENTS TYPE CL_ABAP_STRUCTDESCR=>COMPONENT_TABLE.
DATA: LT_STRUC TYPE REF TO CL_ABAP_STRUCTDESCR,
LT_TAB TYPE REF TO CL_ABAP_TABLEDESCR.
DATA: L_INDEX TYPE C.
DATA: W_LINE TYPE REF TO DATA,
INT_TABLE TYPE REF TO DATA.
FIELD-SYMBOLS: <WA> TYPE ANY,
<ITAB> TYPE TABLE,
<VALUE> TYPE ANY.
DO 4 TIMES.
CLEAR COMPONENT.
MOVE SY-INDEX TO L_INDEX.
CONCATENATE 'FIELD' L_INDEX INTO COMPONENT-NAME.
MOVE CL_ABAP_ELEMDESCR=>GET_C( P_LENGTH = 4 ) TO LR_VALUE_DESCR.
COMPONENT-TYPE = LR_VALUE_DESCR.
INSERT COMPONENT INTO TABLE LT_COMPONENTS.
ENDDO.
* Workarea
LT_STRUC = CL_ABAP_STRUCTDESCR=>CREATE( P_COMPONENTS = LT_COMPONENTS
P_STRICT = 'X' ).
CREATE DATA W_LINE TYPE HANDLE LT_STRUC.
ASSIGN W_LINE->* TO <WA>.
* Table
LT_TAB = CL_ABAP_TABLEDESCR=>CREATE( P_LINE_TYPE = LT_STRUC ).
CREATE DATA INT_TABLE TYPE HANDLE LT_TAB.
ASSIGN INT_TABLE->* TO <ITAB>.
DATA: WA_INDX TYPE INDX.
WA_INDX-USERA = SY-UNAME.
WA_INDX-PGMID = 'MAXMAX'.
IMPORT TAB = <ITAB>
FROM DATABASE INDX(XY)
TO WA_INDX
CLIENT SY-MANDT
ID 'TABLE'.
LOOP AT <ITAB> ASSIGNING <WA>.
WRITE: / <WA>.
ENDLOOP.
The sample above use IMPORT/EXPORT from database: if the called program can't know the structure of the dynaic table, you need to transfer it by the same way you transfer the data
Max -
Passing a value from internal table to a powerpoint slide
Hi,
Does anyone know how to pass a value from internal table to a powerpoint slide? I would also need some codes with regards to the coding to open the powerpoint and insert the value in.
Thanks.
Points will be awarded.
Hope to hear from you soon.
Lawrencegeez!! do feel sorry for you
you can fire FM WS_EXECUTE to open power point but passing a variable at run-time i'm not sure, sorry. -
Hi All,
I have written BDC, in which when i pass value for second screen "Description type field" it's passing '*************************' instead of internal table value.
It's picking correct value for first internal table value. Could anyone please give an idea why it's happening?
Please find the code:
LOOP AT it_record.
header data for BDC
AT NEW CLASS.
IF sy-tabix <> 1.
perform bdc_dynpro using 'SAPLCLMO' '7777'.
perform bdc_field using 'BDC_OKCODE'
'=SAVE'.
CALL TRANSACTION 'CLWM' USING bdcdata
MODE p_mode
UPDATE 'S'
MESSAGES INTO messtab.
clear : bdcdata[],bdcdata.
ENDIF.
perform bdc_dynpro using 'SAPLCLMO' '0200'.
perform bdc_field using 'BDC_CURSOR'
'RMCLM-CLASS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMCLM-CLASS'
it_record-class.
perform bdc_dynpro using 'SAPLCLMO' '7777'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RMCLM-KLBEZ'.
perform bdc_field using 'RMCLM-KLBEZ'
it_record-klbez.
perform bdc_field using 'RMCLM-STATU'
'1'.
perform bdc_dynpro using 'SAPLCLMO' '7777'.
perform bdc_field using 'BDC_OKCODE'
'=MERK'.
perform bdc_field using 'BDC_CURSOR'
'RMCLM-KLBEZ'.
perform bdc_field using 'RMCLM-KLBEZ'
it_record-klbez.
perform bdc_field using 'RMCLM-STATU'
'1'.
MOVE 1 TO IDX.
ENDAT.
line item data for BDC
perform bdc_dynpro using 'SAPLCLMO' '7777'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RMCLM-RELEV(02)'.
CONCATENATE 'RMCLM-MERKMA(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
it_record-merkma.
CONCATENATE 'RMCLM-RELEV(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
it_record-relev.
IDX = IDX + 1.
ENDLOOP.
Thanks,
UjjwalHi Ujjwal
The reason behind this is that you are using AT NEW.... ENDAT block in your coding.
When you use AT NEW field statements, the fields in the work area after the field get converted into ********.
Check values in your work area I_RECORD in debugging inside AT NEW statement and you will understand what I am saying.
In your case all the fields from header line of I_RECORDS which come after field CLASS are getting converted into *******,
hence the error.
Try using a temporary work area, say w_record. Pass value of I_record to w_record before AT NEW statement.
And use w_record-fields instead of I_record-fields. And your program should work. -
Need Help in Field Symbol for Dynamically passing table field value
Hi All,
In my internal table I am having data.
I am dynamically forming table field name and substitute for the another table field name to pass DATA.
but I am getting the Variable name insted of Value ie Data.
I am using Field Symbol for this.
data:
Field-symbols <TS> type any.
field1 type string.
LOOP AT TABLEFIELDS INTO WA_TABLEFIELDS.
READ TABLE TEST WITH KEY NAME = WA_TABLEFIELDS-FIELDNAME.
IF SY-SUBRC = 0.
CONCATENATE 'WA_' WA_TABLEFIELDS-TABNAME '-' WA_TABLEFIELDS-FIELDNAME INTO Field1.
Assign Field1 to <TS>.
ALL_VAL-VALUE = <TS>
"After substituting the <TS> into ALL_VAL-VALUE field I need a DATA to be passed but the variable name is appending"*
APPEND ALL_VAL.
ENDIF.
ENDLOOP.
kindly how to pass the value into the table.
Thanks in advance.
SanHi,
pls assign a break point in
CONCATENATE 'WA_' WA_TABLEFIELDS-TABNAME '-' WA_TABLEFIELDS-FIELDNAME INTO Field1.
Assign Field1 to <TS>.
ALL_VAL-VALUE = <TS>
" Put a break point here and check for the value in <TS>.
if <TS> contains value then create a work area for ALL_VAL AND PASS the Field-Symbol to that and then append thw wa into the table...
Hope this works out!!
thanks -
Is it possible to pass table type values as input parameter for con prg?
Hi All,
Could you please confirm that is it possible to pass table type value as input to concurrent program?
If possible how to achive this?
If not possible whether we have any ora doc which is confirming this.
Any hel will be great.
Thanks,Hi student;
Please check (http://apps2fusion.com/at/45-as/241-enablingdisabling-concurrent-program-parameters)
Hope it helps
Regard
Helios -
In FM tables And Changing r bu default Pass by value or ref
hi friends ,
In Function Module Tables And Changing are by default Pass by value or reference.
with regards.hi all,
i got the answer from abap in 21 days (page No 591),
changing parameters are passed by value and result.
internal tables are pass by reference. -
Whats the difference betweeen passing the table variable and table valued parameter?
Hi Everbody
Can someone one tell me what's the difference between passing a table variable and table valued parameter to a stored procedure or function? Can both be used to pass a table to a stored procedure/function?
Regards
RegardsThey are essentially the same. What we call a table variable is a local
variable. A table-valued parameter is an incoming parameter to the
procedure. The only difference is that the parameter is readonly.
When you call a stored procedure, you can pass a table variable as the
actual parameter. Or a table-valued parameter that you pass on.
CREATE PROCEDURE nisse_sp @tvp sometype READONLY AS
DECLARE @local someothertabletype
EXEC pelle_sp @tvp, @local
Erland Sommarskog, SQL Server MVP, [email protected]
Maybe you are looking for
-
Can Wireless bridge be a transport bridge for another WLAN?
Can I setup a bridge as a transport bridge between two bridges as following? LAN1---B1---B2---B3---LAN2 ______________\B4---LAN3 How should I setup for root and non-root in this case? Can I do aggregation if I have 2 bridges in location 1 and 2 for r
-
Where can u find the open po for a particular time period I am assuming this you can get open PO from EKPO and deduct any qty received against PO using table EKBE entry with PO history category E(GR) But how do i take care that open PO is not delete
-
Generate report dynamically based on parameters
I have a Report with 30-35 items and these items are divided into sets of RMA, WIP,Inventory, finance .... now i need to display the report dynamically based on parameters say, for example if RMA, WIP, Inventory, finance are YES,NO,YES, NO then the r
-
Second level navigation menu not highlighted
Hello Experts, We have a par file which is redirecting to a third party website from portal using Response.sendRedirect.Here the issue is when the third party website opens in the same window in portal,second level navigation menu is not getting high
-
Can photoshop photography cc be installed on two systems (desktop
I would like to install lr & ps on a windows tablet - already have it installed on a windows desktop. Does the license allow for this and if it does, how do I do the install?