cancel
Showing results for 
Search instead for 
Did you mean: 

reference number for webdynpro.

former_member190689
Contributor
0 Kudos

Hello Gurus,

How to create a reference number which could be generated automatically as the user creates a new material in web dynpro.I have created a table for user and provided him two buttons like Modify and Save in one of the view.Now when the user clicks on Modify the table in testview goes to textedit and user can make changes to the required field and when he clicks save the changed field is saved and a reference number should be generated.So my question is

1.How to change a table from textview to textedit form when user clicks on modify.

2 How to create an automatic generated reference number for every changes made to this table and also the changed field is saved in the corresponding fields of that ztable.

Thanks in advance

Gaurav Gautam

Accepted Solutions (1)

Accepted Solutions (1)

amy_king
Active Contributor
0 Kudos

Hi Gaurav,

(1) Instead of trying to switch between a TextView and a TextEdit element, you could instead use only a TextEdit element and toggle its readOnly property to true or false depending on whether the user may edit the field.

(2) Rather than develop a custom solution to track changes, you may want to implement change documents for the MARA table (or whatever table you are using to store your material data). You could then show the user the change document number as the reference number.

Cheers,

Amy

former_member190689
Contributor
0 Kudos

Hi Amy,

     Could you please tell me how to implement change document number for ztable.As I have used 4 different tables MARA, MAKT,MARC and a Ztable(where combination of all the 3 tables with few fields).

Now on my first view I have provided the select-option on matnr.When the user clicks on matnr and submit.

1.The required document being searched can only be viewed in that table which is going to be displayed.Now I have provided 2 different button as table toolbar a.Modify b.Save.

As he clicks on Modify ONLY then textview should be changed to textedit in order to avoid unwanted changes.

Please do clear me on this as how to convert from textview to textedit.

Regards

Gaurav Gautam

former_member184578
Active Contributor
0 Kudos

Hi,

Check this link: Creating Change Documents for Custom Tables

Hope this helps u.,

Regards,

Kiran

amy_king
Active Contributor
0 Kudos

Hi Gaurav,

Instead of trying to switch between a TextView and a TextEdit element-- which are two different UI elements-- you should instead use only a TextEdit element on your view and toggle its readOnly property to true or false in order to control whether the TextEdit is editable or not editable.

To do this, create a context attribute of type WDY_BOOLEAN and bind this to the TextEdit's readOnly property. Now in you action handler method for the modify button, set the context attribute value to either true or false.

Here is the TextEdit element documentation if you would like to read about its properties.

Cheers,

Amy

Answers (2)

Answers (2)

former_member190689
Contributor
0 Kudos

Hi Amy,

   Thanks a lot brother.My problem has been resolved.But the requirement has now  been changed by my client again the same table with new requirement.

Thanks a lot for your help

Regards

Gaurav Gautam

former_member190689
Contributor
0 Kudos

Hi Amy,

I tried with your given solution but now I am facing a different problem as data are not visible in table.I debugged the program and then viewed the table there I can see all the required data but I don't understand why its not being displayed on the table.

Regards

Gaurav

amy_king
Active Contributor
0 Kudos

Hi Gaurav,

After you collected the data for your Table element, did you bind the data table to the context node that serves as the Table's dataSource? For example...

   node->bind_table(
     new_items               = lt_items
     set_initial_elements = abap_true ).

If you have done this and are still having a problem, please create a new discussion for the issue.

Cheers,

Amy