cancel
Showing results for 
Search instead for 
Did you mean: 

Transfert data from Webdynpro to SAP R/3

Former Member
0 Kudos

Hi all,

Here is my need and my problem :

- I have retrieved from R/3 some data from an InfoType

- Those data are retrieved in Webdynpro and displayed in a table.

- I' like to allow the user to modify a data in the portal then click on a "Change data" button

- All data modified should be stored in the same infotype than the data I retrieved.

I have replace the cells I want modify in my table with an "Input field". Their are well bind and the data incoming are well displayed.

I have some part of coding but in an example I found but the data are stored in a table and not in an Infotype so that's not exactly the same.

Does anyone has an idea? A documentation link?

Thank you in advance.

Regards

Matthieu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Matthieu,

You can copy fields to a second node with the same elements when having read the data from R/3 . Check this Class: http://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/progmodel/api/WDCopyService.IWDCo...

Then you can do your checks before the data is saved. by comparing the elements.

There is also a blog if this class doesn't do all you need, but most of the time it works just fine.

J

Answers (3)

Answers (3)

Former Member
0 Kudos

Thank you all for your help.

Former Member
0 Kudos

Hello,

Thanks for your answer, I followed your instructions and I asked to my ABAPer to develop a specific BAPI.

Here is the process :

- data coming from the backend are displayed

- the user modify the end date in the input field

- when he clicks on the "Change" button, the action method has to compare the "old date" (backend date) and the "new date" (inputfield value)

- my clue is the following : how can i get and compare the inputfield value without deleting the "old value"???

The goal is to check if the new date is not under the old date. If it is so the old date should replace the new one.

I hope my clues are cleared enough.

Thank you for your help.

Former Member
0 Kudos

Hi ,

You can compare the values of your UI table node with your relevant node from the BAPI output structure . There must be a parent key for the rows. Use this and compare the value. If they match the dont add data to the BAPi structure or else do so

Former Member
0 Kudos

Matthieu,

I believe, you maintained a context node (table node say Vn_Table) and attributes within to bind to the display table on the screen and not bound the display table direcly to the Model Node(say Mn_<YourModelName>.

If you want to retain both the new date and the old date for every entry in the table so that you later apply the comparision between them and then display the appropriate on the screen on click of Change Button, then better maintain two atributes say Va_AttrOld and Va_AttrDsp of same datatype date under the table node(Vn_Table) bound to the display table on the screen.

Bind the input field for date in the table with the Va_AttrDsp attribute only under Table Node. So, what so ever changes you make on the screen will be retained in this Va_AttrDsp. Now, when you execute the Bapi to get the table populated for the first time set both the attributes of the table with the value of date coming from the Model Node. So, the first time input field will display the old date.

On Action of Change button, apply comparision and if Old Value need not to be updated then overwrite the Va_AttrNew with Va_AttrOld value else do not change.

This way you will never lose the old date.

All the best.

Regards,

Tushar Sinha

Former Member
0 Kudos

Hi Matthieu,

If you want to change a value of an infotype on the backend, first you should create a BAPI that does it. Then you can call that BAPI from Webdynpro and then do the changes accordingly. So, catch up with your ABAPer and ask them to create a BAPI that lets you edit the Infotype. Then you job is very easy..

I hope this helps. Let me know if you need any more help regarding this.

Regards,

Gopal.