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

Insert Lines into Table Control

Former Member
0 Likes
556

Here is my issue...

My dialog program output has 6 fields. Out of these 6 fields 4 fields are in display mode and last two fields are in change mode. I have two push buttons ADD ENTRY and SAVE. When I execute the report, I pull around 5 records from the database table and show that to user.

When the user cliacks ADD... it shld have a new entry with all the values to be in CHANGE MODE..

I tried this with the following code in PAI

if ok_code = 'ADD'.

clear gw_itab.

append gw_itab to gt_itab.

endif.

It adds new line but it remains in display mode only . Can anyone help in this regard.

Thanks in advance,

Mohan.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
521

Hi,

try like this..

in PBO..

if ok_code eq 'ADD'.
 loop at screen.
if screen-group1 = 'GRP'.
  screen-input = 1.
modify screen.
endif.
 endloop.
endif.

assign group for all the fields as GRP.

3 REPLIES 3
Read only

Former Member
0 Likes
521

Hi,

Do like this...


CONTROLS: tab1 TYPE TABLEVIEW USING SCREEN 9003.


if ok_code = 'ADD'.
clear gw_itab.
append gw_itab to gt_itab.

LOOP AT tab1-cols INTO wa_col.

          wa_col-screen-input = 1.
          MODIFY tab1-cols FROM wa_col.
        ENDLOOP.
endif.

Regards

Debarshi

Read only

Former Member
0 Likes
522

Hi,

try like this..

in PBO..

if ok_code eq 'ADD'.
 loop at screen.
if screen-group1 = 'GRP'.
  screen-input = 1.
modify screen.
endif.
 endloop.
endif.

assign group for all the fields as GRP.

Read only

Former Member
0 Likes
521

PROCESS BEFORE OUTPUT.

..............

LOOP AT GT_ITAB WITH CONTROL TCL CURSOR TCL-lines.

MODULE populate_screen.

ENDLOOP.

PROCESS AFTER INPUT.

.............

LOOP AT GT_ITAB .

MODULE EXTRACT_USERDATA.

ENDLOOP.

PROGRAM

TYPES: BEGIN OF TP_ITAB,

SELECTION,

F1(30),

F2(20),

F3(50),

F4 TYPE I,

F5 TYPE I,

F6(10),

END OF TP_ITAB.

DATA: GT_ITAB TYPE TABLE OF TP_ITAB WITH HEADER LINE.

DATA: LD_LINE TYPE I,

IND TYPE I.

DATA : FLAG,

FLAG1.

MODULE POPULATE_SCREEN OUTPUT.

IF LD_LINE EQ TCL-CURRENT_LINE .

CASE OK_CODE.

WHEN 'ADD'.

LOOP AT SCREEN.

IF FLAG EQ 'X'.

IF SCREEN-NAME EQ 'GT_ITAB-F1' OR

SCREEN-NAME EQ 'GT_ITAB-F2' OR

SCREEN-NAME EQ 'GT_ITAB-F3' OR

SCREEN-NAME EQ 'GT_ITAB-F4' OR

SCREEN-NAME EQ 'GT_ITAB-F5' OR

SCREEN-NAME EQ 'GT_ITAB-F6' .

SCREEN-INPUT = 1.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

CLEAR FLAG.

FLAG1 = ' '.

ENDCASE.

IF OK_CODE EQ ' ' AND FLAG1 NE 'X'.

LOOP AT SCREEN.

IF SCREEN-NAME EQ 'GT_ITAB-F1' OR

SCREEN-NAME EQ 'GT_ITAB-F2' OR

SCREEN-NAME EQ 'GT_ITAB-F3' OR

SCREEN-NAME EQ 'GT_ITAB-F4' OR

SCREEN-NAME EQ 'GT_ITAB-F5' OR

SCREEN-NAME EQ 'GT_ITAB-F6' .

SCREEN-INPUT = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

ENDIF.

ENDMODULE. " populate_screen OUTPUT

MODULE EXTRACT_USERDATA INPUT.

CASE OK_CODE.

WHEN 'ADD'.

IF GT_ITAB-SELECTION EQ 'X' .

IND = TCL-CURRENT_LINE + 1.

INSERT INITIAL LINE INTO GT_ITAB INDEX IND.

FLAG = 'X'.

LD_LINE = IND.

ENDIF.

ENDCASE.

ENDMODULE. " EXTRACT_USERDATA INPUT

Edited by: sreekanth reddy on Nov 4, 2008 2:41 PM