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 : Module Pool

Former Member
0 Likes
945

Hi All,

I am facing one problem regarding Table Control.

The issue is I am filling data into table control but when I push enter or scroll the table control the data from the row 2 gets deleted.

I mean the first row data remains same but other data gets disappeared.

Any solution?

8 REPLIES 8
Read only

Former Member
0 Likes
922

first go to debugger and find why its deleting...

i faced da same problem..i done with following code

check it..once..

it will work..

PAI.

     LOOP AT IT.

        MODULE READ_DATA.

     ENDLOOP.

__________________________

MODULE READ_DATA.

  READ TABLE IT INDEX TABC-CURRENT_LINE TRANSPORTING NO FIELDS.

  IF SY-SUBRC = 0.  

    MODIFY IT

    FROM WA

    INDEX TABC-CURRENT_LINE .

  ELSE.

     APPEND WA TO IT.

  ENDIF.

ENDMODULE.

__________________________

Read only

0 Likes
922

Thank You Ravi.

PROCESS AFTER INPUT.

LOOP AT it_scheme.              "Scheme Detail Table

CHAIN.

FIELD it_scheme-advstar.

MODULE check_fiscal_year on CHAIN-INPUT.

FIELD it_scheme-perend.

MODULE check_fiscal_year_1 on CHAIN-INPUT.

MODULE check_compare_fy.

FIELD it_scheme-amount.

FIELD it_scheme-percent.

MODULE input1 ON CHAIN-REQUEST."For Adding Rows at runtime in the ITAB

ENDCHAIN.

*module fill_internal_table.

ENDLOOP.

  MODULE user_command_1001.


this is my code..


------------------------------------------------------------------------------------------

MODIFY it_scheme INDEX st_scheme-current_line.

APPEND it_scheme.

   LOOP AT it_scheme.

     it_work-advstar = it_scheme-advstar.

     it_work-perend  = it_scheme-perend.

     it_work-amount  = it_scheme-amount.

     it_work-percent = it_scheme-percent.

     APPEND it_work.

   ENDLOOP.

     REFRESH it_scheme.

*    CLEAR : it_scheme.

-----------------------------------------------------------------------------------------

Read only

0 Likes
922

hey yash...

check da before post once..

u change ur code..

PAI.

LOOP ..

-----

MODULE READ_DATA.

ENDLOOP.

--------------------------------------------------

MODULE READ.

READ TABLE it_scheme INDEX TABC-CURRENT_LINE TRANSPORTING NO FIELDS.

  IF SY-SUBRC = 0.  

    MODIFY it_scheme    INDEX TABC-CURRENT_LINE .

  ELSE.

     APPEND it_scheme.

  ENDIF.

ENDMODULE.

Read only

0 Likes
922

Hello Ravi.

Should I put this code between Chain .. Endchain?

Read only

0 Likes
922

Ravi,

I applied your logic. But it is not working.

Read only

Former Member
0 Likes
922

HI Yash,

Thats why you should fill table control in Process before output first if possible.

else as scroll is also an event it will restore the data, you are able to see the first record as may be work area is no getting cleared and is showing there.

CHeck in debugging.


Read only

0 Likes
922

Hello Ranjan,

Thank you for the reply.

I checked in debugging, I am getting the first record . I mean I have written the code for PBO aso.

But when the loop reaches to the second level it clears the value.

Read only

matt
Active Contributor
0 Likes
922

I guess you have the same homework question as