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 values not getting modified and values are getting vanished

Former Member
0 Likes
1,488

In the Screen, i have put a Table control and fields are from workarea wa_item

PBO

-


LOOP AT it_item INTO wa_item WITH CONTROL tc CURSOR tc-current_line.

ENDLOOP.

PAI

-


LOOP at it_item.

module modify_it.

ENDLOOP.

MODULE it_modify INPUT.

MODIFY it_item FROM wa_item INDEX tc-current_line.

The above modify statement is failing with a sy-subrc of 4.

wa_item holds the value what we have entered in the table control first line and tc-current_line value is 1.

But it is not modifying the internal table and thus value is not getting displayed in the sceen(Table control) after pai & Pbo.

Pls Help.....

Regards

Sajid

1 ACCEPTED SOLUTION
Read only

Former Member

In the Screen, i have put a Table control and fields are from workarea wa_item

PBO

-


LOOP AT it_item INTO wa_item WITH CONTROL tc CURSOR tc-current_line.

ENDLOOP.

PAI

-


LOOP at it_item.

module modify_it.

ENDLOOP.

MODULE it_modify INPUT.

MODIFY it_item FROM wa_item INDEX tc-current_line.

The above modify statement is failing with a sy-subrc of 4.

wa_item holds the value what we have entered in the table control first line and tc-current_line value is 1.

But it is not modifying the internal table and thus value is not getting displayed in the sceen(Table control) after pai & Pbo.

Pls Help.....

Regards

Sajid

3 REPLIES 3
Read only

Former Member
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
934

Hi Shaik,

Use this code, its working:-

At screen logic


PROCESS BEFORE OUTPUT.
*  MODULE status_8002.

  LOOP WITH CONTROL po_tab. "table control name
    MODULE pass_data.
  ENDLOOP.

PROCESS AFTER INPUT.
*  MODULE user_command_8002.

  LOOP WITH CONTROL po_tab. "table control name
    MODULE modify_data.
  ENDLOOP.

In PBO


MODULE pass_data OUTPUT.
  READ TABLE it_item into wa_item INDEX po_tab-current_line.
ENDMODULE.                 " PASS_DATA  OUTPUT

In PAI


MODULE modify_data INPUT.
  MODIFY it_item INDEX po_tab-current_line FROM wa_item.
ENDMODULE.                 " MODIFY_DATA  INPUT

Hope this solves your problem.

Thanks & Regards,

Tarun Gambhir

Read only

Former Member
0 Likes
934

Hi,

Are you using any SELECT query or filling data into internal table it_itembefore LOOP..ENDLOOP in PBO.

If yes, then the modifications done on internal table it_item in PAI are overwritten in PBO and TC comes blank.

PBO

-


LOOP AT it_item INTO wa_item WITH CONTROL tc CURSOR tc-current_line.

ENDLOOP.

Otherwise ur code seems to be all right.