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

How to modify internal table in table control

Former Member
0 Likes
1,006

Hi,

In the first image i have enter the no in the 4th row eg. 5 5 5 and then if we hit the enter it will add the value column and percentage values

and will populate in total column for the respective row...

In the second image if we remove the value in the 4th row and hit enter means the internal table does not modify.

the value is populating in the same column...It will display in the 3rd image......

My requirement is, if we enter the value in the respective row and hit enter means the calculation should be done.

if the user think the calculated row is no need like that the user should remove the value and hit enter means

the respective row should be empty.......I paste my code below the image.

Can u tell wheather i have made any mistake kindly help me.....

LOOP AT lt_scrn_output .
     CHAIN.
       FIELD:

              ls_scrn_output-te_mon_jan, ls_scrn_output-te_mon_feb,
              ls_scrn_output-te_mon_mar,ls_scrn_output-te_mon_apr,
              ls_scrn_output-te_mon_may,ls_scrn_output-te_mon_jun,
              ls_scrn_output-te_mon_jul,ls_scrn_output-te_mon_aug,
              ls_scrn_output-te_mon_sep,ls_scrn_output-te_mon_oct,
              ls_scrn_output-te_mon_nov,ls_scrn_output-te_mon_dec,
              ls_scrn_output-te_total_perc.
*    MODULE validate_basic.
       MODULE modify_detail ON CHAIN-INPUT.
     ENDCHAIN.

   ENDLOOP.


MODULE modify_detail INPUT.
*  clear ls_scrn_output-te_total_perc.

   ls_scrn_output-te_total_perc = ls_scrn_output-te_mon_jan + ls_scrn_output-te_mon_feb + ls_scrn_output-te_mon_mar +
                               ls_scrn_output-te_mon_apr + ls_scrn_output-te_mon_may + ls_scrn_output-te_mon_jun +
                               ls_scrn_output-te_mon_jul + ls_scrn_output-te_mon_aug + ls_scrn_output-te_mon_sep +
                               ls_scrn_output-te_mon_oct + ls_scrn_output-te_mon_nov + ls_scrn_output-te_mon_dec + ls_scrn_vpg1stpay-zzperc.

   IF ls_scrn_output-te_total_perc <> 100 AND ls_scrn_output-te_total_perc <> 0 .

     MESSAGE 'Total should not be greater than or less than 100' TYPE 'E'.
endif.

     MODIFY lt_scrn_output FROM ls_scrn_output INDEX tc-current_line.

*  ENDIF.

ENDMODULE.                 " MODIFY_DETAIL  INPUT

3 REPLIES 3
Read only

vinoth_rajendran2
Product and Topic Expert
Product and Topic Expert
0 Likes
590

Hi,

Modify the Value using module on each field between chain and endchain.

Read only

0 Likes
590

Hi Vinoth,

I did the same but its not modifying..........

LOOP AT lt_scrn_output .
     CHAIN.
       FIELD:

              ls_scrn_output-te_mon_jan, ls_scrn_output-te_mon_feb,
              ls_scrn_output-te_mon_mar,ls_scrn_output-te_mon_apr,
              ls_scrn_output-te_mon_may,ls_scrn_output-te_mon_jun,
              ls_scrn_output-te_mon_jul,ls_scrn_output-te_mon_aug,
              ls_scrn_output-te_mon_sep,ls_scrn_output-te_mon_oct,
              ls_scrn_output-te_mon_nov,ls_scrn_output-te_mon_dec,
              ls_scrn_output-te_total_perc.
*    MODULE validate_basic.
       MODULE modify_detail ON CHAIN-INPUT.
     ENDCHAIN.

   ENDLOOP.

Read only

manish_shankar
Participant
0 Likes
590

Hi Prabhu,

Hope this link will help you.

http://scn.sap.com/docs/DOC-32197

- Regards,

Manish Shankar.