cancel
Showing results for 
Search instead for 
Did you mean: 

form

Former Member
0 Kudos

I have developed a form and now I want to run it on the Dev..... can you please tell me how to proceed.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi..,

now u did the correct thing...( question )..

After creating the form u need to create the print program for this form...

In this program .. u need to use three function modules..

check this program....

selection-screen begin of block blk with frame.

parameters:

p_actno(13) type c.

select-options:

s_date for sy-datum.

selection-screen end of block blk.

"----


  • Type declaration of the structure to hold transaction details *

"----


types:

begin of type_s_transaction,

date type d,

partics(10) type c,

curr(3) type c,

amount type p decimals 2,

end of type_s_transaction.

"----


  • Declaration of internal table and work area for transaction table *

"----


data :

t_transaction type standard table

of type_s_transaction

initial size 0.

data wa_transaction type type_s_transaction.

*" Data declarations...................................................

data :

w_date type d,

w_partcs(10) type c,

w_amount type p decimals 2,

w_total like w_amount,

w_curr(3) type c,

w_chkdate type d.

  • Populating internal table...

wa_transaction-date = '20010924'.

wa_transaction-partics = 'ATM'.

wa_transaction-amount = '1000.00'.

wa_transaction-curr = '$'.

append wa_transaction to t_transaction.

wa_transaction-date = '20010924'.

wa_transaction-partics = 'Cheque'.

wa_transaction-amount = '5000.75'.

wa_transaction-curr = '$'.

append wa_transaction to t_transaction.

wa_transaction-date = '20010928'.

wa_transaction-partics = 'ATM'.

wa_transaction-amount = '3000.00'.

wa_transaction-curr = '$'.

append wa_transaction to t_transaction.

wa_transaction-date = '20010928'.

wa_transaction-partics = 'Cheque'.

wa_transaction-amount = '4000.00'.

wa_transaction-curr = '$'.

append wa_transaction to t_transaction.

wa_transaction-date = '20011025'.

wa_transaction-partics = 'ATM'.

wa_transaction-amount = '5000.00'.

wa_transaction-curr = '$'.

append wa_transaction to t_transaction.

wa_transaction-date = '20011025'.

wa_transaction-partics = 'Cheque'.

wa_transaction-amount = '1500.00'.

wa_transaction-curr = '$'.

append wa_transaction to t_transaction.

wa_transaction-date = '20011025'.

wa_transaction-partics = 'ATM'.

wa_transaction-amount = '2000.00'.

wa_transaction-curr = '$'.

append wa_transaction to t_transaction.

  • Calling the open_form funtion module to start printing...

<b>call function 'OPEN_FORM'</b>

EXPORTING

FORM = 'YH640_060101' <i><--form name</i>

  • LANGUAGE = SY-LANGU

EXCEPTIONS

CANCELED = 1

DEVICE = 2

FORM = 3

OPTIONS = 4

UNCLOSED = 5

MAIL_OPTIONS = 6

ARCHIVE_ERROR = 7

INVALID_FAX_NUMBER = 8

MORE_PARAMS_NEEDED_IN_BATCH = 9

SPOOL_ERROR = 10

CODEPAGE = 11

OTHERS = 12.

if sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

loop at t_transaction into wa_transaction.

w_date = wa_transaction-date.

w_partcs = wa_transaction-partics.

w_amount = wa_transaction-amount.

w_curr = wa_transaction-curr.

<b> call function 'WRITE_FORM'</b>

EXPORTING

ELEMENT = 'DATA' <i><--- text elements , if u have defined </i>

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

  • WINDOW = 'MAIN'

EXCEPTIONS

ELEMENT = 1

FUNCTION = 2

TYPE = 3

UNOPENED = 4

UNSTARTED = 5

WINDOW = 6

BAD_PAGEFORMAT_FOR_PRINT = 7

SPOOL_ERROR = 8

CODEPAGE = 9

OTHERS = 10.

if sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

w_chkdate = w_date.

add w_amount to w_total.

endloop. " Loop at t_transaction into...

  • Printing the total....

call function 'WRITE_FORM'

EXPORTING

ELEMENT = 'TOTAL'

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

  • WINDOW = 'MAIN'

EXCEPTIONS

ELEMENT = 1

FUNCTION = 2

TYPE = 3

UNOPENED = 4

UNSTARTED = 5

WINDOW = 6

BAD_PAGEFORMAT_FOR_PRINT = 7

SPOOL_ERROR = 8

CODEPAGE = 9

OTHERS = 10.

if sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

  • Closing the form ...

<b>call function 'CLOSE_FORM'</b>

EXCEPTIONS

UNOPENED = 1

BAD_PAGEFORMAT_FOR_PRINT = 2

SEND_ERROR = 3

SPOOL_ERROR = 4

CODEPAGE = 5

OTHERS = 6.

if sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

<b>

reward if it helps u,,,

sai ramesh</b>

Former Member
0 Kudos

I already finish my driver program ...... what I meant is i want to run in different client

Former Member
0 Kudos

hi shaheen,

sap script are client dependent. so u have to copy the existing form in the other client.

That's the only solution.

Regards....

Arun.

Reward points if useful.

Former Member
0 Kudos

yes that's what I'm asking about how can I copy? can you please help me

Former Member
0 Kudos

First log on to your target client.

<b>Go to SE71 initial screen.

Here go to Utilities --> Copy from Client..

now u will get a screen from where u can copy the form form source client to current client...</b>

reward points if it helps u..

sai ramesh

Former Member
0 Kudos

yes I did it .... can you please tell me what to write in the target form field .

Former Member
0 Kudos

The name of the newly copied form ... u can give same name or a different one ..!!

plz do remember to close the thread, when ur problem is solved !!

reward all helpful answers,

sai ramesh

Former Member
0 Kudos

hi

you can use the tcode <b>scc1</b> in the target cleint so as to copy from teh developed cleint.

you need to give in the request number only and click on start immediately.

hope it is helpful

Kidnly reward points if helpful.

Regards

Zarina

Former Member
0 Kudos

hi shaheen,

u have to be in the client where u want to copy that form. In the source field u have to write the existing form name and give a new name in the target form.

Regards...

Arun.

Former Member
0 Kudos

thanks ..... how do I know that the form is been copied

Former Member
0 Kudos

Hi..

Logon to the target client ..

And goto Tcode. Se71.

And open the form (Which u copied ).

If it open succesfullly means.

It is copied..

Reward all useful answers.

Regards

Bala.

Answers (1)

Answers (1)

Former Member
0 Kudos

You can run sap script from using foollwoing three FMs.

1. call function 'OPEN_FORM'

.

.

.

2. CALL FUNCTION 'WRITE_FORM'

.

.

.

3. CALL FUNCTION 'CLOSE_FORM'

.

.

.

execute this fms in driver program.

Jogdand M b

Award if helpful.