on 05-09-2005 2:40 PM
Hi all,
I am using RFC for connecting my webdynpro to the backend.
I am calling the RFC for saving every single data.
I want to reduce the RFC calls by having something like batch processing.
Can someone guide me, how is it possible using WebDynpro?
Thanks,
Ashutosh
Hi ashuthosh,
What is the structure of your import and Export parameters of your RFC.
There are 2 ways to acheive it.
In the RFC either
1. Use a Table parameter
2. Use a Export Structure
If you use a Table parameter in your RFC then in your webdynpro when you import your adaptive RFC model you would get the Table as a class.
Assume your RFC/BAPI is called "Bapi_RFC_Insert"
write the code
Bapi_RFC_Insert in = new Bapi_RFC_Insert();
wdContext.nodeBAPI_RFC_Insert_InputElement().bind(in);
<TableName> <someName> = new <TableName>
<someName>.setTabValue1();
<someName>.setTabValue2();
in.add<>(<someName>);
This should pass values as a batch.
You can also do this using Export parameters. But a table is much better.
Let me know if you require more information.
regards
ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ashutosh
As every body suggested u need to have a Table Structure that accepts multiple records from front end and inserts into back end.
So if u have Table Structure
Then the code can be in following terms
1. Create a Value Node say VnSubmitData with Cardinality 0..n.
2. Store all the records in that alue Node vnSubmitData.
3. For Confirmation check the Size of the Value Node.
4. Then Loop the Value Node vnSubmitData.
5. Inside the Loop create everytime a new Instance of your Structure. For Example your Structure name is structAbc so inside the loop create an Instance like
structAbc structObject = new structAbc();
6. then u can use that object to store the data like
structObject.set<<Ur Values>>(wdContext.nodevnSubmitData().getVnSubmitDataElementAt(i).get<<ValueAttributeName>>();
7.Then Inside the Loop add the Structure to the Model Object say save is ur Model Object then say
save.addIt_<<ImportStructure>>(structObject);
8. Close the For Loop
then u can say save.execute();
Hope this Helps you
With Wishes
Krishna Kanth
Hi,
Generally .execute() method will take one record and executes the FM in the backend.
In your case the FM should take a collection as inputparamter so that before calling .execute() method in webdynpro you can pass a group as parameter.
Regards, VIP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ashutosh
If you can group the data that you are updating SAP,Then use table parameters in the RFC.
Let me know if you require any other help.
Kishore
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.