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: 

Get the value in a field

Former Member
0 Kudos

Hi,

I have a variable in which some value will be there and that will change. I.e it cannot be fixed.

For Ex g_var has 20 or 30 etc.

I need to display my output starting that that value.

How do I get his. I am sure I need to use field symbols.But am very poor in using field symbols. can some one help me please.

Thanks,

Kiran

12 REPLIES 12

Former Member
0 Kudos

Hi,

Your question is not clear. Can you elaborate what you are trying to acheive?

Regards,

Vikranth

0 Kudos

Hi Vikranth, If my variable holds value of 20, I need to display a sy-vline at that 20th position on my list.

Hope this clears. Please let me know, if you need any more info.

Any clues...

Thanks,

Kiran

0 Kudos

do gv_var time.

write : space.

enddo.

write : sy-vline.

0 Kudos

Thanks Prakash.

This can be problematic.May be I will have this as my last option.

Any other clues please.

Thanks,

Kiran

Former Member
0 Kudos

You can write as ...

loop at final.

write at g_var final-field1.

....

endloop.

Former Member
0 Kudos

Try:

DATA pos TYPE i VALUE 20.
WRITE AT /pos sy-vline.

Rob

0 Kudos

one more option can be:

data: s1 type string.
data : i1 type i value 20.
s1 = sy-vline.

shift s1 by i1 places right.

write : s1.

0 Kudos

Hi Rob,

Let me explain the complete scenario..

Am using AFTER_LINE_OUTPUT & BEFORE_LINE_OUTPUT to handle my subtotals. So one of my write statements in after_line_output is the grand totals.

WRITE: AT / sy-vline,

2 text-092,

70 g_total_pr,

100 sy-vline.

System automatically puts a ULINE as per the List/line size(which will varry some times) So, if I display sy-vline at 100th place, it doesn't complete the box completely. I get extra horizontal line. So I want to capture the line size and then display the sy-vline at that place.

This is my req. Hope am clear in explaining now.

Please suggest me any clues.

Thanks,

Kiran

0 Kudos

what will happen if you just remove the '100' before sy-vline? because by removing it, it will just place sy-vline after the line ends...

0 Kudos

>

> Let me explain the complete scenario...

It would help if you would do this at the beginning. Is there anything else you need to tell us?

Rob

0 Kudos

YOu can always have something like this to limit the size of the SY-ULINE.

WRITE:/5(50) sy-uline.

0 Kudos

After your write statment, SY-COLNO has the current column number. Use that to determine where your VLINE should come. Your VLINE position will be SY-COLNO - 1 or SY-COLNO depending on if you want a space in between or not. Remember this will only work in conjunction with WRITE statement.