cancel
Showing results for 
Search instead for 
Did you mean: 

want to save user inputs from a survey form to Ztable

Former Member
0 Kudos

Hi,

I have a survery form where user has to enter rating and remarks for each questions. I have a table ZUSER which holds username and organization and an ouput table ZOUTPUT where I save username, organization along with rating, remarks and questions. I have used buttons and given questions as button text (to get border and a crisp view). There are 14 questions.

Context nodes: Output--Username

                                   --Organization

                                   --Rating

                                   --Remarks.

All input fields are mapped to same attributes(rating and remarks). Only the last values gets saved into DB.

Can you please tell, what should I do to get user inputs correctly from context to save them in ZOutput.

Also tell, is there any way to get the corresponding questions while saving the answers other than direct hard-coding

I have attached the form layout.

Thanks,

Ashly

Accepted Solutions (1)

Accepted Solutions (1)

former_member197475
Active Contributor
0 Kudos

Hi,

As all your input fields are mapped to same attribute, your latest and last record will hold the value that it has at run time. So obviously you will be having the last entered data in your hand.

Please try to change into your design as below.

1. Create a context node w.r.t the table ZOUTPUT(User Name, Org and Questions).

2. Now create one more node with Questions, Ratings and Remarks with specific to each questions. Else you can also design your node with 14 questions and with one remark/rating context. So in this case, to get the exact ratings and remark, read the values with respect to the type of questions from the user.

Try out this.

BR,

RAM.

Former Member
0 Kudos

Thanks, did the same.

Is there any way to invalidate a node.? I have a button CANCEL, on clicking which I should make all fields blank. It should happen without clicking SUBMIT button, as user wants to cancel his action.

I have tried various options like:

1) clear ls_output.
append ls_output to lt_output_node.

2) lo_nd_output_node->invalidate( ).

But none of them worked. Plz help

former_member197475
Active Contributor
0 Kudos

Hello,

lo_nd_output_node->invalidate( ) will actually clear all the context attributes automatically. No need to go ahead for clearing ls_output.


Please recheck your code in on-action of your Cancel button, once you invalidated the node. I feel that, you are setting the context values after the method lo_nd_output_node->invalidate( ).


Please check it once. Else paste your code here. it will be easier to analysis.


BR,

RAM.

Former Member
0 Kudos

Dear Ram,

I used the below code to clear input fields. RATING1 is the attribute bound to the input field.

lo_nd_output->SET_ATTRIBUTE_NULL( name = 'RATING1' )


This worked for me.


Thanks alot for your response !


Regards,

Ashly



former_member197475
Active Contributor
0 Kudos

Hi Ashly,

Method SET_ATTRIBUTE_NULL clears your attribute and where as invalidate method clears all of your context attribute from your node.


Also requesting you to please close the thread, as it may help others to get quick resolution.



BR,

RAM.

Answers (1)

Answers (1)

nishantbansal91
Active Contributor
0 Kudos

Dear Ashly,

You have to create the 14 different field for your 14 question, Because if you mapped the same field into two element the latest changes are updated in the DB, that thing was happened in your case,

Thanks

Nishant