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

Lines in Table Control

Former Member
0 Likes
895

Hi friends,

I have created a form using Table Control with five lines.

Though the form is having 5 lines, I am able to enter the data only in the first line and the balance four lines are in grey color, where I am not able to enter anything.

Could you pls guide me how to correct this problem.

Thanks in advance.

Regards,

Mark K

1 ACCEPTED SOLUTION
Read only

dani_mn
Active Contributor
0 Likes
864

Hi,

Use DESCRIBE to append initial lines to table control.

first append empty lines to a internal table and then

use 'describe' to append them to table control.

here itab is the internal table used in table control and 'zbpsgtable' is a table control.

In a PBO module do this.

if itab[] is initial.

do 5 times.

append itab.

enddo.

endif.

describe table itab lines zbpsgtable-lines.

Regards,

Wasim Ahmed

Message was edited by: Wasim Ahmed

Hi friends,

I have created a form using Table Control with five lines.

Though the form is having 5 lines, I am able to enter the data only in the first line and the balance four lines are in grey color, where I am not able to enter anything.

Could you pls guide me how to correct this problem.

Thanks in advance.

Regards,

Mark K

7 REPLIES 7
Read only

dani_mn
Active Contributor
0 Likes
865

Hi,

Use DESCRIBE to append initial lines to table control.

first append empty lines to a internal table and then

use 'describe' to append them to table control.

here itab is the internal table used in table control and 'zbpsgtable' is a table control.

In a PBO module do this.

if itab[] is initial.

do 5 times.

append itab.

enddo.

endif.

describe table itab lines zbpsgtable-lines.

Regards,

Wasim Ahmed

Message was edited by: Wasim Ahmed

Read only

Former Member
0 Likes
864

Hi Wasim,

Thanks for your response.

I tried your code but not working. The code I have written is given below. Kindly check the same and guide me the solution.

In PBO :

module line_disp.

This is module pool.

*&----


**& Module line_disp OUTPUT

*&----


    • text

*----


*MODULE LINE_DISP OUTPUT.

  • IF G_ZTDR_LINES_ITAB[] IS INITIAL.

  • DO 5 TIMES.

  • APPEND G_ZTDR_LINES_ITAB.

  • ENDDO.

  • ENDIF.

*

  • describe table G_ZTDR_LINES_ITAB lines ZTDR_LINES-lines.

*

*

*ENDMODULE. " line_disp OUTPUT

-


Regards,

Read only

Former Member
0 Likes
864

*&----


**& Module line_disp OUTPUT

*&----


    • text

*----


MODULE LINE_DISP OUTPUT.
"is G_ZTDT_LINES_ITAB is blank....
 IF G_ZTDR_LINES_ITAB[] IS INITIAL.
 DO 5 TIMES.
 APPEND G_ZTDR_LINES_ITAB.
 ENDDO.
describe table G_ZTDR_LINES_ITAB lines ZTDR_LINES-lines.
<b>else.
describe table G_ZTDR_LINES_ITAB lines ZTDR_LINES-lines.
 ENDIF.</b>

ENDMODULE. " line_disp OUTPUT

Regards

vijay

Read only

Former Member
0 Likes
864

Hi Wasim,

It is not working. Could u pls look into this.

Regards,

Read only

dani_mn
Active Contributor
0 Likes
864

Hi,

Debug in the appending internal table and check if the lines are appending to the internal table or not.

The fields of the table control should be build from the internal table we are appending.

And also loop on the internal table in PBO and PAI in flow logic.

like.

IN PBO FLOW LOGIC.

loop at itab

with control zbpsgtable

cursor zbpsgtable-current_line.

module zbpsgtable_get_lines.

endloop.

*this is called module

module zbpsgtable_get_lines output.

g_zbpsgtable_lines = sy-loopc.

endmodule.

Regards,

Wasim Ahmed

Read only

Former Member
0 Likes
864

Hi Wasim,

Thanks for your help. It is working now.

Thank you once again.

Mark K

Read only

Former Member
0 Likes
864

Hai,

If you want to add a new record then increment the table control property line to 1. (EX : tbctrl-lines = current no of lines + 1 ).

Then enter your new record and append that record to the internal table.

You can also use Append initial line to internal table.

Regards,

Umasankar