Let's follow up this discussion at the Neptune Community

(this forum will be kept in read-only mode)
Answered

Save data from TextField into a Table in SAP with a button

Hi,

I am new with the Neptune Software and hope you can help me please.

I have to save data from a TextField into a Table in SAP.

 

First i do this in the Event 'press' of the button:

(x and y are id from the TextFields)

 

var one;

var two;

one = x.getLiveValue();

two = y.getLiveValue();

 

So I have the contents from the two TextFields.

And know my question, how can i save the content in a SAP Table ?

 

Thanks &

Regards


Michael


Best Answer

Hi Michael


I recommend you reading this Neptune Application Designer documentation. It will provide you with information in how to send/receive data between the client and SAP:


http://support.neptune-software.com/solution/categories/126081/folders/215866/articles/4000044553-neptune-application-designer


The HowTo:

- Create a structure in your Application Class, make it Public

- Bind the structure to your sap.m.Page object

- Bind the textfields to fields in the structure

- Create an Ajax object or use the Page and set right AJAX_ID (Like SAVE)

- Send data to SAP by calling a premade javascript function getOnline<your object>();  (your object is the name of the Ajax object or the Page where you have the Ajax ID

- Prosess the data in SAP


Regards

Ole Andre 


Hi Ole Andre,

thank you, now it runs.


Regards

Michael

Hello everybody,


I did it as follows. It also works. :-)


var material1;
var werk1;
var lagerort1;

material1 = inputMaterial.getValue();
string1 = ":";
werk1 = inputWerk.getValue();
string2 = ":";
lagerort1 = inputLagerort.getValue();


var all = material1.concat(string1,werk1,string2,lagerort1);

getOnlinetabBestandsliste(all);


App.to("pageBestandsliste2");

 and in the method:

 

data: lv_matnr type string,
      lv_werks type string,
      lv_lgort type string.


* Use KEY
  split AJAX_VALUE at ':' into lv_matnr
                               lv_werks
                               lv_lgort.


     SELECT
       MARD~MATNR
       MARD~WERKS
       MARD~LGORT
       MARD~LABST
       MARD~INSME
       MARD~EINME
       MARD~SPEME
       MARD~RETME
         FROM MARD
          INTO CORRESPONDING FIELDS OF TABLE it_BESTAND
           WHERE MATNR EQ lv_matnr
            AND WERKS EQ lv_werks
            AND LGORT EQ lv_lgort.

...

 

Hi Ole Andre,

thank you for your help.


Now i have an other question i hope you can help me a second time.


I have 2 comboboxes with values for example:  "plan": 1,2,3 and "team": 10,11,12.

defined an ajax object. With this i can give one parameter to the select querry in class builder.

With click on a button i come to a page in my application, what shows me a table with selected after "plan" number 2 for example.

Now my question, how can i give the second value from the combobox "team" to the selection?

Here is the code to give the number "2" to the selection:

var i;

i = oComboBox1.getSelectedKey();

getOnlineoTable1(i);


"i" is in the parameter ajax_value so i can select in the method :

SELECT * FROM table WHERE plan_nr = ajax_value.


Is it possible to transfer two parameters : getOnlineoTable1(i, j); ?


Thanks &

Regards


Michael

Hi Michael


The ajax_value is only for one single parameter passed to the application class. In my last post I wrote how to do it, but you can check this blog: 


http://support.neptune-software.com/solution/categories/122856/folders/264770/articles/4000037369-develop-your-first-sapui5-mobile-application-with-neptune-application-designer-3-0


I will take you step-by-step so you can understand the binding consept. 


You need to bind a structure you will use for the search in your application class. Bind it to the page where you have the selection screen. For combobox, bind selectedKey property to the right field in the structure. Then on the AJAX_ID, remember to press send checkbox so the data are passed back to SAP.


Regards

Ole Andre 


Answer

Hi Michael


I recommend you reading this Neptune Application Designer documentation. It will provide you with information in how to send/receive data between the client and SAP:


http://support.neptune-software.com/solution/categories/126081/folders/215866/articles/4000044553-neptune-application-designer


The HowTo:

- Create a structure in your Application Class, make it Public

- Bind the structure to your sap.m.Page object

- Bind the textfields to fields in the structure

- Create an Ajax object or use the Page and set right AJAX_ID (Like SAVE)

- Send data to SAP by calling a premade javascript function getOnline<your object>();  (your object is the name of the Ajax object or the Page where you have the Ajax ID

- Prosess the data in SAP


Regards

Ole Andre 

Login or Signup to post a comment