‎2005 Dec 06 3:54 PM
Hi,
No where am I able to get a complete picture of how to develop a sapscript and how to use it !!
Could guess that SDN forums is the best place !!
Based on what I read so far, I have done the following :
1. Using SE71, created a form called ZTESTSS1.
2. Created 2 pages in that, coverpage and datapage.
3. In coverpage, created two elements , vendor and faxnum. So, in the layout, i am able to see two small windows named vendor and faxnum.
4. I saved and then activated, and status bar says ZTESTSS1 is activated !!
Now how to proceed.
I want to fetch the data vendor name and fax number from master record and pass this on to this form. Also, want this form to be invoked when PO is created via ME21N.
I suppose i need to write a sapscript now !! Need help on how to do it !!
in case u know any good material which gives a complete description of developing and using sapscript, please send me the link !!
thanks
‎2005 Dec 06 3:56 PM
‎2005 Dec 06 3:58 PM
Hi
if you want to trigger your lay out you need to maintain NAST table entry,TNAPR table also..
that BASIS will do...
They will attach drivers to your layout and output types..
regards
vijay
‎2005 Dec 06 4:05 PM
Hi,
You have to attach your sap script and Driver program to an output type by using t/code "NACE". For Po application is "EA".
‎2005 Dec 06 4:11 PM
I am sorry, I am not able to understand the term Driver program !!
If I am correct, should I write a Z program (executable one) and from there call this form that I created using open_form, write_form and close_form ??
How do i pass values to the form elements, i.e. vendor name and fax number ?? is it as parameters ??
can u give me any sample code for that ??
please consider me totally novice to this and explain / redirect me to detailed info..
thanks a lot for your efforts...
‎2005 Dec 06 4:17 PM
Hi Rad,
by using FM 'WRITE_FORM' you will be able to transfer the field vaule to the layout from the Z program(Driver Program).
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ITEM_TEXT'
EXCEPTIONS
OTHERS = 01.
Now write the code in the layout as
/E ITEM_TEXT.
&V_VENDOR& "Write the variables between '&'.
If you are still not clear,then let me know.
‎2005 Dec 06 4:18 PM
populate those values into internal table or variable and call them in scrtipt layout like this &value1& ..
first open form,
you need to use write form to print the values in script..
then close the form
and Driver is zprogram..
‎2005 Dec 06 4:20 PM
populate the fields in the Zprogram and use them in layout.In Script editor write like this
&vendor&
&FAX&
‎2005 Dec 06 4:30 PM
Thanks Phani, how should i invoke the script editor ??
is the icon named "text" to be clicked for that ?? will that window contain two drop downs, "paragraph formats" and "character formats" ?
thanks
‎2005 Dec 06 4:32 PM
Click on Page winodw then you can enter into script editor..
there you can write the code..
regards
vijay
‎2005 Dec 06 4:34 PM
It is a kind of Editor , if you see the editor where we will maintain help looks alomost same..
vijay
‎2005 Dec 06 4:48 PM
Hi Rad,
You create a Window in the Layout in SE71.There in the Window,there would be EDIT-->Text Elements.It will take you to the Editor,there you Enter the lines i have given.
‎2005 Dec 06 4:52 PM
Yes, I am able to locate it that way too..thanks...
is there a way i can run the sapscript independently and invoke the form and get the output or should i have to invoke it via some transaction only ??
like i choose the zprogram in SE38 and simply excute !!
‎2005 Dec 06 5:02 PM
Hi ,
Open_form:
ITCPO-TDDEST = WWORKPAPER-TDDEST.
ITCPO-TDIMMED = 'X'.
ITCPO-TDNEWID = 'X'.
ITCPO-TDPREVIEW = W_PREVW.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX'
ARCHIVE_INDEX = ' '
ARCHIVE_PARAMS = ' '
DEVICE = 'PRINTER'
DIALOG = ' '
FORM = T390-FORM
LANGUAGE = SY-LANGU
OPTIONS = ITCPO
EXCEPTIONS
CANCELED = 1
DEVICE = 2
FORM = 3
OPTIONS = 4
UNCLOSED = 5
OTHERS = 6.
Write_form to write lineitem data :
PERFORM SET_VALUE USING '&NAME&' W_TASK_TEXT.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'ITEM_TEXT'
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
OTHERS = 7.
ITEM_TEXT is Text Element defined in SAP SCript
Read this Link :
http://www.sappoint.com/abap/sscrtpex1.pdf
Message was edited by: Lanka Murthy
‎2005 Dec 06 5:09 PM
Hi Rad,
You can execute the Layout,just to see the look of the output.But to see the data population,you have to execute from SE38 or the transaction code attached.
When you are attaching to the SAP transaction(ie ME22N or VA02 etc etc) then you have to run from that transaction.
‎2005 Dec 07 7:22 PM