Application Development and Automation 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: 
Read only

need help on SAPSCRIPT !!

Former Member
0 Likes
1,428

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

15 REPLIES 15
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,405

Do search on this forum for MEDRUCK or ZMEDRUCK. You will find the answers.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,405

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

Read only

Former Member
0 Likes
1,405

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".

Read only

0 Likes
1,405

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...

Read only

0 Likes
1,405

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.

Read only

0 Likes
1,405

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..

Read only

0 Likes
1,405

populate the fields in the Zprogram and use them in layout.In Script editor write like this

&vendor&

&FAX&

Read only

0 Likes
1,405

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

Read only

0 Likes
1,405

Click on Page winodw then you can enter into script editor..

there you can write the code..

regards

vijay

Read only

0 Likes
1,405

It is a kind of Editor , if you see the editor where we will maintain help looks alomost same..

vijay

Read only

0 Likes
1,405

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.

Read only

0 Likes
1,405

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 !!

Read only

0 Likes
1,405

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

Read only

0 Likes
1,405

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.

Read only

0 Likes
1,405

Please be sure to award points for helpful answers and mark you post as solved if solved completely. Thanks.

Regards,

Rich Heilman