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: 

ELEMENT in SAp script

former_member687052
Participant
0 Kudos

Hi,

Can anyone explain me the benifits and functionality of ELEMENTS we use in SAP Scripts..?

In what situations we can set these ELEMENTS and how to deal when we set the elements kind of things.

And can we use multiple ELEMENTS in one window..? If so, please explain me how to write the code and deal in such cases.

Thanks in advance.

Regards,

Paddu.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

In print program you can specify when a certain element should be printed, it gives you a control on the sap script processing and therefore sap script form is more flexible and general.

SAPscript calls the individual text components of a form text elements. To achieve good structuring and readability, you assign a fixed name to each text element in the form. The print program then uses these names to access the elements. This name applies also for translated versions of a text element, while the contents of the text elements depend on the language.

Text elements are related to a window, that is, a print program can call for each window only those text elements that exist in this window. They are used in main and other windows.

The variables used within '&...&' are replaced by the system at output time

/E <element name>

UL &fieldnam& text text

Named element are written when driver program use

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'BOOKING'

TYPE = 'BODY'

WINDOW = 'MAIN'

Unnamed element are written once in MAIN windows, and each time in other windows.

U can use use multiple ELEMENTS in one window.

Regards,

KK

2 REPLIES 2

Former Member
0 Kudos

Hi,

Elements are used to group a related information to print in the script.. You can use as many elements as you want in one window.. for example let us say i want to print

Item Material quantity

10 ADB 10

20 DEF 20

30 SDF 30

-


Total 60

-


Here we would be using the main window to print this data.. as we are not sure how many line items exist.

In this main window i would delcare 3 elements header, details, total elements.

when calling from program

Use the WRITE_FORM AND pass the window name and element name to call the resepective window.

Thank

Mahesh

Former Member
0 Kudos

Hi,

In print program you can specify when a certain element should be printed, it gives you a control on the sap script processing and therefore sap script form is more flexible and general.

SAPscript calls the individual text components of a form text elements. To achieve good structuring and readability, you assign a fixed name to each text element in the form. The print program then uses these names to access the elements. This name applies also for translated versions of a text element, while the contents of the text elements depend on the language.

Text elements are related to a window, that is, a print program can call for each window only those text elements that exist in this window. They are used in main and other windows.

The variables used within '&...&' are replaced by the system at output time

/E <element name>

UL &fieldnam& text text

Named element are written when driver program use

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'BOOKING'

TYPE = 'BODY'

WINDOW = 'MAIN'

Unnamed element are written once in MAIN windows, and each time in other windows.

U can use use multiple ELEMENTS in one window.

Regards,

KK