cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in Data transfer from view to Model

Former Member
0 Kudos

Hi

I am displaying MARC data in BSP by taking Matnr as input on view.I am fetching the data in MODEL.

But, when I enter the value for MATNR in view , it is not getting transferd to MODEL. So, data is not coming as MATNR value is empty in model.

But, I hav done the DAta binding and I hav set the attributes in Controler by using SET_ATTRIBUTES method.

So,can you please tell me , what might be the reason for this.

CODE :

In View :

<htmlb:inputField id = "v_matnr"

value = "//material/v_matnr" />

In cotroler(do_request) :

view->set_attribute( name = 'material' value = me->material ).

Note : material is model instance here.

In model :

select matnr ersda mtart mbrsh matkl meins

from mara

into corresponding fields of table it_matgendata

where matnr = v_matnr.

Regards

Sandeep REddy

Accepted Solutions (1)

Accepted Solutions (1)

former_member188685
Active Contributor
0 Kudos

There are two things to consider.

1.

First you need to read the value from Formfields, then only you can able to send the value. then move the v_matnr value to model material->v_matnr.

read the form fields with the id v_matnr and get the value, and move it to model attribute.

2. Make the application Statefull.

Check it once and getback.

Answers (2)

Answers (2)

0 Kudos

Hi ,

In the DO_REQUEST method of the controller class call the dispatch_input( ) method.

Only this method help to retain the values.

Regards

D.Vadivukkarasi

raja_thangamani
Active Contributor
0 Kudos

If you set your BSP application as stateful, it should assign the value automatically ( without reading the FORM Fields) & keep the ID as same as model variable (which you already did).

Raja