cancel
Showing results for 
Search instead for 
Did you mean: 

data transfer from adobe form(ABAP WD) to database table

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

vaibhav_tiwari
Contributor
0 Kudos

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.

Answers (3)

Answers (3)

Former Member
0 Kudos

Another forum thread answers this

Former Member
0 Kudos

It's urgent, please help!

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

vaibhav_tiwari
Contributor
0 Kudos

Hi,

Please reward points if it works.

Thanks and Regards,

Vaibhav Tiwari.

Former Member
0 Kudos

Hi, our server is still down due to some DB problems, and this does not seem to be solved easily, so i believe that your solution will answer my question. So i close it, and give you the points

Thanks for your help, i really appriciate it.

Former Member
0 Kudos

Actually I'm having trouble with this.

"2. Now use service call to add the FM/BAPI fields as a context to your web dynpro component's context."

How am i supposed to do that? In the Component controller context you can only add database structures like tables.....

Please, help me solve this!