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

Former Member
0 Likes
603

Hi All,

I am working on Table Control.

If a field in any row of the table control is changed how can we capture that changes are made in the field so as to give a pop pup message.

1 ACCEPTED SOLUTION
Read only

KN-Nampoothiry
Active Participant
0 Likes
578

Hi,

The changes you make in the screen are transported to ITAB in PAI when user hits the return key.

You might have already written one module that is inside a loop in PAI where you transport the values from screen to ITAB. There inside the loop you can write the code.

Below is the PAI section of a screen with table control where i have validated the fields to see if user entred housrs / working day is less than 24 hours etc.

process after input.

  loop at gt_zppcd.
    chain.              " Transfer values
      field wa_zppcd-sel.         " Check-box
      field wa_zppcd-zppccur.     " Efficiency
      field wa_zppcd-zppcnoic.    " No. of Equipments
      field wa_zppcd-zppchpd.     " Hours / Day
      field wa_zppcd-zppcwdpm.    " WorkDays/Momth
      field wa_zppcd-zppcitpm.    " Idle Time/Month
      field wa_zppcd-choose.      " Button to choose
      module tc_capacities_modify on chain-request.
      field wa_zppcd-zppchpd  module hpd.  " Check Hours Per Day < 24.
      field wa_zppcd-zppcwdpm module wdpm. " Check Workin Days Per Month < 31.
      field wa_zppcd-zppcitpm module itpm. " Check Idle Time % Per Month < 100
    endchain.
  endloop.

Hope this helps.

6 REPLIES 6
Read only

KN-Nampoothiry
Active Participant
0 Likes
579

Hi,

The changes you make in the screen are transported to ITAB in PAI when user hits the return key.

You might have already written one module that is inside a loop in PAI where you transport the values from screen to ITAB. There inside the loop you can write the code.

Below is the PAI section of a screen with table control where i have validated the fields to see if user entred housrs / working day is less than 24 hours etc.

process after input.

  loop at gt_zppcd.
    chain.              " Transfer values
      field wa_zppcd-sel.         " Check-box
      field wa_zppcd-zppccur.     " Efficiency
      field wa_zppcd-zppcnoic.    " No. of Equipments
      field wa_zppcd-zppchpd.     " Hours / Day
      field wa_zppcd-zppcwdpm.    " WorkDays/Momth
      field wa_zppcd-zppcitpm.    " Idle Time/Month
      field wa_zppcd-choose.      " Button to choose
      module tc_capacities_modify on chain-request.
      field wa_zppcd-zppchpd  module hpd.  " Check Hours Per Day < 24.
      field wa_zppcd-zppcwdpm module wdpm. " Check Workin Days Per Month < 31.
      field wa_zppcd-zppcitpm module itpm. " Check Idle Time % Per Month < 100
    endchain.
  endloop.

Hope this helps.

Read only

0 Likes
578

Hi Narayanan,

I understood that, all the fields located above the MODULE, are passed to specified module......

1 )but, u have given 3 fields after module!! so, wht culd b the purpose.

2) and also, pls. let me know a single word abt on chain-request functionality, bcoz i dont hv sap access!!

thaq

Read only

Former Member
Read only

KN-Nampoothiry
Active Participant
0 Likes
578

Hi,

The field names above makes to trigger the moduel that copies the value from Screen ( which comes in the Tabel Control ) to the associated ITAB. That is why all the fields ( Please note only input fields ) are there in the chain list.

The modules below are validation modules which get triggered when value of the field changes.the logic in these modules could have been very well written inside the other module where values are copied, but i preferred this since keep the validation logics separate..no other reason.

Chain. Endchain.

When you have a screen and many fields in there, you validate the field by writing

FIELD <Field Name> MODULE <Module Name>

say there are 5 fields on screen and for each there is a validation module.

When any validation throws error,Only that screen field remains open for correcting the value.

But if a set of fields are in Chain-Endchain they all will be open for correction

You need this when validation of value of one of the fields is dependent on other and when validation fails user will have to correct both..

.e.g

Month

Date

Say if you entered Feb as month and 29 as date. Validation fails telling Feb 29 is holiday. Choose another date. User want to key in Jan 30 but he cannot since only Date is open when he enters 30 program will say only 29 days in Feb, but he cannot change the Month since it is closed.

Had the same validation be in Chain Endchain, both will be open and he can enter required value.

Hope this helps.

Thanks.

Read only

0 Likes
578

Thank you for your explanation, which is in details, say spoon feeding, with a very good example.

And Thank you for your time.

Read only

Former Member
0 Likes
578

Thanks Narayanan