on 04-13-2008 9:04 PM
Hello!
I created a form in an ABAP WebDynpro:
http://nw04s.dyndns.org:8000/sap/bc/webdynpro/sap/zpb_tr01?sap-language=EN
I bound the fields of the form to the fields of a database table.
Now what i'd like to do is, when I click on my 'Create request' button, the data already inputted in the form, should be saved to my database table. I guess this has sg to do with onSubmit action, but this is not trivial to me. Can you give me detailed instructions on how to make this happen?
Thanks,
Peter
Hi peter,
If you are trying to add data to a standard SAP table then you should use a FM or BAPI for that but if the table is not standard then you can use following steps but it would be better to do it using FM or BAPI.
Do the following(without FM/BAPI):
1. Crate a context in your view mapped to the fields of the database table.
2. Now use this context as the data source for the form.
3. Map the fields of the form with the attributes of the context.
4. Now create a button on the form or on your view which has a action event handler method.
5. In the method use code wizard to read the context attached to adobe form. By default it will create a structure containing data, which will be sufficient for adding one record at a time.
6. Now use this structure to add data to table using SQL queries.
Do the following for FM/BAPI integration:
1. Create a FM/BAPI which has the functionality to add data to your SAP table.
2. Now use service call to add the FM/BAPI fields as a context to your web dynpro component's context.
3. Now map it with the view where the adobe form is created.
4. Follow steps 2nd, 3rd and 4th as above.
5. Now in your Action method use code wizard to call the method created by service call to FM/BAPI.
This will work as required.
Please reward points if useful.
Regards,
Vaibhav Tiwari.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Another forum thread answers this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's urgent, please help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the Function module i created:
*"----
""Local Interface:
*" IMPORTING
*" REFERENCE(OUAID) TYPE INT1
*" REFERENCE(COMP) TYPE SSTRING
*" REFERENCE(BUSINESS) TYPE SSTRING
*" REFERENCE(GROUP) TYPE SSTRING
*" REFERENCE(NAMEOF) TYPE SSTRING
*" REFERENCE(MANNAME) TYPE SSTRING
*" CHANGING
*" REFERENCE(ZPBTAB) TYPE ZPB_FORM_ORG
*"----
DATA: itab TYPE TABLE OF ZPB_FORM_ORG
,
wa LIKE LINE OF itab.
wa-ORG_UAID = OUAID.
wa-company = comp.
wa-business_area = business.
wa-group_zpb = group.
wa-name_of_nou = nameof.
wa-manager_name = manname.
INSERT ZPB_FORM_ORG from wa.
ENDFUNCTION.
Thanks, this seems very useful, I have some minor problems on my server, but in a couple of days i will try this solution and i will reward points then.
But this seems very useful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.