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

Make Input the Row (Line) in Table Control

Former Member
0 Likes
1,594

Hi,

i want to make input a row (line) in table control when a pushbutton click. I maked input a column in table control with loop at screen but i want to make input a row dinamically. Can somebody help me please ?.

thanks.

Hi,

i want to make input a row (line) in table control when a pushbutton click. I maked input a column in table control with loop at screen but i want to make input a row dinamically. Can somebody help me please ?.

thanks.

7 REPLIES 7
Read only

Former Member
0 Likes
1,071

Hi,

In case of giving the input to row in a table control,

1. first capture it in PBO

Data: get_entry_lines LIKE sy-loopc.

PBO

Loop at <itab>

with control <table control name>

cursor <table control name>-current_line.

Module <any name ex: get_lines>

u2026u2026u2026u2026u2026u2026..

u2026u2026u2026u2026u2026u2026u2026u2026

Endloop.

Module <get_lines>

Get_entry_lines sy-loopc

Endmodule.

2. Then change the internal table, which uses the structure of the table control with the given input

PAI

          • Give this code in the push button, whose click event enables u to give a row input to the table control.

MODIFY <itab>

INDEX <table control name>-current_line.

Try the above logic.

Reward if helpful.

Sharin.

Read only

Former Member
0 Likes
1,071

you can use the GET CURSOR LINE lin.

lin of type i. you will get the row number , use that and code accordingly.

Read only

Former Member
0 Likes
1,071

thanks Sharin,

but,

<PBO>

Loop at it_finf

with control FAMILY_TABLEC

cursor FAMILY_TABLEC-current_line.

Module get_lines.

ENDLOOP.

a syntax error that " "LOOP" cannot be assigned to any field. " is returned here.

and at PAI , you wrote "Give this code ....." it doesn't seem.

thanks again.

Read only

christine_evans
Active Contributor
0 Likes
1,071

You can do something like the following in the PAI USER_COMMAND module to copy an existing table control line (which may or may not be what you want to do). GT_SPLITS is the internal table that underlies the table control. SELECT is the table control column that I told the table control wizard I wanted to use to record a selected line.

CLEAR gs_splits.
   READ TABLE gt_splits INTO gs_splits
   WITH KEY select = 'X'.
   IF sy-subrc <> 0.
      MESSAGE 'Please select a line to copy.' TYPE 'I'.
   ELSE.
      CLEAR: gs_splits-spltbuzei, gs_splits-select.
      APPEND gs_splits TO gt_splits.
   ENDIF.

Read only

Former Member
0 Likes
1,071

thanks Christine, i m trying to add new row with input (enabled) to table control.

Read only

0 Likes
1,071

> i m trying to add new row with input (enabled) to table control.

That is something that you get for free if you use the table control wizard; it generates the code and the button for you. I don't use it in my current screen since I prefer to have a complete screen of open lines available, which you can do by changing the setting of the table control LINES parameter.

If you don't want to use the wizard to create the table control in your current program (thought I don't see why anyone would not want to use it), you could always use it to create a table control in a test program and copy the insert new line code from that.

Read only

Former Member
0 Likes
1,071

thanks to everybody ,

MODULE FAMILY_TC_CHANGE_FIELD_ATTR OUTPUT.

CLEAR xfinf.

APPEND xfinf TO it_finf.

CLEAR it_finf.

data index like sy-STEPL.

index = FAMILY_TABLEC-lines.

CASE sy-ucomm.

when 'ADDROW_F'.

LOOP AT SCREEN.

if screen-name = 'IT_FINF-PERSNUM' and index = sy-STEPL .

screen-input = '1'.

endif.

modify screen.

endloop.

WHEN 'DELROW_F'.

ENDCASE.

ENDMODULE. " FAMILY_TC_CHANGE_FIELD_ATTR OUTPUT

it's my problem's solution.

hope to see you when a problem borned .