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: 

How to make table in main window of sap script?

himanshu_gupta13
Employee
Employee
0 Kudos

Dear Gurus,

I am new in SAP Script, now I have to make a table in main window, in which their are 7 columns, kindly please guide me...

How can I do this.....

Example is below....

Above is header and below I have to insert the line items..

Many Thanks / Himanshu Gupta

4 REPLIES 4

FredericGirod
Active Contributor
0 Kudos

Did you read the doc of SAPScript ?

regards

Fred

0 Kudos

Dear Girod,

I read the doc. and did some coding like below...

But the output is not coming right, kindly please guide me the concept...

Thanks for early response...

Many Thanks / Himanshu Gupta

ansonabraham
Participant
0 Kudos

Hi HIMANSHU GUPTA,

  1. First define a text element inside the main window to draw table header

    

2.  Write the code given below under the 'TABLE_HEADER' text element to draw the boxes. You need 11 boxes, change the XPOS, YPOS, HEIGHT and FRAME values in the below code to get your desired table layout.

//code to draw vertical lines

BOX XPOS 35 MM YPOS 9 MM WIDTH 0 TW HEIGHT 187 MM FRAME 10 TW
BOX XPOS 70 MM YPOS 9 MM WIDTH 0 TW HEIGHT 187 MM FRAME 10 TW
BOX XPOS 111 MM YPOS 9 MM WIDTH 0 TW HEIGHT 187 MM FRAME 10 TW
BOX XPOS 145 MM YPOS 9 MM WIDTH 0 TW HEIGHT 187 MM FRAME 10 TW


//code to draw horizontal lines

BOX YPOS 9 MM WIDTH 178 MM HEIGHT 0 TW FRAME 10 TW

3. Now define another text element to draw the table body.

4. Next, write the code you have used to draw boxes for table header under the new text elemnt.

5. While calling the form from your driver program call the second text element (Table body) inside the loop of your final output table. It will dynamically draw the no of boxes you need to display the table data.

Also please check the below link for SAPScript pdf

http://help.sap.com/printdocu/core/print46c/en/data/pdf/BCSRVSCRPROG/BCSRVSCRPROG.pdf

Please feel free to ask if you have more doubts.

BR,

Anson

Former Member
0 Kudos

Hi Gupta,

First try to pass the value,and print . Later box , ulines, vlines can be included .

In the Driver program Just loop the final internal table .Inside the loop call the form's Functional module named 'WRITE FORM' . Note : Try to use separate window for text and item details .

1 ) Simply if you want to display text . Example ('Name','Desc','Qty' ...) you no need text element .

    In your case you have named it as item_header .instead of that use paragraph Format  TH alone.

2) In the write form function module call the text element  'ITEM_LINE' .

The above solution would help you . all the best .

cheers,

Sanjith N