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

Dynamic Table in SAP Script

Former Member
0 Likes
2,903

Hi,

Can anyone tell me how to draw a dynamic table in SAP script? Also how can i give a variable in BOX command?? I saw in one thread that we can pass variable to BOX command using the below syntax.

BOX XPOS 10 YPOS 20 width 0 CH hieght <rowcount> CH.

But what exactly that rowcount ??

Thanks,

Padmalatha M.

1 ACCEPTED SOLUTION
Read only

muneshpatwari
Active Participant
0 Likes
2,742

Hi,

Rowcount will be the number of entries in your table which you are trying to display.

Regards,

Munesh.

17 REPLIES 17
Read only

muneshpatwari
Active Participant
0 Likes
2,743

Hi,

Rowcount will be the number of entries in your table which you are trying to display.

Regards,

Munesh.

Read only

0 Likes
2,742


its count of the number of rows in the box, i would say height of the box in output..

Read only

0 Likes
2,742

Hi,

Thanks for your reply.But what my question is do i need to declare the rowcount somewhere in my program? Can you tell me how exactly can i draw a dyanamic table??

Thanks,

Padmalatha.

Read only

0 Likes
2,742

Hi,

Thanks for your reply.But what my question is do i need to declare the rowcount somewhere in my program? Can you tell me how exactly can i draw a dyanamic table??

Thanks,

Padmalatha.

Read only

0 Likes
2,742

can you try using &var1 instead using constant for this you need to have the required length before the box command.

Read only

0 Likes
2,742

Hi,

Rowcount will be the number of records in your internal dynamic table and you will need to declare it in the driver program and populate the variable before the WRITE_FORM.

Regards,

Munesh.

Read only

0 Likes
2,742

How can i pass a variable data into that Box command?What is the syntax?I mean say i m havng value rowcount = sy-tabix which means the length of the internal table.Suppose my internal table contains 10 values.now rowcount =10 is getting in my program.

Now if i give

/: BOX XPOS 0MM YPOS <rowcount> CH width 190 MM height 0 LN

its not printing anythng but if i give

/: BOX XPOS 0MM YPOS 10 CH width 190 MM height 0 LN

Its printing some line.

<rowcount> is this the correct syntax to pass variable value??

Read only

0 Likes
2,742

you misunderstood the syntax.

/: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]

here XPOS, YPOS points to the upper left corner of the box(starting point of the box for example for drawing a rectangle on graph you will give the starting x and y axis and ending x and y axis, its just the same but the end point is determined by the width and height from the starting point).

so give the number of line in height parameter.

below units will help you:

TW (twip)

PT (point)

IN (inch)

MM (millimeter)

CM (centimeter)

LN (line)

CH (character).

Read only

0 Likes
2,742

Hi,

Can you tell me the syntax to write in BOX command to pass a variable value?

Thanks,

Padmalatha.

Read only

0 Likes
2,742

Hi,

The syntax will be:

/: BOX XPOS 0MM YPOS &rowcount& CH width 190 MM height 0 LN

Also make sure that the variable 'rowcount' is of type char as scripts accepts only character variable.

Regards,

Munesh.

Read only

0 Likes
2,742

This is my output for certain po number how to draw lines for this table? the output is dynamic based on the number of rows in output i have to draw a table.how can i acheive that??

Read only

0 Likes
2,742

Hi,

Thanku. its working but how exactly we draw a dynamic table depending on the length of the output fields.?

As you can see this is my output how to draw lines for this table ??


Read only

0 Likes
2,742

Hi,

length or height?? For length you need to play with the WIDTH parameter of the box command and for height, both YPOS and HEIGHT will do.

Regards,

Munesh.

Read only

0 Likes
2,742

You can use Vline and Uline.

check below link.

http://scn.sap.com/thread/2067096

Read only

0 Likes
2,742

Hi,

Thanku for your replies. My issue is solved.

Thanks,

Padmalatha Meesala.

Read only

0 Likes
2,742

Hi,

Thanku for your replies. My issue is solved.

Thanks,

Padmalatha Meesala

Read only

0 Likes
2,742

if i use vline and uline thr ll be breaking between the lines as it is not continous.