2009 Jul 17 10:25 AM
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.
2009 Jul 17 10:59 AM
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
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.
2009 Jul 17 10:50 AM
Just check the Process (Data) module inside the Loop .
Kanagaraja L
2009 Jul 17 10:53 AM
2009 Jul 17 10:59 AM
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
2009 Jul 17 11:11 AM
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 OUTPUTMax
2009 Jul 17 12:48 PM
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
2009 Jul 17 12:57 PM
Hi
No, no syntax error, the problem is the sign for NOT EQUAL is hidden in this post, I don't know why.
Max
2009 Jul 17 1:04 PM
Max, You're right thats a problem of the SDN service in common.
2009 Jul 17 11:28 AM
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
2009 Jul 17 12:56 PM
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
2009 Jul 17 3:07 PM
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