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

simple list

Former Member
0 Likes
519

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
497

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

4 REPLIES 4
Read only

Former Member
0 Likes
497

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

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
497

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

Read only

Former Member
0 Likes
497

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

Read only

Former Member
0 Likes
498

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