Application Development 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: 

write: g UNDER h.

Former Member
0 Kudos

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.

3 REPLIES 3

Former Member
0 Kudos

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

Former Member
0 Kudos

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..

Former Member
0 Kudos

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.