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

Table Control Wizard - Problem: Edition of missing lines allowed

Former Member
0 Likes
1,469

Hello,

i have a a strange behaviour, i am working with an generated Table Control.

The Wizard is getting the infos: work with INTERNAL Table "itab_1", use working area "wa_1".

After generation the table control is shown up correctly.

But - if the interal table is empty at all - all lines are white - waiting for entry.

if there is at least one line - these non-empty-lines are showing up white - all the others are greyed out, which is correct.

For the lines which are added with the plus sign - everything is ok.

The problem is, if the internal table is empty and all rows are white, any manual user entry going into these is lost after pressing return.

Help is appreciated. thank you

Hartmut

types: begin of typ_1,

selected type c,

counter type i,

wert type char30,

end of typ_1.

data: itab_1 type table of typ_1.

data wa_1 like line of itab_1.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,309

Hi

Try to check how the field LINES of the table control is updated (if it's updated);

Try to check how the code of LOOP/ENDLOOP is managed in PBO and PAI process: the table control can be different behaviour.

Try to check how the parameter of LOOP AT SCREEN are managed into LOOP/ENDLOOP of PBO

Try to check if there is a module to update the internal tabel with data from table control into LOOP/ENDLOOP of PAI.

We need the code of the process above to understand your problem.

Max

10 REPLIES 10
Read only

Kanagaraja_L
Active Contributor
0 Likes
1,309

Just check the Process (Data) module inside the Loop .

Kanagaraja L

Read only

0 Likes
1,309

Kanagaraja you are kidding

Read only

Former Member
0 Likes
1,310

Hi

Try to check how the field LINES of the table control is updated (if it's updated);

Try to check how the code of LOOP/ENDLOOP is managed in PBO and PAI process: the table control can be different behaviour.

Try to check how the parameter of LOOP AT SCREEN are managed into LOOP/ENDLOOP of PBO

Try to check if there is a module to update the internal tabel with data from table control into LOOP/ENDLOOP of PAI.

We need the code of the process above to understand your problem.

Max

Read only

0 Likes
1,309

Hi

Flow logic of PBO should be like this:

LOOP AT   ITAB
       INTO WA
       WITH CONTROL T_CTRL
       CURSOR T_CTRL-CURRENT_LINE.
    MODULE T_CTRL_GET_LINES.
*MODULE T_CTRL_CHANGE_FIELD_ATTR.
  ENDLOOP.

So create a module T_CTRL_CHANGE_FIELD_ATTR in order to change the screen attribute:

LOOP AT   ITAB
       INTO WA
       WITH CONTROL T_CTRL
       CURSOR T_CTRL-CURRENT_LINE.
    MODULE T_CTRL_GET_LINES.
   MODULE T_CTRL_CHANGE_FIELD_ATTR.
  ENDLOOP.

MODULE T_CTRL_CHANGE_FIELD_ATTR OUTPUT.
  READ TABLE ITAB INDEX T_CTRL-CURRENT_LINE
    TRANSPORTING NO FIELDS.
  CHECK SY-SUBRC <> 0.
  LOOP AT SCREEN.
    SCREEN-INPUT = 0.
    MODIFY SCREEN.
  ENDLOOP.
ENDMODULE.                 " T_CTRL_CHANGE_FIELD_ATTR  OUTPUT

Max

Read only

0 Likes
1,309

Max, your solution works well, thank you

there is a small syntax problem

the line

CHECK SY-SUBRC 0.

should read

CHECK SY-SUBRC NE 0.

Best regards

Read only

0 Likes
1,309

Hi

No, no syntax error, the problem is the sign for NOT EQUAL is hidden in this post, I don't know why.

Max

Read only

0 Likes
1,309

Max, You're right thats a problem of the SDN service in common.

Read only

Former Member
0 Likes
1,309

Hi Harmut,

After generation the table control is shown up correctly.

But - if the interal table is empty at all - all lines are white - waiting for entry.//

The Number of Lines of a Table Control here obviously depends on the number of lines of ITAB right. So if ITAB is empty make ur Table Control too empty, i mean there should be no lines initially displayed (so as to be ready to input).

This statement in PBO should do it:

Describe table ITAB lines TABLE_CONTROL-LINES.

Now, when you say Insert or + as u have mentioned, Insert a new empty record that waits for the Entry.

As you need to save this entry, you need to have a MARK or FLAG field in your ITAB and Set this field as w/Selection of the Table Control.

Just select this row, read this entry using the MARK field and Modify your ITAB. That should do it.

READ table ITAB into WA with key mark = 'X'.

MODIFY ITAB from WA index TABLE_CONTROL-CURRENT_LINE .

Write the above code in PAI (When you click on SAVE).

Best Regards,

rama

Edited by: newtoAbap on Jul 17, 2009 12:29 PM

Read only

0 Likes
1,309

Rama,

> i mean there should be no lines initially displayed (so as to be ready to input).

they sould be greyed out

>This statement in PBO should do it:

>Describe table ITAB lines TABLE_CONTROL-LINES.

yes, i agree. This is done by default in generated table controls

> Now, when you say Insert or + as u have mentioned, Insert a new empty record that waits for the Entry.

> As you need to save this entry, you need to have a MARK or FLAG field in your ITAB

Unfortunatelly no, the mark flag is not needed for keeping the entries in the internal table.

I did not had problems on saving to database, the problem occured "in memory" yet.

Perhaps my problem was described a bit unprecise... sorry for that

Thank you,

Best Regards

Read only

0 Likes
1,309

May be i understood your problem in a different way:) At the end of the day, your problem has been solved which is what required.

Thanks MAX for the Solution. I will copy the code, it will help me in the future in case i face the same problem:D

Best Regards,

rama