on 03-04-2008 10:22 AM
How can u pass value in SAP Script?& where?
first populate data in driver program
and then use write_form for call in the text elements in window.
in sap script editor use tablename-field name for displaying the value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
write the code i sent earlier in the print program..
In the print program select data whatever you want to print and put into an internal table. then using setval, send the values to be printed.
Dont forget to call the below forms
FORM OPEN_FORM .
OPENING THE FORM FOR PRINTING LABELS.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
DIALOG = 'X'
FORM = 'FORM_NAME'
LANGUAGE = SY-LANGU.
IF SY-SUBRC <> 0.
ENDIF.
ENDFORM. " OPEN_FORM
FORM CLOSE_FRM .
CLOSING THE FORM AFTER PRINTING
CALL FUNCTION 'CLOSE_FORM' .
IF SY-SUBRC <> 0.
ENDIF.
ENDFORM. " CLOSE_FRM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
PASSING TABLE VALUES AS AN ARGUMENT TO SAPSCRIPT:
-
In the line editor, specify the table field arguments enclosed by '&' symbol as follows:
/E ELEMENT
&KNA1-KUNNR& ,, &KNA1-NAME1& ,, &KNA1-LAND1&
Save -> Activate.
In the Print Program, specify following code:
TABLES KNA1.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = 'ZSHABFORM1'
LANGUAGE = SY-LANGU.
SELECT * FROM KNA1.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ELEMENT'
WINDOW = 'MAIN'.
ENDSELECT.
CALL FUNCTION 'CLOSE_FORM'.
Save -> Activate -> Execute.
Regards,
Priya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please elaborate the doubt.
As u said passing the values to SAP script .
We have to write a sub routine if we requrie additioanl data than what standard print program and Scirpt is printing.
Based on the reqruirement write the code.
Regards..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
PERFORM SETVAL USING :
'&maktx&' T_HEADER_RM-MAKTX ,
'&matnr&' T_HEADER_RM-MATNR .
SENDING TO THE FORM TO WRITE.
PERFORM WRITEFORM USING 'RMHEADER' 'HEADER' .
FORM WRITEFORM USING V_ELEMENT V_WINDOW .
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = V_ELEMENT
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = V_WINDOW.
ENDFORM. " WRITEFORM
FORM SETVAL USING NAME VALUE.
CALL FUNCTION 'TEXT_SYMBOL_SETVALUE'
EXPORTING
NAME = NAME
VALUE = VALUE.
ENDFORM. " SETVAL
In the Script
/E RMHEADER
Material Name: &maktx&
Material Code: &matnr&
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.