Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

insert empty table on module pool screen

Former Member
0 Likes
2,738

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

1 ACCEPTED SOLUTION
Read only

SimoneMilesi
Active Contributor
0 Likes
2,322

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

11 REPLIES 11
Read only

SimoneMilesi
Active Contributor
0 Likes
2,323

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

Read only

0 Likes
2,322

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.

Read only

0 Likes
2,322

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

Read only

0 Likes
2,322

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.

Read only

0 Likes
2,322

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

Read only

Former Member
0 Likes
2,322

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 ?

Read only

0 Likes
2,322

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

Read only

0 Likes
2,322

Hi Simone,

I have not declared any of this code. This was generated along with table control wizard.

Regards

Meenkshi

Read only

0 Likes
2,322

You seem to have got something mixed up somewhere.  Are you using G_ZSPARE_LINES or ZSPARE_LINES for the TC structure ?

Rich

Read only

0 Likes
2,322

G_ZSPARE_LINES  was generated as table control wizard code.


In the element list, FCODE is defined as below.


Read only

0 Likes
2,322

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