Application Development 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: 

VERTICAL SCROLLING PROBLEM IN TABLE CONTROL FOR INPUT DATA

Former Member
0 Kudos

Hi abapers,

I have a trouble with my table control when i want to scroll down. My table control is for input data and when i fill the rows in my tc and then i scroll down, the data i filled is cleared. I have this in my PBO:


PROCESS BEFORE OUTPUT.
*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'TAB_CTRL_FICHA'
  MODULE TAB_CTRL_FICHA_CHANGE_TC_ATTR.
  
*&SPWIZARD: MODULE TAB_CTRL_FICHA_CHANGE_COL_ATTR.
  LOOP AT   I_FICHA
       WITH CONTROL TAB_CTRL_FICHA
       CURSOR TAB_CTRL_FICHA-CURRENT_LINE.
*&SPWIZARD:   MODULE TAB_CTRL_FICHA_CHANGE_FIELD_ATTR
  MODULE G_CTRL_FICHA_GET_LINES.
  ENDLOOP.

MODULE G_CTRL_FICHA_GET_LINES OUTPUT.
"G_TCTRL_LINES = SY-LOOPC.
 TAB_CTRL_FICHA-LINES = 90.
TAB_CTRL_FICHA-V_SCROLL = 'X'.
ENDMODULE.                 " G_CTRL_FICHA_GET_LINES  OUTPUT

Also this happen when i change of tab. How can i mantain the data in my table control when i scroll down or navigate on the tabs?

Regards

Danyel Ramírez..

Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 11:01 AM

Edited by: Danyel Ramírez on Jan 8, 2009 5:04 PM

5 REPLIES 5

Former Member
0 Kudos

your table control is for input data

and when u fill the rows in tc and scroll down

pai is called

save the data in PAI and not in PBO

former_member953603
Participant
0 Kudos

Hi,

try this code during code:

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.

Former Member
0 Kudos

Follow the below the code snippet... table_control is the name of the TableControl

module STATUS_1000 output.

SET PF-STATUS 'BEN_MENU'.

  • SET TITLEBAR 'xxx'.

DATA: lin type i.

PERFORM AUTO_EMPID.

DESCRIBE TABLE it_all LINES lin.

table_control-lines = lin.

endmodule. " STATUS_1000 OUTPUT

Former Member
0 Kudos

hi,

Try include this code in PAI

loop at itab.

module modify_tab

endloop

in program

module modify_tab

describe table itab lines tc-liens

if tc-current_line > tc-lines

append itab

else

modify itab index tc-current_line

endmodule

I355602
Advisor
Advisor
0 Kudos

Hi Danyel,

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.