2006 Jul 11 6:53 AM
I m trying to write data under columns using UNDER . But it is not working as my case is somewht different.
In my program it is not fixed that under which column data has to be set. Hence when cursor enters the loop it identifies the data concatenates that cost centre and 'Power' into a string variable and writes UNDER that variable value which is already printed as heading. But it is not working. PLZ help. The code is as follows.
********************
loop at t_smry
if t_smry-kostl ne 'INTER'.
w_tempkostl = t_smry-kostl+4(6).
concatenate w_tempkostl ' - Power ' into w_power_heading.
concatenate w_tempkostl ' - Labour ' into w_Labour_heading.
concatenate w_tempkostl ' - Over Head ' into w_OH_heading.
concatenate w_tempkostl ' - Deprction ' into w_Dep_heading.
endif.
write: t_smry-w_Power under w_power_heading,
t_smry-w_Labour under w_Labour_heading,
t_smry-w_OH under w_OH_heading,
t_smry-w_Dep under w_Dep_heading.
endloop.
The values for w_power_heading,w_Labour_heading,w_OH_heading,w_Dep_heading will differ .
Plz provide some other solution if UNDEr wont work in this scenario.
I m trying to write data under columns using UNDER . But it is not working as my case is somewht different.
In my program it is not fixed that under which column data has to be set. Hence when cursor enters the loop it identifies the data concatenates that cost centre and 'Power' into a string variable and writes UNDER that variable value which is already printed as heading. But it is not working. PLZ help. The code is as follows.
********************
loop at t_smry
if t_smry-kostl ne 'INTER'.
w_tempkostl = t_smry-kostl+4(6).
concatenate w_tempkostl ' - Power ' into w_power_heading.
concatenate w_tempkostl ' - Labour ' into w_Labour_heading.
concatenate w_tempkostl ' - Over Head ' into w_OH_heading.
concatenate w_tempkostl ' - Deprction ' into w_Dep_heading.
endif.
write: t_smry-w_Power under w_power_heading,
t_smry-w_Labour under w_Labour_heading,
t_smry-w_OH under w_OH_heading,
t_smry-w_Dep under w_Dep_heading.
endloop.
The values for w_power_heading,w_Labour_heading,w_OH_heading,w_Dep_heading will differ .
Plz provide some other solution if UNDEr wont work in this scenario.
2006 Jul 11 6:59 AM
You have not written any of the variables on to the screen that you are using AFTER UNDER. So, the system would not know those are written.
You should do this first.
write: w_power_heading, w_Labour_heading, w_OH under w_OH_heading, w_Dep under w_Dep_heading.
And now use the following.
write: t_smry-w_Power under w_power_heading,
t_smry-w_Labour under w_Labour_heading,
t_smry-w_OH under w_OH_heading,
t_smry-w_Dep under w_Dep_heading.
Regards,
Ravi
Note : Please mark all the helpful answers
2006 Jul 11 7:03 AM
u need to use the same variable names ( w_power_heading,w_Labour_heading,w_OH_heading,w_Dep_heading ) for the header too under which u want to display other data..
2006 Jul 11 7:09 AM
Hi Satya,
I think you have forgotten to write the heading...
You must write <b>w_power_heading</b>, <b>w_labour_heading</b>,<b>w_OH_heading</b>,<b>w_dep_heading</b>.
Now you can use the UNDER addition of write statement.
You can refer this doc also.
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba15335c111d1829f0000e829fbfe/content.htm
<b>Close the thread once the problem is resolved.</b>
Regards,
SP.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |