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 - vertical Scroller

Former Member
0 Likes
766

Hi all,

I am enable to activate the vertical scroller in the table control for the module pool please provide the solution with explanation.

regards,

Vishal.

1 ACCEPTED SOLUTION
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
738

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
  " in order to make table control scrollable
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.

6 REPLIES 6
Read only

Former Member
0 Likes
738

Hi,

Select PBO module status & click on that.

Just you write a code after normal code as:

VCONTROL-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
738

Write the below code in the PBO module before the table control loop.. endloop statement.

DESCRIBE TABLE <internal_table_name> LINES tablecontrolname-lines. "<internal_table_name> is the name of the internal table used for the table control

Read only

Former Member
0 Likes
738

Hi,

write the following code in the PBO event.

data: line type i.

describe tables itab lines line.

tc-lines = line.

where tc is the table control name.

if records exceeds the physial space in table control, then only vertical control bar will be displayed.

regards,

John

Read only

Former Member
0 Likes
738

HI.

Have you created TC by not wizard? If yes ,go to layout of TC and click the check box of vertical separator.

REgards.

jay

Read only

Former Member
0 Likes
738

Hi,

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

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
739

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
  " in order to make table control scrollable
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.