‎2015 Mar 13 10:29 AM
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.
‎2015 Mar 13 11:54 AM
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.
‎2015 Mar 13 11:28 AM
‎2015 Mar 13 11:40 AM
Please add the code in the events and set the field to display mode.
then we are not able to enter second time.
Regards,
Srikanth
‎2015 Mar 13 11:43 AM
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
‎2015 Mar 13 11:59 AM
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?
‎2015 Mar 13 12:14 PM
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.
‎2015 Mar 13 11:54 AM
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.
‎2015 Mar 16 3:50 PM
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
‎2015 Mar 16 4:24 PM
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