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

table in Sapscript

Former Member
0 Likes
1,368

Hi All1

Is it possible to draw column lines in SAPSCRIPT for a dynamic table.Please suggest me the ways to accomplish this.

Thanks in advance

Prasanna Kumar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,274

Hi prasanna,

1. No its not possible for dynamic table

having x number of rows.

2. At the most we can use the character

| (vertical line character)

but it won't look good.

(ie. it won't look like a table grid )

Regards,

Amit M.

11 REPLIES 11
Read only

Former Member
0 Likes
1,275

Hi prasanna,

1. No its not possible for dynamic table

having x number of rows.

2. At the most we can use the character

| (vertical line character)

but it won't look good.

(ie. it won't look like a table grid )

Regards,

Amit M.

Read only

madan_ullasa
Contributor
0 Likes
1,274

Yeah u can.

try sy-vline...

its like this..

in your script write,

&tab-field& &Sy-vline&. write this below a text element.

and use this in fm "WRITE_FORM". as u loop the table, each time the sy-vline is output.

hope this helps..:)-

madan...

Read only

madan_ullasa
Contributor
0 Likes
1,274

please close the thread by awarding points if your query is solved.

regrds,

Madan

Read only

0 Likes
1,274

Not really,

But i have done it before, Though there are some limits to it.

You make a box in SAPSCRIPT with following statement

/: BOX FRAME 10 TW

draws a box around the window

You can create colums by drawing other boxes like this

/: BOX WIDTH '10' CM HEIGHT 1 CM FRAME 10 TW

and

/: BOX XPOS '10' CM WIDTH '10' CM HEIGHT 1 CM FRAME 10 TW

and so on

To have them dynamically there only one dirty solution (can be done with limited number of lines)

In you sapscript you make code like this.

/: IF &counter& > 1.

/: BOX WIDTH '10' CM HEIGHT 1 CM FRAME 10 TW

/: ENDIF.

/: IF &counter& > 2.

/: BOX YPOS '1' CM WIDTH '10' CM HEIGHT 1 CM FRAME 10 TW

/: ENDIF.

...

In your print program you have your output table and you do this test

  • abap code

DATA : counter type i.

DESCRIBE table out_tab lines into counter.

As you can see this can be done if you need to make a dynamic table of something like 5-10 lines but for large chuncks of data this becomes to messy.

You can also try to replace the XPOS and YPOS with dynamic values ex /: BOX YPOS &YPOS& CM FRAME 10 TW

but i'm not sure this works.

Hope this help was usefull.

Best Regards,

Defour Frederik

Read only

0 Likes
1,274

Hi Frederik!

I am using a SAP standard print program.Can I do the changes to the standard print program?Also how to access the print program of a standard SAP program in SAp.Please advice.

Rewarded points

Thanks in advance

Prasanna Kumar

Read only

0 Likes
1,274

Hello,

Sure you can, but i would advice to use a copy instead.

Your printprogram can be altered through custumizing (SPRO) -> look for output control ( It's different for eatch form ex. invoice, delivery... ).

The form and printprogram are attached to the output type.

In your case it could be possible to do it without print program changes. If your lucky you could have a field in your outputtable that can act as the "counter".

ex. In a invoice -> tvbrp-posnr ( If i recall correct ).

Hope this helps.

Best Regards,

Frederik Defour

Read only

0 Likes
1,274

Hi frederik!

I am working on customer statements F140_ACC_stat_01 standard program.Can u please suggest me the field name to be taken as the counter in this case.

Thanks

Prasanna KUmar

Read only

0 Likes
1,274

Sorry can't help you further with this one. Our Sap version has no F140... program.

Just use the sapscript debugger an see what fields and structures are used during printing. Front screen se71 > from menu > activate debugger.

Always helps me to find fields during sapscript.

Greetz,

Frederik Defour

Read only

Former Member
0 Likes
1,274

Hi Prasanna,

Since it is dynamic table you cannot get the table view.

even if you use sy-vline.

regards

vijay

Read only

Former Member
0 Likes
1,274

hi aLL

i am using this as driver program to print the form

F140_ACC_STAT_01 problem is i am not able know from where the addresss is being picked from

This is about Account Statement printing output. The Logo has displayed in NZ (correct) but the address is still in Australia (wrong). It should be New Zealand Address.

can any oe tell me solution to do this

or at least from where the address is being picked in there based on which condition.

with regards

siddhartha

Read only

0 Likes
1,274

Hello,

Address is usually picked using pre-configured

INCLUDE T001G-TXTAB OBJECT TEXT ID ADRS LANGUAGE T001-SPRAS

Go to the table T001G and check the name of text go to the SO10 ... and ask your module consultant if you could change this text or maybe create the new ones in customizing

Bogusia