‎2007 May 22 7:26 AM
Hi Abapers,
I have created one simple list where i have three fields
1. starting headcount
2. date
3. final headcount.
this is executed once in a month. final headcount which is sum of all other fields for this month should be stored as a starting headcount of next month.
next month when i execute this report again starting headcount is nothing but last month's final headcount. Also i need to generate date which is nothing but date on which this report is run. this also needs to be stored in table.
for this i have to create one custom table with two fields i.e.., starting headcount and date.
how can i code this... plz help me.. its urgent...
points are sure for helpful answers........
Regards,
Radhika.
‎2007 May 22 8:06 AM
Hi Premraj,
First create a database table as u required.
Initially the table is empty.U will update the table through program.
Whenever u get the final headcount after doing all the process, just pass the value final headcount and system date to that table.
Next time when u run the report get the max. date value from the table using aggregate functions.At the same time u have to get the value of the headcount so assign this value to start_headcount.
e.g: Initially, in the table start_headcount = 0 and date = 00:00:0000
After all the process in the program, u ll get some final_headcount value say 100.
Then, assign start_headcount = 100 and time = sy-datum.
Insert these values to table.
Next time u read values from table using max. prog run date using aggregate functions <b>MAX ( date )</b>.
U ll get the recent value of start_headcount from the table.
Just assign start_headcount = 100. And do the process.
Thanks & Regards
Santhosh
‎2007 May 22 7:34 AM
hi,
how to create an ztable.
http://dev.mysql.com/doc/maxdb/en/ee/1c5bcdeba711d4aa2800a0c9430730/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb6e446011d189700000e8322d00/content.htm
1. starting headcount - type I
2. date - data element 'DATS'
3. final headcount. - type i.
Regards
Reshma
‎2007 May 22 7:36 AM
Hi
Have a look on the links:
<b>http://dev.mysql.com/doc/maxdb/en/ee/1c5bcdeba711d4aa2800a0c9430730/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb6e446011d189700000e8322d00/content.htm</b>;
Regards,
Sreeram
‎2007 May 22 7:45 AM
Hi radhika,
answer is in ur question itself.
U need to create a custom table for the two tables and update this table whenever u run the report.only thing is u need a key . may be u can create another field 'pkey' of char(6). and assign value 'H_COUNT'
go to SE11 and create the Ztable.
In ur report code, read this table, and assign head count and date.
select ... from ztable into itab where pkey = 'H_COUNT'.
if sy-subrc = 0.
assign ur values here.
endif.
perform showREport.
ztable-date = ...
ztable-headcount = ...
ztable-pkey = 'H_COUNT'
modify ztable from ztable.
hope tht helps
‎2007 May 22 8:06 AM
Hi Premraj,
First create a database table as u required.
Initially the table is empty.U will update the table through program.
Whenever u get the final headcount after doing all the process, just pass the value final headcount and system date to that table.
Next time when u run the report get the max. date value from the table using aggregate functions.At the same time u have to get the value of the headcount so assign this value to start_headcount.
e.g: Initially, in the table start_headcount = 0 and date = 00:00:0000
After all the process in the program, u ll get some final_headcount value say 100.
Then, assign start_headcount = 100 and time = sy-datum.
Insert these values to table.
Next time u read values from table using max. prog run date using aggregate functions <b>MAX ( date )</b>.
U ll get the recent value of start_headcount from the table.
Just assign start_headcount = 100. And do the process.
Thanks & Regards
Santhosh