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 Problem

Former Member
0 Likes
406

Hi All,

In the Table Control PAI,I am using this ABAP.

loop at t_zmm_packing_item.

MODULE modify_t_zmm_packing_item.

ENDLOOP.

************************************************************************

MODULE modify_t_zmm_packing_item INPUT.

MODIFY t_zmm_packing_item INDEX tblctrl9002-current_line.

ENDMODULE. " modify_t_zmm_packing_item INPUT

But in PAI the internal tble is not getting populated,hence can not be modified.

Plz give your suggestions.

Thx in Advnce,

Rajarshi.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
375

Hi

What does "hence can not be modified" mean for you?

The statament MODIFY t_zmm_packing_item INDEX tblctrl9002-current_line can fail only if the record isn't in the internal table, so you can use the APPEND:

MODULE modify_t_zmm_packing_item INPUT.
    MODIFY t_zmm_packing_item INDEX tblctrl9002-current_line.
    IF SY-SUBRC <> 0.
      APPEND t_zmm_packing_item. 
    ENDIF.
ENDMODULE. " modify_t_zmm_packing_item INPUT

Max

2 REPLIES 2
Read only

Former Member
0 Likes
376

Hi

What does "hence can not be modified" mean for you?

The statament MODIFY t_zmm_packing_item INDEX tblctrl9002-current_line can fail only if the record isn't in the internal table, so you can use the APPEND:

MODULE modify_t_zmm_packing_item INPUT.
    MODIFY t_zmm_packing_item INDEX tblctrl9002-current_line.
    IF SY-SUBRC <> 0.
      APPEND t_zmm_packing_item. 
    ENDIF.
ENDMODULE. " modify_t_zmm_packing_item INPUT

Max

Read only

Former Member
0 Likes
375

See the following sample code:

PAI:

LOOP AT G_TC1_ITAB.

CHAIN.

FIELD ZFG_SRNO-ZSRNO.

MODULE TC1_MODIFY ON CHAIN-REQUEST.

ENDCHAIN.

ENDLOOP.

MODULE TC1_MODIFY INPUT.

MOVE-CORRESPONDING ZFG_SRNO TO G_TC1_WA.

MODIFY G_TC1_ITAB

FROM G_TC1_WA

INDEX TC1-CURRENT_LINE.

ENDMODULE.