Application Development 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: 

Regarding Table Content in Module Pool

former_member233553
Active Participant
0 Kudos

Q. How to pass data from table content cells  to internal table in Module Pool.........

Example........

Like    Price column

           5,00        

This $5,00 will be showing in Price column of Internal Table.

1 ACCEPTED SOLUTION

former_member233553
Active Participant
0 Kudos

Guys,

I am giving you the example Like: my Table Control name is TC4

TC4 is showing data of EKPO

__________________________

PO No          Items          Net price

00000005     00001          30.00

This is showing in Table control Screen. Internal Table like I_EKPO.

Now I am going to edit Netprice column of Table Control TC4 with amount 10.00.

This 10.00 amount will be showing on TC4 table control screen in Net Price field like

PO No          items          Net price

00000005     00001          10.00

and this data will be passing into final internal table like I_EKPO_final.... HOW??????

19 REPLIES 19

Former Member
0 Kudos

Hello Kumar Krishna,

can you explain your scenario clearly ?

What exactly you mean by table content cells ?

0 Kudos

Once we put 5,00 and hit enter then it will hold on the field of TC and automatically saved in Internal Table

karun_prabhu
Active Contributor
0 Kudos

Mr.Kumar krishna Sen,

     If you set the table control column as Input field, automatically the data entered there will be saved into the internal table record.

0 Kudos

Hi,

There has to be some kind of the user action triggered by the user which will trigger the event PAI through which we can transfer the data from the Table Control to the Internal Table.

Is there are any User Actions for this ?

Hope this helps.

Thanks,

Samantak.

0 Kudos

u have to append the work area in pai loop to internal table..

pai.

loop at gt_final.

field : wa_final-1,wa_final-2,wa_final-3.

module apped.

endloop.

module append.

modify gt_final from wa_final.

if sy-subrc is not initial.

append wa_final to gtfinal.

endif.

end module.

Regards,

Siva.

0 Kudos

Dear K. Arun Prabhu,

Is not saving buddy......

Former Member
0 Kudos

hi Kumar,

In module pool, you must be using Table Control to display data, and in this scenario your table control will be editable. Now you want to save the data entered in the table control into your internal table. You will have to write logic to save data in PAI of you module pool:

PROCESS AFTER INPUT.

  MODULE F_EXIT AT EXIT-COMMAND.

  LOOP WITH CONTROL tab_control.

    MODULE F_TABLE_TO_TC.

  ENDLOOP.

********

MODULE F_TABLE_TO_TC INPUT.

*To move the data from the table control to internal table 'INT_TAB'.

  int_tab-chk = line.

  int_tab-field1 = tab_control-field1.

  Concatenate '$' tab_control-field2 into VAR1.  "please use correct data types or this statement may not work

  int_tab-field2 = VAR1.

   MODIFY int_tab INDEX tab_control-current_line.

    IF sy-subrc NE 0.

      APPEND int_tab.

      CLEAR int_tab.

    ENDIF.

ENDMODULE.               

Please let me know if this helps.

Regards,

DN.

former_member198834
Participant
0 Kudos

hi kumar,

Use concatenate statement

concatenate '$'  price column into ' take one variable

append this value to internal table.

Suresh

former_member233553
Active Participant
0 Kudos

Guys,

Issue has not been resolved yet. still Field of Table content does not hold this editable amount....

Can I use DEQUEUE AND ENQUEUE FM.

0 Kudos

Mr.Kumar krishna Sen,

     If you had created table control with attributes Output only, then you recreate with option Input Control.

     Then the table control wizard automatically creates a module (MODULE TC_8001_MODIFY ON CHAIN-REQUEST) to alter the itab contents in line with the table control contents.

     If itab has no data initially and if you want to save the table control data into itab, you have to write the logic inside the above module.

  

MODULE TC_8001_MODIFY INPUT.

   MODIFY ITAB

     INDEX TC_8001-CURRENT_LINE.

   if sy-subrc = 4.

     append itab.

   endif.

ENDMODULE.

0 Kudos

In the PAI of the screen :

loop at itab into witab.

module modify_table.

endloop.

module modify_table.

modift itab from witab index TC-current_line.

if sy-subrc ne 0.

append witab into itab.

endif.

endmodule.

Hope this helps..

Former Member
0 Kudos

Hi,

The Table Control and screen field names should be same, then on user action the values get automatically transferred.

Thanks,

Ankit

former_member233553
Active Participant
0 Kudos

Guys,

I am giving you the example Like: my Table Control name is TC4

TC4 is showing data of EKPO

__________________________

PO No          Items          Net price

00000005     00001          30.00

This is showing in Table control Screen. Internal Table like I_EKPO.

Now I am going to edit Netprice column of Table Control TC4 with amount 10.00.

This 10.00 amount will be showing on TC4 table control screen in Net Price field like

PO No          items          Net price

00000005     00001          10.00

and this data will be passing into final internal table like I_EKPO_final.... HOW??????

0 Kudos

Hi Krishna Kumar,

Structure of code should be ,

In Screen 9XXX,

PROCESS BEFORE OUTPUT

  LOOP AT   i_ekpo

       INTO ls_ekpo "-- Work Area of table i_ekpo

       WITH CONTROL tc4

       CURSOR tc4-current_line.

    MODULE <name of module1>

  ENDLOOP.

Now the field name should be same in Table control as well as internal table/work area i.e.

Table control TC4 has field NETPR then internal table should also have field NETPR. Then values get automatically transferred.

Regards,

Ankit.

0 Kudos

Hi Ankit,

What should be written inside Module .......................? Modify statement because 1st one passing data directly to W_EKPO from EKPO, now I want to change from Table Control Input..

0 Kudos

Hi Krishna,

If you want to modify the content from Screen/Table Control to Internal Table then write code in PAI as,

PROCESS AFTER INPUT

Loop at i_ekpo.

module <module1>

endloop.

In <module1> code will be,

MODULE <module1> INPUT.

if i_ekpo is not initial.

Modify I_ekpo from <work_area> index tc4-current_line.

else.

Insert <work_Area> into i_ekpo index tc4-current_line.

ENDMODULE.

Hope this helps.

Revert in case of questions.

Regards,

Ankit

0 Kudos

Thans Ankit.. for your nice help.

0 Kudos

Welcome Krishna

former_member233553
Active Participant
0 Kudos

Thanks to all of u guys ..for your helps and ideas of this issue.......