2016 Mar 09 7:36 AM
Hi All,
I have added some fields in additional data b on va11 screen. There is one field - number of parts to be removed. If user enters a value 5 in this field, then a blank table should be created, which should have 5 rows and 3 columns. The number of columns is fixed, while num of rows is dynamic. User will enter the required data into this table.
Kindly guide me how this can be done.
Regards
Meenakshi
2016 Mar 09 7:50 AM
Hi Raina,
i guess you are working with your subscreen.
Simply design your table like a common module pool.
In PBO, if your field is initial, set INVISIBLE = 1 and OUTPUT = 0 when looping screen for the table element, else, set Invisible = 0 and Output = 1 (input = 0 or 1 depending the transaction).
In PAI, if your field <> 0, check your internal table (the one to be shown) lines and add the missing one. (i.e. field = 5, your internal table got 3 lines, add 2 empyt lines).
that's all
2016 Mar 09 7:50 AM
Hi Raina,
i guess you are working with your subscreen.
Simply design your table like a common module pool.
In PBO, if your field is initial, set INVISIBLE = 1 and OUTPUT = 0 when looping screen for the table element, else, set Invisible = 0 and Output = 1 (input = 0 or 1 depending the transaction).
In PAI, if your field <> 0, check your internal table (the one to be shown) lines and add the missing one. (i.e. field = 5, your internal table got 3 lines, add 2 empyt lines).
that's all
2016 Mar 09 8:25 AM
In addition to Simone's reply, which is correct, use the Table Control wizard to insert your table control and then delete the 'Add Row' and 'Delete Row' buttons from the screen. This will insert all the correct PBO/PAI code for handling a table control.
And then, as Simone says. That's All.
2016 Mar 09 8:59 AM
Hi Simone,
Thanks for your reply. In my case, the user will enter the some entries in the empty table. so, i guess internal table would not be used here.
As my empty table will have 3 columns and multiple rows, so should I create a DDIC structure to store the values entered by the user ?
Regards
meenakshi
2016 Mar 09 9:01 AM
If user fill the table, you need the internal table.
I see no other way to do this.
Surely, if you want to save data put on DB, you have to create a DDIC Table with keys:
MANDT
VBELN
POSNR (if data are at item level)
COUNTER
and then the 3 fields you need.
2016 Mar 09 9:44 AM
Simone Milesi wrote:
Surely, if you want to save data put on DB, you have to create a DDIC Table with keys:
Now why would she want to do this ???
Of course, you could use a sledgehammer and use an editable alv grid.....
Rich
2016 Mar 10 6:45 AM
Hi Richard/Simone,
i used a table control with wizard option as suggested. But I am getting a strange error while activating the screen. Any idea why this error would come ?
2016 Mar 10 7:47 AM
Hi Raina,
1st error, check how did you defined P_OK and how did you declared FCODE; if you declared with differente types, you get the error!
2nd error, without knowing what ZTABLE_DETAILS is and how it's declared, it's pretty hard to understand
2016 Mar 10 8:03 AM
Hi Simone,
I have not declared any of this code. This was generated along with table control wizard.
Regards
Meenkshi
2016 Mar 10 8:28 AM
You seem to have got something mixed up somewhere. Are you using G_ZSPARE_LINES or ZSPARE_LINES for the TC structure ?
Rich
2016 Mar 10 9:19 AM
G_ZSPARE_LINES was generated as table control wizard code.
In the element list, FCODE is defined as below.
2016 Mar 10 12:56 PM
The Table control wizard generally works directly out of the box. Have you manually changed any code apart from deleting the buttons I have mentioned ?
Rich