2007 Apr 16 3:36 PM
Hi Peers,
I am working on the report which calling the Form from SAP Script and displaying the form.
I wanted a selection screen in which if the user enters some value it should automatically preview in the form.
I am really new to the ABAP Pls some help on this .
Any code is appreciated.
Every answers will be rewarded.
Pls peers help on this.
Seema.
2007 Apr 16 3:40 PM
plz clearly specify your requirement
2007 Apr 16 3:40 PM
2007 Apr 16 3:47 PM
Hi kannan,
I have to provide a input value on the page and it should also display on the form.
pls any example is appriciate.
Seema.
2007 Apr 16 3:56 PM
Hi Seema,
data:
w_func(40) type c.
parameters:
p_value(10) type c.
*****************
<b>CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'</b>
EXPORTING
formname = 'ZYH642_TEST_2' " ur form name
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
fm_name = w_func.
<b>call functio w_func</b>
exporting
value = p_value.
**********************
in ur form..
take .... in ur form interface.. value type c.
2007 Apr 16 4:08 PM
2007 Apr 16 4:10 PM
Hi
Do i have to specify any variable in the form also.
Seema.
2007 Apr 16 4:26 PM
Hi Seema,
Please use the below code.
Print Program:
Report zprg no standard page heading.
selection-screen begin of block b1.
parameters : name(20) type c,
designa(20) type c,
signatu(20) type c.
selection-screen end of block b1.
start-of-selection.
call function 'OPEN_FORM'
exporting
form = 'Z_TESTING1'
language = sy-langu.
call function 'START_FORM'
exporting
form = 'Z_TESTING1'
language = 'E'
startpage = 'PAGE1' .
call function 'WRITE_FORM'
exporting
element = 'MAIN'
type = 'BODY'
window = 'MAIN' .
call function 'END_FORM' .
call function 'CLOSE_FORM'.
SAPScript:
Create a Main Window, a Paragraph as 'A' and Page as 'PAGE1' and use the below code in the text element of the Main Window.
/E MAIN
A &NAME&
A &DESIGNA&
A &SIGNATU&
Hope this helps.
Thanks,
Srinivasa
2007 Apr 17 5:13 AM
Hi Srini,
I will try this and let you know .
Thankyou very very much.
Seema.
2007 Apr 17 8:16 AM
Hi
define Parameters , in start-of-selection , put the same in the Script , write that field in Script like &name&, &signatur& etc.....
This is very simple .
Take care.
Manoj Shakya.
2007 Apr 17 12:44 PM
2007 Apr 16 3:41 PM
Hi,
Create a Parameters in the Report, so in the start-of-seelction the field value will be available, so the same value will be avialable in the Script also, just write that field in Script like &P_Field&
Regards
Sudheer
2007 Apr 16 3:43 PM
Hi Seema,
You can pass the selection screen variables to the SapScript using the FM write_form through some Text element.
From SAPScript using this Text Element, you can display the selection screen input values.
Hope this helps.
Thanks,
Srinivasa
2007 Apr 16 3:45 PM
Hi Sudheer / Srinivas,
I know that but actually needed some example so that it will more clearify how to write.
I am new to tis domain and at learning stage.
Pls help.
Seema.
2007 Apr 16 3:53 PM
In the Program..
write it as...
parameters : p_value type i value 234.
use OPEN_FORM & CLOSE_FORM to call a script !!
Check these links..
http://www.thespot4sap.com/Articles/SAPscript_Introduction.asp
http://help.sap.com/saphelp_crm40/helpdata/en/16/c832857cc111d686e0000086568e5f/content.htm
the program looks like this..
REPORT ZPSAPSCRIPT.
TABLES : EKKO,
EKPO,
KNA1,
USR01,
MARA,
MAKT.
DATA : BEGIN OF ZOPTION.
INCLUDE STRUCTURE ITCPO.
DATA : END OF ZOPTION.
PARAMETERS: P_EBELN LIKE EKKO-EBELN,
P_EBELP LIKE EKPO-EBELP.
CLEAR EKPO.
SELECT SINGLE * FROM EKPO
WHERE EBELN = P_EBELN AND
EBELP = P_EBELP.
CLEAR KNA1.
SELECT SINGLE NAME1 FROM KNA1
INTO KNA1-NAME1
WHERE KUNNR = EKPO-KUNNR.
CLEAR MAKT.
SELECT SINGLE MAKTX FROM MAKT
INTO MAKT-MAKTX
WHERE MATNR = EKPO-MATNR AND
SPRAS = SY-LANGU.
CLEAR USR01.
SELECT SINGLE * FROM USR01 WHERE BNAME = SY-UNAME.
ZOPTION-TDDEST = USR01-SPLD. "Output device (printer)
ZOPTION-TDIMMED = 'X'. "Print immediately
ZOPTION-TDDELETE = 'X'. "Delete after printing
ZOPTION-TDPROGRAM = 'ZPQRPRNT'. "Program Name
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX'
ARCHIVE_INDEX = ' '
ARCHIVE_PARAMS = ' '
DEVICE = 'PRINTER'
DIALOG = ' '
FORM = 'Z_TESTSCRIPT'
LANGUAGE = SY-LANGU
OPTIONS = ZOPTION
IMPORTING
LANGUAGE = SY-LANGU
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'HEADER'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'HEADER'
EXCEPTIONS
ELEMENT = 1.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'MAIN'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
EXCEPTIONS
ELEMENT = 1.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'FOOTER'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'FOOTER'
EXCEPTIONS
ELEMENT = 1.
CALL FUNCTION 'CLOSE_FORM'
EXCEPTIONS
UNOPENED = 1
OTHERS = 2.
regards,
sai ramesh
2007 Apr 16 3:56 PM
Hi All Peers,
The code seems good but i have the field like
name ________ Signature _________
Designation_______
Suppose i am giving in the first page of the report name = abc
then this abc should display in the form also as ABC .
Seema.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |