cancel
Showing results for 
Search instead for 
Did you mean: 

Standard elements in script

Former Member
0 Kudos

I would like to display some text(paragraph ) and data in a script.

For this, Do i need to create standard elements in SO10?

for which type of elements require SO10? how to delcare them in script?

one more thing,

fo rmy data display.. I programmed in the script like :

<B>fild1,,fld2.............. fldn<b>

loop at itab into wa.

&wa-fld1&,, &wa-fld2&, , ........... &wa-fldn&,,

endloop.

but am not getting data here.. plz help me...

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

you need to create a Standard text to display a text, for this goto SO10, and give a name and create the text and save it. then come to Se71(Script) and in the line editor , you have an option from the menu to insert the text, then one popup will come and give the name of the text and press enter, a INCLUDE will come in the line editior, so your text is inserted in the script, in the output the text will come which you hae written in the SO10.

coming to ITAB, you need to write the select and data retrival in the Driver program, then Create a element in the Script and under that element write the fields like &ITAB-Field1&,,&ITAB-Field2&,,&ITAB-Field3&

in the driver program , loop at itab and endloop, in between this call the Element with using the function module WRITE_FORM, and give that element there.

Regards

Sudheer

Former Member
0 Kudos

/: DERIVED MATERIAL MAT.TYPE MAT. DES PLANT

Disposition Cost/Rework PO Qty Mat. at Vend Stock

Consign. W.o.Qty Total Cost

/: ,, DESCRIPTION</>

/: &WA_REP_OUT-DERIVED&,,&WA_REP_OUT-MATNR&,,

/: &WA_REP_OUT-MTART&,,&WA_REP_OUT-MAKTX&,,

/: &WA_REP_OUT-WERKS&,,&WA_REP_OUT-CODE&,,

/: &WA_REP_OUT-COST1&,,&WA_REP_OUT-MENGE1&,,

/: &WA_REP_OUT-MATVND1&,,&WA_REP_OUT-PGMNG1&,,

/: &WA_REP_OUT-KLABS1&,,&WA_REP_OUT-TOTAL1&,, >

the print program code in the USER_COMMAND

is

WHEN 'PRINT'.

i_itcpo-tdimmed = 'X'.

i_itcpo-tddelete = 'X'.

  • Open print job

CALL FUNCTION 'OPEN_FORM'

EXPORTING

  • application = 'TX'

device = 'PRINTER'

dialog = 'X'

form = 'ZSCRIPT'

  • options = i_itcpo

EXCEPTIONS

CANCELED = 1

DEVICE = 2

FORM = 3

OPTIONS = 4

UNCLOSED = 5

OTHERS = 6.

IF SY-SUBRC <> 0.

WRITE 'Error in open_form'(001).

EXIT.

ENDIF.

  • Open form of respective customer

CALL FUNCTION 'START_FORM'

EXCEPTIONS

OTHERS = 1.

IF SY-SUBRC <> 0.

WRITE 'Error in start_form'(002).

EXIT.

ENDIF.

PERFORM print_data.

CALL FUNCTION 'END_FORM'.

CALL FUNCTION 'CLOSE_FORM'.

MESSAGE s208(00) WITH 'Manufacturing Form Successfully Printed.'.

the perform contains:.......

*Left logo

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'LLOGO'

FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'LLOGO'

EXCEPTIONS

OTHERS = 1.

IF SY-SUBRC <> 0.

WRITE 'Error in logo element of main'(003).

EXIT.

ENDIF.

*header

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'HEADER'

FUNCTION = 'SET'

  • TYPE = 'TOP'

WINDOW = 'HEADER'

EXCEPTIONS

OTHERS = 1.

IF SY-SUBRC <> 0.

WRITE 'Error in form2 printing body of main'(004).

EXIT.

ENDIF.

*standard text

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'TEXT'

FUNCTION = 'SET'

  • TYPE = 'TOP'

WINDOW = 'TEXT'

EXCEPTIONS

OTHERS = 1.

IF SY-SUBRC <> 0.

WRITE 'Error in form3 printing body of main'(004).

EXIT.

ENDIF.

*disposition detials

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'DISPOSI'

FUNCTION = 'SET'

  • TYPE = 'TOP'

WINDOW = 'DISPOSI'

EXCEPTIONS

OTHERS = 1.

IF SY-SUBRC <> 0.

WRITE 'Error in form4 printing body of main'(004).

EXIT.

ENDIF.

*ECN number

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'ECN'

FUNCTION = 'SET'

  • TYPE = 'TOP'

WINDOW = 'ECN'

EXCEPTIONS

OTHERS = 1.

IF SY-SUBRC <> 0.

WRITE 'Error in form5 printing body of main'(004).

EXIT.

ENDIF.

*it_rep_out headings and data

LOOP AT it_rep_out INTO wa_rep_out.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'DETAIL_A'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'MAIN'

EXCEPTIONS

OTHERS = 1.

IF SY-SUBRC <> 0.

WRITE 'Error in form5+1 printing body of main'(004).

EXIT.

ENDIF.

ENDLOOP.

*Comments

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'FOOTER'

FUNCTION = 'SET'

  • TYPE = 'TOP'

WINDOW = 'FOOTER'

EXCEPTIONS

OTHERS = 1.

IF SY-SUBRC <> 0.

WRITE 'Error in form7 printing body of main'(004).

EXIT.

ENDIF.

Former Member
0 Kudos

for this Create Standard Text..

in SO10.

Text name - xxxxxxxx

Text- id - ST

Language: EN or whterver want.

now dislplay it u r script

Former Member
0 Kudos

is it required to create text elements for my internal table lfds?