cancel
Showing results for 
Search instead for 
Did you mean: 

Creation of table in SAPScript

Former Member
0 Kudos

Hi,

I am new to SAPScripts.

Could you please give me a sample code to draw a table with 5 rows and 4 columns in SAPScript

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member196280
Active Contributor
0 Kudos

Try this.

Here the code works this way the YORIGIN is incremented by 0.6CM each time it is in the loop thus drawing tables dynamically.

/E TAB

/: POSITION XORIGIN '0.9' CM YORIGIN '+0.6' CM

/: SIZE WIDTH '3.0' CM HEIGHT '0.6' CM

/: BOX FRAME 10 TW.

/: POSITION XORIGIN '3.9' CM

/: SIZE WIDTH '7.3' CM HEIGHT '0.6' CM

/: BOX FRAME 10 TW.

/: POSITION XORIGIN '11.2' CM

/: SIZE WIDTH '2.8' CM HEIGHT '0.6' CM

/: BOX FRAME 10 TW.

/: POSITION XORIGIN '14' CM

/: SIZE WIDTH '2.6' CM HEIGHT '0.6' CM

/: BOX FRAME 10 TW.

/: POSITION XORIGIN '16.6' CM

/: SIZE WIDTH '3.2' CM HEIGHT '0.6' CM

/: BOX FRAME 10 TW

P4 &X_VBAP-KWMENG(C)&,,&X_VBAP- ARKTX&,,&V_TOTALa&,,&V_TOTALb&,,&V_TOTALc&

the driver program's piece of code.

LOOP AT it_vbap INTO x_vbap.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'TAB'

window = 'MAIN'

EXCEPTIONS

element = 1

function = 2

type = 3

unopened = 4

unstarted = 5

window = 6

bad_pageformat_for_print = 7

spool_error = 8

codepage = 9

OTHERS = 10.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDLOOP.

Regards,

SaiRam

Former Member
0 Kudos

Search the SCN before posting the question. You can find the lot of threads related to your question.

former_member555112
Active Contributor
0 Kudos

Hi,

Welcome!!!

You can find a lot of threads in SCN on the same.

Search for the same.

Basically you will have to make use of BOX command.

You can read the following link.

[http://help.sap.com/saphelp_47x200/helpdata/en/d1/802ec5454211d189710000e8322d00/frameset.htm]

Regards,

Ankur Parab