cancel
Showing results for 
Search instead for 
Did you mean: 

submitting data into SAP?

Former Member
0 Kudos

Ok so.

On my current project i have to do research on SAP and Adobe Interactive Forms.

My goal is to have a fully functional Interactive Form which sends data from the form to the SAP database.

The past few weeks i have installed and configured the SAP environment with ADS, J2EE etc to get it all going.

I dont have any experience with ABAP, there for i choose for Netweaver Developer Studio with the JAVA based Webdynpro.

I am using SAP Netweaver Developer Studio to create the form.

After all this i started to execute a few tutorials and watch eClasses from the eLearning section.

After completing this tutorial https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4fd2d690-0201-0010-de83-b4fa0c93...

I dont see any interaction with the SAP system.

The implemented code to show the input from the form on the window. Has nothing to do with a database or backend, its just a message that the data from the textfields was received correclty.

Code:

<i>String name = wdContext.currentTraveDataElement().getEmployeeName();

String costcenter = wdContext.currentTraveDataElement().getCostCenter();

String city = wdContext.currentTraveDataElement().getDestinationCity();

String country =

wdContext.currentTraveDataElement().getDestinationCountry();

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess(

"Form submitted: Name="

+ name

+ " costcenter="

+ costcenter

+ " city="

+ city

+ " country="

+ country);</i>

My question is how do i submit the data from a form (like a text field) in to a database in the SAP sytem.

Is this only doable with a BAPI?

What i learned at scool with SQL and JAVA etc.

are basic commands like (insert "costcenter", "country" INTO database)

How do i create a command/procedure/function(/BAPI?) like that so that when the user clicks the "Submit to SAP" button the query is executed and all the input from the textfields is inserted into the SAP database?

I think that in this tutorial

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1bbc91c3-0401-0010-91bc-a25b2a3d...

there is explained how this is done but the sample project template is unavailable and i cant download it anywhere.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

BAPI is delivered and maintained by SAP, usually they are bound to business object.

not only BAPI can be called in WDJ, all function module marked as remote function call could be called.

Answers (1)

Answers (1)

Former Member
0 Kudos

there are many scenarios available, i think you are talking about the so called 'online interactive' scenario.

first you need to decide which tools to use, two main tools are available:

webdynpro for java and for abap.

i prefer webdynpro for abap, because it's more stable, at least upon my experience.

then you have to decide to use xacf or zci layout, xacf you have to install a small plugin in every client machine, while zci stands for zero client installation. these stuff will take care of the data exchange between IE and SAP.

the data inside pdf is not written to sap directly, you have to bind it with context of your webdynpro application, for simple form you may use the static binding, for complex scenario you may bind the whole pdf file and extract xml data from it.

so the action behind the button you described as 'Submit to SAP', is doing the job to read data from context, not from the pdf.

once you have the data, you can do what ever you want.

anyway, it's just my understanding, hope it's helpful.

br.

Jun

Former Member
0 Kudos

yes ok.

I have chosen for webdynpro in java using the developer studio because i am new to the SAP and ABAP environment and i have experience with JAVA.

I know that from the context you make variables can be made and data can be entered.

What remains a mistery to me is how these variables defined in the context get into the sap database after clicking on the submit to sap button.

There has to be some code that says to the application that the input from field1 has to go to table 1 in the database right ?

Former Member
0 Kudos

regarding wdj, as far as i know, in order to submit to sap:

1. you have to use a rfc, that is a function written in abap on sap side, which will take care of the database update;

2. you need to build a java proxy class, there is a wizard available in wdj ide,

after that ,you can call the rfc in your java world

there are also some other possible ways, for example, via webservice.

br.

jun

Former Member
0 Kudos

Hi Marc,

For each Interactive form ,u take in webdynpro for java,an event called onSubmit is already available.Tehn in adobe life cycle designer ,u have library available & in that u have submit button.Add that button in ur form.It will automatically add some code,what u can see in Script Editor pallette.it looks like

// DO NOT MODIFY THE CODE BEYOND THIS POINT - SubmitToSAP.xfo

app.eval("event.target.SAPSubmit();");

// END OF DO NOT MODIFY

As soon as u click this button,ur event onSubmit will be called.So u can add ur code for submit to sap over here.

Now Submitting data to backend,u have to use BAPI's only.In ur bapi commit will be available & anyhow ur context attributes are mapped to rfc model.So i don't think u have much things to do.

regards

Sumit

Former Member
0 Kudos

Ok

I have given more thought to it and read up on a few tutorials and such.

So in this code

/** declared validating event handler */

public void onSubmit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onSubmitServerEvent)

// The event handler onSubmit triggers the remote function call

wdThis.wdGetFlightListCustController().executeBapi_Flight_Getlist_Input();

//@@end

}

Variables are send to the BAPI_FLIGHT_GETLIST_INPUT and on the RETURN in the BAPI it returns data from the backend.

Atleast thats how i understand it.

So now the question is what BAPI can i use for my business case or do i have to create a new one?

For my business case i have to alter addres data from a client:(Adress Name Zipode City etc) So the client fills in his new adress clicks on submit, data is validated and altered in the backend.

I checked BAPI 's concering BusinessPartner but couldnt really figure it out.

Former Member
0 Kudos

Hi,

I suggest you to create a BAPI on your own at the R/3 end and call it from the WDJ application .. so that you can have greater flexibility. Unless you find a suitable BAPI (se 37 for function modules) that meets your requirement (considering you are using standard tables etc)

Rgds,

Anto

Former Member
0 Kudos

Yes i will be using standard table .

Is there any howto on making a BAPI to match my requirements?

The BAPI should be able to handle incoming variables, these variables will be used in query's and the data/output from these query's should be returned to the application.