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

Custom table to enter data manually

Former Member
0 Likes
2,726

Hi Gurus,

We have a custom table thru which users need to enter data as below screen shot. Now we have 5 fields which are fixed & users simply have to enter the data for the 2 fields - month & quantity. But although the month is the same for all the entries, so instead of entering it several times in column, it should be made so as to enter it only once…that it can be kept outside the table, top or somewhere where the user will enter only once & quantity several time for the below materials. How can we do this?

Rgds,

Shreesh.

1 ACCEPTED SOLUTION
Read only

ipravir
Active Contributor
0 Likes
2,305

Hi Shreesh,

Write code in PAI

Loop at Internal_table.

     module Transfer_data.

Endloop.

module Transfer_data.

     if table_control-current_line eq 1.

          gv_month = work_area_of_table_control-month.

     endif.

     move-corresponding work_area_of_table_control to Work_area.

     if work_area-quantity ne 0.

          work_area-month = gv_month.

          modify internal_table from work_area index table_control-current_line.

     endif.

endmodule.

Hope you are clear with logic.

Regards.

Praveer.

8 REPLIES 8
Read only

Former Member
0 Likes
2,305

Any idea gurus, how can it be done?

Read only

0 Likes
2,305

Hi


Regards,

Read only

0 Likes
2,305

Hi Shreesh,

Can explain little bit clear. Unable to understand your problem !!

What I can understand is You want to keep month field away from table columns and it must be saved in database along with the record you saved, and month you want to keep it any where on the screen.. Its not possible..

You make look for 2 step Maintenance...

from your maintenance screen I think Comp. code , sales org , plant, material ,Dchannel are combination of Primary key.... How would you like to have your month field entered once

Read only

0 Likes
2,305

Hi Nagarjun, Yes you have guessed it right & we want to keep the month somewhere on the top, like highlighted as red box in the screenshot. But its a must have as user dont want to enter the month several times...

And yes u r right Comp. code , sales org , plant, material ,DC are combination of Primary key. But month we cant keep primary key, as it will change every month. But there will be hundreds of records below, so the users dont want to enter it several times, as its the same one month in each row. Basically it will be entered once a month.


Two screen is also not liked, it should be like this only, but somewhere the users will want to enter it, but only once....



How can we make it possible?

Read only

0 Likes
2,305

Hi Shreesh,

You cannot add a field in Table Control Title bar.

If it's a TMG, then, go to SE80->Function Group->Enter Respective Function Group.

Go to screen, and add an additional input field at the top.

Declare a respective global variable.

and in PBO inside loop you have to write my logic to update month information based quantity values.

Regards,

Praveer.

Read only

ipravir
Active Contributor
0 Likes
2,306

Hi Shreesh,

Write code in PAI

Loop at Internal_table.

     module Transfer_data.

Endloop.

module Transfer_data.

     if table_control-current_line eq 1.

          gv_month = work_area_of_table_control-month.

     endif.

     move-corresponding work_area_of_table_control to Work_area.

     if work_area-quantity ne 0.

          work_area-month = gv_month.

          modify internal_table from work_area index table_control-current_line.

     endif.

endmodule.

Hope you are clear with logic.

Regards.

Praveer.

Read only

Former Member
0 Likes
2,305

Hi Bhat,

As suggested by Srikanth, kindly use TMG-Events for new entry and assign the default month value to it. This will enable the user to avoid giving the values and also can change the value if required.

Thanks

Read only

Former Member
0 Likes
2,305

I don't think it's a good idea to do it this way (modifying the TMG screen to add a separate field). If you manage to do this, but then later have to change the screen, you may find that all of your changes are removed when the screen is re-generated.

A better solution would be to make this a simple module pool program with a table control.

Or you could look at TMG events to see if you can use the last populated month to carry forward to the remaining entries.

Rob