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: 

Want to print '*' in script.

Former Member
0 Kudos

Hello guys,

I am making a script of marksheet (snapshot attached) and I want to print '*' (star) for subject (may be more than one) where mark is less than 35. Let me know if it is possible.

If yes, please give me your valuable suggestion.


Thanks

Rohan

1 ACCEPTED SOLUTION

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

Very basic .

Create a field:

flag_1 type c length 1.

if value LT 35 move '*' to flag_1 else move space to flag_1 .

print flag_1 next to "marks obtained"  .

Regards.

11 REPLIES 11

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

Very basic .

Create a field:

flag_1 type c length 1.

if value LT 35 move '*' to flag_1 else move space to flag_1 .

print flag_1 next to "marks obtained"  .

Regards.

0 Kudos

Hi Eitan,

Thanks for suggestion.

I already tried this and I am getting output like this-

Marks Obtained

75*

60*

57*

33*

63*

43*

55*


There are chances that no. of subject (< 35) are more than one.


Regards

Rohan

0 Kudos

Hi,

You need to do this check for each line separately .

Loop at data...

if value LT 35 move '*' to flag_1 else move space to flag_1 .

print...(CALL FUNCTION 'WRITE_FORM')

endloop .

Regards.

0 Kudos

Hi Eitan,

I am appreciate your answer.

but In my case it is not working.

output is same as before.

I have seven work area to compare (< 35).

Regards

Rohan

0 Kudos

Hi,

It is a fix format ?

All of it printed at once ?

so seven fields are needed and seven compares .

IMHO not very good design (LT 35 ).

Regards.

0 Kudos

Hi Eitan,

Below are answers of your questions-

It is a fix format?

Ans- Yes.

All of it printed at once?

Ans. Depend on value. Wherever value is LT 35 it should print.

For your reference I have attached a text file . In this text file I copied sample format of my program. Hope,  you can understand what I want.

Actually I am beginner for abap so might be I can do mistake while writing coding.

Regards

Rohan

VenkatRamesh_V
Active Contributor
0 Kudos

Hi,



Hope it helpful.



Create one variable internal table,


While calculating total inside a loop ,

loop at itab into wa.

if  mark < 35.

wa_flag = '*'.

endif.

modify itab from wa.


In Script add the field after the marks according to space required.



Regards,

Venkat.








0 Kudos

Hi Venkat,

Thanks for your suggestion.

I tried that but not working , the output is same as before.

I have seven subjects(work area) to compare.

I want this type of output-

60

30*

56

63

29*

46

Regards

Rohan

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

Is that home work ?

Regards.

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

Is the information we see here comes from one record ?

If this is the case I think that you have a fault in your tables design.

Think the affect of adding more subjects will be on the system.

You should normalize your data .

I see here at least 3 tables .

- Students (ZSDATA2 ?)

   ZSROLL(Key)

   ZSTNM

   ZCSNM

  

- Subject table

  subject Key (key)

  Subject description.

 

- Grades

   ZSROLL(Key)

   subject Key (key)

   MARK

   

Regards.

0 Kudos

Hi Eitan,

This is not home-work.

My TL has solved my query.

Thanks for your valuable suggestions.

Regards

Rohan