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

Need Help In Table Control while scrolling........

Former Member
0 Likes
1,251

Hi All,

i have a problem in table control.

when i scroll down or up data is not updating....

like....

i have a 10 lines....

first it displays 1-6 lines...

when i scroll down once ...

it should display 2-7th line as so on....

i think u understand my prob...

can anybody send me the sample code.....

1 ACCEPTED SOLUTION
Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
1,071

hi ,

Just go through this standard program. Hope it helps you

RSDEMO02

Thanks & Regards

10 REPLIES 10
Read only

Former Member
0 Likes
1,071

Hi Ranjith,

i think you are directly appending the lines to the interanl table.

in PAI

loop at itab.

    • a module to pass the data from screen to program

module modify_tc.

endloop.

module modify_tc.

describe table itab lines tc-lines.

if tc-current_line > tc-lines.

append itab.

else.

modify itab.

endif.

endmodule.

regards

Ramchander Rao.K

Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
1,072

hi ,

Just go through this standard program. Hope it helps you

RSDEMO02

Thanks & Regards

Read only

Former Member
0 Likes
1,071

Hi Ranjith,

when u append data in itab in pbo.

Use syntax after inserting data into itab.

DESCRIBE TABLE itabname LINES table_control_name-lines._

regards

Nishit Jjoshi

Read only

Former Member
0 Likes
1,071

In PBO before Loop and End loop

Module Scroll.

In module write code:

DESCRIBE TABLE ITAB LINES TC-LINES.

"where ITAB is table being displayed in Table control named TC

Read only

Former Member
0 Likes
1,071

Use mentioned code in PBO

tabdata ->table control name

tabcounter is the integer variable.

it_det is the internal table name

TABDATA-CURRENT_LINE = 1.

DESCRIBE TABLE IT_DET LINES TABCOUNTER.

IF TABCOUNTER = 0.

TABDATA-LINES = 100.

ELSE.

TABDATA-LINES = TABCOUNTER + 18.

ENDIF.

Read only

Former Member
0 Likes
1,071

Hi,

try this code in your module pool..

Select PBO module status & click on that.

Just you write a code after normal code as:

tablecontrolname-LINES = SY-DBCNT.(this will enable the table control vertical scroll bar.)

Normal code before above statement is(for eg.),

MOVE WA-EBELN TO EKKO-EBELN.

MOVE WA-AEDAT TO EKKO-AEDAT.

Regards,

BBR.

Read only

Former Member
0 Likes
1,071

Hi,

Just look into the Tcode 'abapdocu' -> ABAP USER DIALOGS-> SCREENS-> COMPLEX SCREEN ELEMENTS-> TABLE CONTROL WITH SCROLLING

Follow the above path, there you find the code for table control scrolling

Read only

Former Member
0 Likes
1,071

Hi ,

Do the following things in your PBO and PAI evet of screen .

PROCESS BEFORE OUTPUT.

  • module call_screen .

Module LINES .

LOOP AT IT_CIVIL WITH CONTROL TCvLAB CURSOR

TCvLAB-CURRENT_LINE .

ENDLOOP .

PROCESS AFTER INPUT.

chain .

field IT_CIVIL-CIVILIND .

field IT_CIVIL-NAME_TEXT1 .

field IT_CIVIL-SUBCONT1 .

field IT_CIVIL-NAME_TEXT2 .

field IT_CIVIL-SUNCONT2 .

module modify_civil_DATA .

endchain .

*****************************************************

modules :

IN PBO

MODULE LINE OUTPUT .

DESCRIBE IT_CIVIL LINES LIN .

TCvLAB-LINES = LIN .

ENDMODULE .

IN PAI :

MODULE MODIFY_CIVIL_DATA INPUT.

clear : wa_civ .

move-corresponding it_civil to wa_civ .

read table it_civil index 1 .

if sy-subrc = 0 .

modify it_civil index 1 from wa_civ .

else .

append it_civil .

clear : it_civil .

endif .

******************************

YOUR PROB WILL SOLVED .

PLEASE REWARDS IF SATISFIED .

REGARD'S

NILESH JAIN

Read only

Former Member
0 Likes
1,071

Find the no of lines in your internal table using DESCRIBE TABLE itab LINES gv_lines.

Then in PBO, write

tc-lines = gv_lines.

where tc is your table control.

regards,

Jinson

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,071

Hi,

Use this code, its working:-

Take the names of the input/output fields as work_area-field_name.

What you need to do exactly is read the values from internal table into table control in PBO of the screen after modifying them in PAI.

At Screen Logic:-


PROCESS BEFORE OUTPUT.
  MODULE status_8002. "for pf-status
 
  LOOP WITH CONTROL po_tab. "po_tab is name of table control
    MODULE pass_data. "to pass data into table control from internal table
  ENDLOOP.
 
PROCESS AFTER INPUT.
  MODULE user_command_8002. "to handle other user commands (back and exit)
 
  LOOP WITH CONTROL po_tab. "po_tab is name of table control
    MODULE modify_data. "to modify data from table control into internal table
  ENDLOOP.

In PBO,


*&---------------------------------------------------------------------*
*&      Module  PASS_DATA  OUTPUT
*&---------------------------------------------------------------------*
MODULE pass_data OUTPUT.
  READ TABLE it_ekpo into wa_ekpo INDEX po_tab-current_line.
  " read data from internal table into table control
  DATA : line_count TYPE i.
  
  DESCRIBE TABLE it_ekpo
  LINES line_count. "count number of records in internal table
 
  po_tab-lines = line_count + 5.
  " take 5 more lines than the number of records in internal table
ENDMODULE.                 " PASS_DATA  OUTPUT
"it_ekpo is internal table and wa_ekpo is the work area

In PAI,


*&---------------------------------------------------------------------*
*&      Module  MODIFY_DATA  INPUT
*&---------------------------------------------------------------------*
MODULE MODIFY_DATA INPUT.
  MODIFY IT_EKPO INDEX PO_TAB-CURRENT_LINE FROM WA_EKPO.
  "modify records from table control into the internal table
ENDMODULE.                 " MODIFY_DATA  INPUT

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir.