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: 

table control problem

Former Member
0 Kudos
132

hi!

i built a table control. the first time the table appears on the screen after the PBO, the table is empty.

using copy and paste from excel i enter data into the table and press enter.

when i am scrolling down in order to add more lines,

the lines are grey . even if i use in the PBO change_col_attribute to screen-input = 1 it is still grey

only the first 22 lines that appears on the screen are ready for input.

do you have any idea what might be the problem?

thanks yifat

5 REPLIES 5

naimesh_patel
Active Contributor
0 Kudos
85

Hello,

You can set the display lines by

TABLE1-LINES = 1000. (to see 1000 lines in table control)

Regards,

Naimesh

PS: Reward points, if it is useful..!

Former Member
0 Kudos
85

hi!

if i understood right the table1-lines is the tablecontrol.

i set the table control to 1000 line in the pbo, but it still doesnt work, do you have any idea?

regards

yifat

0 Kudos
85

Hello,

Can you paste your code here ? So, can have a look at it. because for me table1-lines is working..

Regards,

Naimesh

Former Member
0 Kudos
85

hi!

thanks for your help.

i am sending you the code

PROCESS BEFORE OUTPUT.

  • PBO FLOW LOGIC FOR TABLECONTROL 'ZBOX1_300'

MODULE STATUS_0300.

MODULE INIT_SCREEN_300.

MODULE ZBOX1_300_CHANGE_FIELD_ATTR.

LOOP AT SCREEN_ITAB_LIPS

WITH CONTROL ZBOX1_300

CURSOR ZBOX1_300-CURRENT_LINE.

MODULE ZBOX1_300_GET_LINES.

ENDLOOP.

*

PROCESS AFTER INPUT.

MODULE CANCEL AT EXIT-COMMAND.

  • PAI FLOW LOGIC FOR TABLECONTROL 'ZBOX1_300'

LOOP AT SCREEN_ITAB_LIPS.

CHAIN.

FIELD SCREEN_ITAB_LIPS-ZLINE.

FIELD SCREEN_ITAB_LIPS-ZPOSNR.

FIELD SCREEN_ITAB_LIPS-ZMATNR.

FIELD SCREEN_ITAB_LIPS-ZLFIMG.

FIELD SCREEN_ITAB_LIPS-ZSERNR.

FIELD SCREEN_ITAB_LIPS-ZARKTX.

FIELD SCREEN_ITAB_LIPS-ZVBELN.

FIELD SCREEN_ITAB_LIPS-ZBSTKD.

FIELD SCREEN_ITAB_LIPS-ZPOSEX.

FIELD SCREEN_ITAB_LIPS-ZKDMAT.

FIELD SCREEN_ITAB_LIPS-ZSPACE.

MODULE ZBOX1_300_MODIFY ON CHAIN-REQUEST.

ENDCHAIN.

ENDLOOP.

MODULE ZBOX1_300_USER_COMMAND.

MODULE USER_COMMAND_0300.

MODULE STATUS_0300 OUTPUT.

SET PF-STATUS 'ZBOX1_300_STAT'.

SET TITLEBAR 'TITLE_300'.

ENDMODULE. " STATUS_0300 OUTPUT

MODULE INIT_SCREEN_300 OUTPUT.

DATA: ZVBELN LIKE LIKP-VBELN,

ZBOX(3) TYPE C,

ZVBELN_TXT(10),

ZBOX_TXT(10) ,

ZPAGE(2) VALUE 1,

ZERO VALUE '0'.

SORT SCREEN_ITAB_LIPS BY ZPOSNR .

DELETE ADJACENT DUPLICATES FROM SCREEN_ITAB_LIPS.

SHIFT P_VBELN LEFT DELETING LEADING ZERO.

SHIFT P_BOX LEFT DELETING LEADING ZERO.

VBELN = P_VBELN.

BOX = P_BOX.

*LINE = 0.

ENDMODULE. " INIT_SCREEN_300 OUTPUT

MODULE ZBOX1_300_CHANGE_FIELD_ATTR OUTPUT.

*LOOP AT ZBOX1_300-COLS INTO COL.

  • COL-SCREEN-INPUT = 1.

  • MODIFY ZBOX1_300-COLS FROM COL.

*ENDLOOP.

DESCRIBE TABLE SCREEN_ITAB_LIPS LINES ZBOX1_300-LINES.

IF ZBOX1_300-lines <> 0.

LOOP AT ZBOX1_300-COLS INTO COL.

COL-SCREEN-input = '1'.

modify ZBOX1_300-COLS FROM COL.

ENDLOOP.

ENDIF.

ENDMODULE. " ZBOX1_300_CHANGE_FIELD_ATTR OUTPUT

MODULE ZBOX1_300_GET_LINES OUTPUT.

G_ZBOX1_300_LINES = SY-LOOPC.

ENDMODULE.

MODULE CANCEL INPUT.

CASE OK_CODE.

when 'CANCEL' OR 'EXIT'.

LEAVE PROGRAM.

ENDCASE.

ENDMODULE. " CANCEL INPUT

MODULE ZBOX1_300_MODIFY INPUT.

INSERT SCREEN_ITAB_LIPS

INDEX ZBOX1_300-CURRENT_LINE.

ENDMODULE.

MODULE ZBOX1_300_USER_COMMAND INPUT.

OK_CODE = SY-UCOMM.

PERFORM USER_OK_TC USING 'ZBOX1_300'

'SCREEN_ITAB_LIPS'

' '

CHANGING OK_CODE.

ENDMODULE.

MODULE USER_COMMAND_0300 INPUT.

  • DATA: IX LIKE SY-TABIX.

data l_ok_code like sy-ucomm.

l_ok_code = ok_code.

clear ok_code.

case l_ok_code.

when 'BAK'.

LEAVE PROGRAM.

when 'SAV'.

SAVE = 1.

LINE = 0.

WHEN 'CLR' .

SCREEN_LINE = 0.

LINE = 0.

DEL = 1.

REFRESH SCREEN_ITAB_LIPS.

WHEN 'EXT' .

LEAVE PROGRAM.

WHEN 'PRN' .

  • PERFORM confirm_preview CHANGING ans.

  • IF ans = 'J'.

MY_ITCPO-TDNOPREV = 'X'.

MY_ITCPO-TDIMMED = 'X'.

PERFORM PRINT_LAYOUT .

LEAVE TO LIST-PROCESSING.

LINE = 0.

WHEN 'ENR'.

DESCRIBE TABLE SCREEN_ITAB_LIPS LINES LIN.

IF LIN < SCR_LIN.

LINE = 0.

ELSE.

PAGE = PAGE + 1.

ENDIF.

WHEN 'NXT' .

IX = PAGE * SCR_LIN.

DO SCR_LIN TIMES.

IX = IX + 1 .

READ TABLE DB_LIPS INTO ITAB_LIPS INDEX IX.

IF SY-SUBRC = 4.

MESSAGE ID 'YBS' TYPE 'I' NUMBER '013' .

EXIT.

ENDIF.

APPEND ITAB_LIPS.

ENDDO.

WHEN 'PRV' .

NXT = 0.

IF PAGE = 1.

MESSAGE ID 'YBS' TYPE 'I' NUMBER '015' .

ELSE.

PAGE = PAGE - 2.

IX = PAGE * SCR_LIN.

DO SCR_LIN TIMES.

IX = IX + 1.

READ TABLE DB_LIPS INTO ITAB_LIPS INDEX IX.

APPEND ITAB_LIPS.

ENDDO.

PAGE = PAGE + 1.

ENDIF.

WHEN 'OTH'.

PERFORM OTHER_DELIVERY.

SAVE = 0.

  • WHEN 'P--'.

  • ZBOX1_300-TOP_LINE = 1.

  • WHEN 'P-'.

  • ZBOX1_300-TOP_LINE = ZBOX1_300-TOP_LINE - G_ZBOX1_300_LINES.

  • IF ZBOX1_300-TOP_LINE < 1.

  • ZBOX1_300-TOP_LINE = 1.

  • ENDIF.

  • WHEN 'P+'.

  • ZBOX1_300-TOP_LINE = ZBOX1_300-TOP_LINE + G_ZBOX1_300_LINES.

  • IF ZBOX1_300-TOP_LINE > ZBOX1_300-LINES.

  • ZBOX1_300-TOP_LINE = ZBOX1_300-LINES - G_ZBOX1_300_LINES + 1.

  • ENDIF.

  • WHEN 'P++'.

  • ZBOX1_300-TOP_LINE = ZBOX1_300-LINES - G_ZBOX1_300_LINES + 1.

ENDCASE.

ENDMODULE. " USER_COMMAND_0300 INPUT

thanks yifat

0 Kudos
85

Dear Yifat,

I am not able to see ZBOX1_300-lines = 1000 or what ever value in your code. Put like

ZBOX1_300-lines = 1000. in ZBOX1_300_CHANGE_FIELD_ATTR after

DESCRIBE TABLE SCREEN_ITAB_LIPS LINES ZBOX1_300-LINES.

IF ZBOX1_300-lines <> 0.

LOOP AT ZBOX1_300-COLS INTO COL.

COL-SCREEN-input = '1'.

modify ZBOX1_300-COLS FROM COL.

ENDLOOP.

ENDIF.

Regards,

Naimesh

Reward Points, if you fine useful..!