Passing values to a RFC table structure
Hi
I am using an RFC in which there is a table called Submit Details.I want to pass three rows to this table structure in the R/3 system.
Can anyone help me how to do this.
regards
Nayeem
Hi,
Private<name>View.I<value node name >Node node = wdContext.node<value node name >();
Private<name>View.I<value node name>Element ele;
<your rfc name> input = new <your rfc name>(); // your rfc name
wdContext.node<your rfc name>().bind(input); // bind
<table name> inputTable;
for (int i=0; i < node.size(); i++ ) // value node - where data is available
inputTable= new <table name>();
ele = node.get<value node>ElementAt(i);
inputTable.set<Attribute>(ele.get<Attribute>());
input.add<table name>();
// execute rfc.
Similar Messages
-
Passing values to an internal table and use it with the table painter
Hi,
I have seen this topic here before but the answers didn't help me. Maybe I,m doing something wrong.
The problem is that I defined the following structure on the |Types| tab of the |Global Definitions| section:
TYPES: BEGIN OF DETAILS,
EBELP TYPE EKPO-EBELP,
BSMNG TYPE EBAN-BSMNG,
LFDAT TYPE RM06P-LFDAT,
END OF DETAILS.
Then defined the following definition on the |Global Data| section:
WA_DETAILS TYPE STANDARD TABLE OF DETAILS WITH HEADER LINE
The problem is that when I try to assign a value to one of the fields in the program code like this:
LOOP AT WA_EKPO.
WA_DETAILS-EBELP = WA_EKPO-EBELP.
WA_DETAILS-EMATN = WA_EKPO-EMATN.
MODIFY WA_DETAILS.
ENDLOOP.
gives me the following error:
"WA_DETAILS" is not an internal table -the "OCCURS n" specification is missing.
Then if I add the "OCCURS 10" to the definition of the Global Data the error "OCCURS 10" is not expected.
How can I define, assign values and use as a parameter an internal table defined with types for use it with the table painter?Hi,
if it is one record in wa_details. you can directly write as follows..
REPORT ZCR_TEST1 .
TYPES: BEGIN OF details,
ebelp TYPE ekpo-ebelp,
bsmng TYPE eban-bsmng,
lfdat TYPE rm06p-lfdat,
ematn TYPE ekpo-ematn,
END OF details.
DATA: wa_details TYPE STANDARD TABLE OF details WITH HEADER LINE,
wa_ekpo TYPE STANDARD TABLE OF details WITH HEADER LINE.
wa_details-ebelp = '1'.
append wa_details.
wa_ekpo-ebelp = '3'.
append wa_ekpo.
LOOP AT wa_ekpo.
wa_ekpo-ebelp = wa_details-ebelp.
wa_ekpo-ematn = wa_details-ematn.
modify wa_ekpo.
endloop.
Normally it wont be one record, so u need to put <b>read statement with key</b> in LOOP and ENDLOOP.
Regards,
Sriram -
Passing RFC output structure to another RFC input structure.
Hello Friends,
I have 2 views (i.e. SearchView & ResultView). In search view, I pass input parameter (PO Number) to BAPI_PO_GETITEMS and get back the output table PO_ITEMS correctly. I display this table in the ResultView correctly. Now, after displaying the order details, I need to pass this input to BAPI_GOODSMVT_CREATE in its GOODSMVT_ITEM structure to create a Good Movement Note.
Can somebody help me as to how could I pass values from PO_ITEMS to GOODSMVT_ITEM structure?
Thanking you in advance,
MaulinHi,
You can pass the input of BAPI_PO_GETITEMS to the BAPI_GOODSMVT_CREATE .
For this u need to first understand and read the BAPI throughly, means u must read how your two bapi's are working and what are the relation ship b/w them.
Also, i assume that in a ur webdynpro application u already imported all required BAPI and just simple take the user Input from the context and pass it to the next Bapi.
Hope so it can solve ur pb,If there is any more query, put in forum.
Thanks
Dheerendra Shukla -
Passing values to RFC/BAPI Table
Hi,
I am having a very strange problem. While passing the values to RFC/BAPI table using add method the values are not passed to backend SAP. Below is the code which I am using just to pass some data in RFC/BAPI table.
The same code was working few days back. Is there any configuration in JCO or any other problems other than the code?
Your l help is greatly appreciated.
public void executeZtest_Function_Input( )
// //@@begin executeZtest_Function_Input()
// //$$begin Service Controller(943377124)
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try{
Ztest_Function_Input input = new Ztest_Function_Input();
for (int i=0; i<5;i++){
Zhr_Ear_Cclist cc =new Zhr_Ear_Cclist();
cc.setFi_User("[email protected]");
input.addIcc_List(cc);
wdContext.nodeZtest_Function_Input().bind(input);
wdContext.currentZtest_Function_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
} catch(WDDynamicRFCExecuteException ce) {
manager.reportException(ce.getMessage(), false);
//$$end
//@@endHi Raksh,
I also got the same problem. Please check the following ways then you will solve problem.
1. First check the appropriate BAPI in SAP GUI Software. You have to determine where is the problem?. Is it in Dynpro or BAPI itself?.
2. Suppose the BAPI structure change you will wont't run. If BAPI strusture change you have to reimport BAPI.
3. Please check the JCo connectio using test Button. Then redeploy your project.
4. Rebuild your project then redeploy.
Check the above ways you may get answer.
Kind Regards,
S.Saravanan -
How to pass value in Table import parameter of an RFC
Hi all,
I have an RFC in which import parameters are in the form of a table
so now when i imported that RFC in my webdynpro application and Apply Service Template to it, it created the structure but when i applied form template to it all the inputfields were readonly
and also when i tried to set the input parameter of that table like:
wdContext.currentBAPI_CREATEElement.set<field>("value");
it shows null pointer exception
MY Context structure created after service template is as follows:
Model Node Zcreate_rfc, it icludes another model node
BAPI_CREATE, and it then includes the input parameters
Please tell me how to solve the problemSuppose the RFC is called ZRFC, and the table structure is called TableStruct, then this works for me (in execute method before calling execute):
ZRFCInput input = wdContext.currentZRFCElement().modelObject();
// these are regular import parameters
input.setAaa(aaa);
input.setBbb(bbb);
if (input.getTableStruct()!=null) {
input.getTableStruct().clear();
// In this loop table rows are added
for (int i=0; i<sourcList.size(); i++) {
ZTableStruct table = new ZTableStruct();
table.setDdd(((SomeBean) sourcList.get(i)).getDdd()); // for property ddd
input.addTableStruct(table);
Good luck, Roelof
Edited by: R. Knibbe on Jan 23, 2008 3:25 PM -
How to pass values in dynamic structure and then dynamic table
Hi,
we have a Z structure in se11 holding 10 fields. But at run time i need to create a dynamic table with more than 10 records.
I am able to create the structure and corresponding internal table. Now the issue is i have to populate this dynamic structure with some values and then append it to dynamic internal table. Since the dynamic table type is any its not allowing an index operation like modify etc etc.
Could anyone help me in passing the values . I have searched in SDN . everyone created a dynamic table and then populated it values from some standard or custom tables.Then assigning the component of structure and displaying the output. but in my situation i have no such values stored in any tables. i populate values based on certain calculation.Hi Friends,
This is the piece of code.After creating dynamic work area and dynamic table what i should do?
TYPES: BEGIN OF STR,
ID TYPE I,
NAME(30) TYPE C,
END OF STR.
data: v_lines type i.
STR_TYPE ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_NAME( 'STR' ).
STR_COMP = STR_TYPE->GET_COMPONENTS( ).
APPEND LINES OF STR_COMP TO COMP_TAB.
COMP-NAME = 'NAME1'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'VALUE1'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'NAME2'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'VALUE2'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'NAME3'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
COMP-NAME = 'VALUE3'.
COMP-TYPE = CL_ABAP_ELEMDESCR=>GET_STRING( ).
APPEND COMP TO COMP_TAB.
NEW_STR = CL_ABAP_STRUCTDESCR=>CREATE( COMP_TAB ).
NEW_TAB = CL_ABAP_TABLEDESCR=>CREATE(
P_LINE_TYPE = NEW_STR
P_TABLE_KIND = CL_ABAP_TABLEDESCR=>TABLEKIND_STD
P_UNIQUE = ABAP_FALSE ).
CREATE DATA DREF TYPE HANDLE NEW_TAB.
CREATE DATA DREF1 TYPE HANDLE NEW_str. -
Hi All,
I have a requirement where we need to connect to a different system using RFC and pass data.
I have data in the table . The requirement is using RFC, i have to write a code, so that i can send all the possible values of a field in the table to the remote system. I have 5 fields in my table in SAP. First i need to pass all the possible values of field1 to the remote system and based on the input in their system, i need to pass all possible values for field2 to remote system and again based on field1 and field2 i need to pass all possible values for field3 to remote system.
Pls let me know how to do coding for this.
Thanks,
RajuRaj,
We need to pass the possible values from our custom table to the remote system, so that the user can see all the possible values for the fields. Similar to the F4 option.
And based on field1 input in the form by the user, we need to get corresponding values for field2 of all possible values and pass it to the remote system.
If your user is filling the forms in the non-SAP system itself, means you are just providing the data to that system for the actual user action there. So, either you can send the whole data everytime and let non-sap system handle the logic which you need for the possible values for each selection. Better if you are able to store all data in the remote system itself to avoid large data communication everytime and just sync the 2 systems whenever something changes in SAP.
Otherwise, if you want to control it from SAP itself, then you need 2 way communication.....once user fills 1st field in FORM, remote system sends that to SAP and then you send the 2nd field valid values to remote system again using same/different RFC and so on. But, I doubt that will be efficient for the user filling the form.
Regards,
Diwakar -
Hi Friends
I have a requirement where I have to pass few values from Adapter Module to RFC which will update the database table.
Example: I have to pass filename and filesize to RFC which will update the table X
Could someone provide me the snippet of the code.
Thanks
Abhishek MahajanHi Abhisek,
Through UDF, you can access the Adapter Specific Attributes like File Name and pass the same to RFC.
Pls go through
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70c89607-e4d9-2910-7280-f6746e964516
Hope this will resolve.The code snippete is written there.
Regards,
Subhendu -
To pass value in field like LEV_BAL wchich exist only in custom structure
Hi All,
1> I have to make a function module which is showing employee leave balance for leave type
I have a table pa2006 and pa2005 in which data is available for available leave (ANZHL)and taken leave (KVERB) by employee. But ther is no field for leave balance.
What my point is i am using a structure in which i defined a field LEV_BAL type ANZHL. This field does not exist in any sap table.
I can put select query for available field in pa2006. Now what should i do to get data into LEV_BAL field of structure and same can reflect in my internal table for function module.
2> There is a bapi function module BAPI_TIMEQUOTA_GETDETAILEDLIST which is using a structure BAPIHRQUOTA. This structure hold field as ENTITLE, DEDUCT, ACCOUNT, REST for Quota entitlement, Quota used, Quota calculated, Quota remaining as of respectively. Can one can give me idea from which SAP table these values are fetched in to this structure for function module.
Regards
Ranjeet SinghSuppose the RFC is called ZRFC, and the table structure is called TableStruct, then this works for me (in execute method before calling execute):
ZRFCInput input = wdContext.currentZRFCElement().modelObject();
// these are regular import parameters
input.setAaa(aaa);
input.setBbb(bbb);
if (input.getTableStruct()!=null) {
input.getTableStruct().clear();
// In this loop table rows are added
for (int i=0; i<sourcList.size(); i++) {
ZTableStruct table = new ZTableStruct();
table.setDdd(((SomeBean) sourcList.get(i)).getDdd()); // for property ddd
input.addTableStruct(table);
Good luck, Roelof
Edited by: R. Knibbe on Jan 23, 2008 3:25 PM -
Passing value to bind variable of another table from one table
hi,
I have a multi select table. When one row is selected from this table (no button is clicked, only selection is done), an attribute from that selected row (say userid) should be passed to the bind variable of another table and the corresponding details of that particular userid should be displayed in the other table. When more than one row is selected, the other table should display no rows.
My main problem is what code has to be written to pass value to bind variable and where it should be written.
Please give me a detailed explaination as soon as possible.
Thank you.Sorry, didnot add this. The table is multi select table.
-
Pass Values between two Function Modules RFC in Portal
I need to pass values between 2 FM RFC.
I have an implicit enhancement in HRMSS_RFC_EP_READ_GENERALDATA RFC function module.
PERNR LIKE PSKEY-PERNR
ENHANCEMENT 1 Z_ESS_EXPORT_PERNR. "active version
EXPORT pernr to memory id 'PMK'.
set parameter id 'PMK' field pernr.
ENDENHANCEMENT.
On the other hand an RFC function module that has the code:
pmk LIKE PSKEY-PERNR,
pmk_2 LIKE PSKEY-PERNR.
get parameter id 'PMK' field pmk.
IMPORT pmk_2 FROM MEMORY ID 'PMK'.
When the execution is done in development environment, the modules function at the level of R3, the "get parameter id" works only if the debbuger is classic, otherwise not work. The Import to memory id never works.
In the environment of quality, r3 do not work any of the 2 sentences. If run from portal (which is as it should be) does not work.
Thanks if anyone can help me get the problem. Both function modules are executed at the portal.
Regards
Edited by: Daynet1840 on Feb 15, 2012 2:02 AMWhen the execution is directly in r3, in development environment or quality, does the set / get parameter id. Export / Import memory id not work.
But if the FM are called from the portal, does not the set / get parameter id.
I tried changing the sentence as I indicated harishkumar.dy still not working.
Madhu: They're in different function groups, one is standard and the other not.
Regards
Edited by: Daynet1840 on Feb 15, 2012 3:08 PM
Edited by: Daynet1840 on Feb 15, 2012 3:11 PM -
Pass value at run time from one structure to diffrent structure
hi experts.
i m workin on crm domain and faching problem to pass value from one stucture to another . problem is that i want the output in xml file so i need all the values interm of segment.
initialy i have this structure.
DATA: BEGIN OF struc1 occurs 0,
ST_ORDERADM_H TYPE CRMT_ORDERADM_H_WRKT,
ST_PRICING TYPE CRMT_PRICING_WRKT,
ST_ORGMAN TYPE CRMT_ORGMAN_WRKT,
ST_PARTNER TYPE CRMT_PARTNER_EXTERNAL_WRKT,
END OF struc1.
and using fm CALL FUNCTION 'CRM_ORDER_READ' i got values on this structure at run time.
MOVE LT_ORDERADM_H to STRUC1-ST_ORDERADM_H.
MOVE LT_ORGMAN to STRUC1-ST_ORGMAN.
MOVE LT_PARTNER to STRUC1-ST_PARTNER.
MOVE LT_PRICING to STRUC1-ST_PRICING.
and after that using
try.
CALL TRANSFORMATION id
SOURCE data_node = STRUC1
RESULT XML xmlstring.
CATCH cx_st_error.
endtry.
CLEAR: tab_xstring,
lv_filename,
lv_path,
lv_fullpath,
lv_user_action.
REFRESH: tab_xstring.
lv_bytes = XSTRLEN( xmlstring ).
IF lv_bytes > 0.
lv_xstring = xmlstring.
DO.
APPEND lv_xstring TO tab_xstring.
lv_xcnt = XSTRLEN( lv_xstring ).
IF lv_xcnt > xsize.
lv_xstring = lv_xstring+xsize.
ELSE.
EXIT.
ENDIF.
ENDDO.
now it convert to xml file .
problem is it gives me value of all field associated with standared structure.
but client requirment is that he want only selected values of given structure.
so i think i make a new structure for given value but i m not able to get values in new structure.
thanksHi,
create a structure in se11 with following fields
ST_ORDERADM_H.
ST_ORGMAN.
ST_PARTNER.
ST_PRICING.
for example as STRUCT2.
data : begin of i_struct2 occurs 0.
include structure struct2.
data : end of i_struct2.
MOVE LT_ORDERADM_H to i_STRUCt2-ST_ORDERADM_H.
MOVE LT_ORGMAN to i_STRUCt2-ST_ORGMAN.
MOVE LT_PARTNER to i_STRUCt2-ST_PARTNER.
MOVE LT_PRICING to i_STRUCt2_PRICING.
then
try.
CALL TRANSFORMATION id
SOURCE data_node = i_STRUCt2
RESULT XML xmlstring.
CATCH cx_st_error.
endtry. -
How to read a table/structure value in a container from a Z program
Experts,
I have a WF with one of the container element is a multiline table element of the strucuture BSEG. Now I have a report where given a WID, i need to read the contents of this structure from the workflow container and display in ALV grid.
I'm using the FM SAP_WAPI_READ_CONTAINER or SWW_WI_CONTAINER_READ to read the container. No issues till here now.
I'm able to read the contents of the attributes that are simple without being in a structure/table.
But, how do i read the values from the table/structure in the container from this FM?
I see lots of threads talking about SWC_GET_TABLE or something like that. But I don't know whether and how to use it in my scenario. Any sample programs will be greatly appreciated.
Thanks,
SamHey,
No issues. I sorted out myself. Glory to God in the Heavens!
-Sam -
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. -
Passing values between event structure cases
Hello everybody,
I have a question concerning the event structure - how to pass values (let's say a string / the state of a boolean control / the value of a numeric control value / an array of numeric values) between event cases ?
There seem to be 2 situations here :
- when you need to pass the value of the control that triggers an event;
- when you need to pass the value of a control which is modified in an event case.
I have read the documentation but i still do not understand very clearly how to do this. Maybe you can point me in the right direction (maybe some threads on the forum that i have missed).
Thank you very much !!
(KUDOS for everyone who is interested in this )AndreiN2014 wrote:
- when you need to pass the value of the control that triggers an event;
- when you need to pass the value of a control which is modified in an event case.
The first question isn't worded very well. What exactly are you looking to do? Are you looking for an event that specifically relates to that control? If so, just drop it inside of the event and wire it. Are you looking to trigger multiple events from the same control? Ie, you hit the control, event1 is triggered which then triggers event2 ... ? If so, you might consider taking a look at a different architecture. I can think of very few cases where I'd prefer do this over something like having the button trigger a state and using the state machine architecture.
Others have pointed out the Shift Register. This is the typical way to pass values between one iteration of a loop to another. We can assume you have some sort of loop outside of the event structure to make it run a second time. Put a shift register on this loop and the value wired into it will pass each iteration. But, if it's just a random control, you can also just leave that outside of the event structure and wire it in as well. This will provide the new value to the next occurrence of the event structure.
You really need to define your problem before trying to solve it.
Maybe you are looking for
-
Openoffice 3.2 calc doesn't save row height in xls
Hi All, I have upgraded to ooo 3.2 recently. I work with excels spreadsheets so I have to save files into xls. Suddenly I realized that Calc doesn't save custom row height, when I open the file all rows are displayed with default height. It worked i
-
Validation for tax code not to use
Dear Gurus, i had done validation for purchase/sales tax code not use while doing transction. Prerequisite BKPF-BUKRS =1000 CHECK NOT BESEG-MESKZ IN ZTAXCODE Message you can't use this tax code i had done this validation for parent company code(1000)
-
How to write notes using 3rd party plugins ipad
Hi, Basically im trying to write the notes in garage bad from imini. But all i can do is record it using audiobus. Is there anyway to write the notes in garageband using the imini. Kind regards Martyn
-
Hi Guys I have a Proxy to File scenario. My Receiver structure is like this Output ---File 1 <AA> <BB> <CC> ---File 2 <AA> <BB> <CC> ---File 3 <DD> <EE> <FF> ---File 4 <DD> <EE> <FF> ---File 5 <GG> <HH> <II> File 1 and File 2 are identical. File 3 an
-
Can't choose disk in Startup Disk?
Why might a disk not be available to choose in the Startup Disk prefpane? After a restart, my Xserve (Xserve1,1) started up on the bootable clone (Bay 2) I keep up-to-date with Carbon Copy Cloner. The original system drive (Bay 1) is visible and moun