Application Development 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: 

regarding smartforms

Former Member
0 Kudos

Hey,

I tried to execute smartforms demo program,

But.while executing itdisplays PRINT dailog box to user.

why is it..suppose i want to display only forms displaying in ABAP rather printing(which is next step after display).

how to avoid this print dailog box.do we have any demo program to test smartform workings

chandra

below is code sniippet.

report sf_example_01.

data: carr_id type sbook-carrid,

fm_name type rs38l_fnam.

parameter: p_custid type scustom-id default 1.

select-options: s_carrid for carr_id default 'LH' to 'LH'.

parameter: p_form type tdsfname default 'SF_EXAMPLE_01'.

data: customers type ty_customers,

bookings type ty_bookings,

connections type ty_connections.

  • get data

select * from scustom into table customers

where id = p_custid

order by primary key.

select * from sbook into table bookings

where customid = p_custid

and carrid in s_carrid

order by primary key.

select * from spfli into table connections

for all entries in bookings

where carrid = bookings-carrid

and connid = bookings-connid

order by primary key.

  • print data

call function 'SSF_FUNCTION_MODULE_NAME'

exporting formname = p_form

  • variant = ' '

  • direct_call = ' '

importing fm_name = fm_name

exceptions no_form = 1

no_function_module = 2

others = 3.

if sy-subrc <> 0.

  • error handling

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

exit.

endif.

  • now call the generated function module

call function fm_name

exporting

  • archive_index =

  • archive_parameters =

  • control_parameters =

  • mail_appl_obj =

  • mail_recipient =

  • mail_sender =

  • output_options =

  • user_settings = 'X'

customers = customers

bookings = bookings

connections = connections

  • importing document_output_info =

  • job_output_info =

  • job_output_options =

exceptions formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

others = 5.

if sy-subrc <> 0.

  • error handling

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

Message was edited by: ambi chan

1 ACCEPTED SOLUTION

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Check this link.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/8fd773b3-0301...

I think that will satisy your requirement.

If not , get back to me.

Press F8 on that print screen and give output device as 'LOCL'.Then you can view the form in print preview.

Regards,

J.Jayanthi

Message was edited by: Jayanthi Jayaraman

10 REPLIES 10

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Check this link.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/8fd773b3-0301...

I think that will satisy your requirement.

If not , get back to me.

Press F8 on that print screen and give output device as 'LOCL'.Then you can view the form in print preview.

Regards,

J.Jayanthi

Message was edited by: Jayanthi Jayaraman

0 Kudos

hey jayanthi,

Thanks for your link.

I am trying to create and execute the sample programs which you gave in link.

but i have two error while activating the FORM.

COuld you pls guide me..where i am going wrong.

1-Node-MAIN Error- Window MAIN does not fit onto page(width)

2-Node-%TABLE1 Error- Width of line type LINE does not correspond to total table width.

whats the meaning of the erro..i could not understand.

while trying to compile the form i get this error.

Moroever, In %table node,at Table tab, while i try to set values as 82.50 cm or 17.50 cm in LINE1, i get automatically converted to Commas(eg, 82,50 and 17,50). but in document it displays as Decimal point.

which one is correct.

pls guide me.

ambichan

0 Kudos

Hi,

In that coding sample itself I mentioned the main window width and table width . Just check that. Moreover both TABLE and LINE width should be same.

And regarding that commas , it is because of our user settings.It won't be problem.

If any problem, get back to me.

0 Kudos

hey jeyanthi,

Thanks for your reply.

I solve this problem.but i have one more problem.

In sample program SF_EXAMPLE_01. i can see two pages

FIRST&NEXT pages as nodes having MAIN window in both PAGES with same name.

BUT When i create my own FORM and try to create two PAGES

FIRST&NEXTpages as nodes having MAIN window name in both pages leads to error saying MAIN Window already exists.

why cant we create two main windows in two different pages with same name?

ambichan

0 Kudos

Hi,

For each page you can have a main window.

Refer this link.

http://www.sapgenie.com/abap/smartforms_detail.htm

If your problem is solved,reward points for useful answers and close this thread.

Rgds,

J.Jayanthi

Former Member
0 Kudos

You need to configure parameters for printing.

let's try this.

1. define some fields for parameter

* for printing.

DATA: gs_control_parameters   TYPE ssfctrlop,
      gs_output_options       TYPE ssfcompop.

2. and then do it like this.

  gs_control_parameters-no_dialog = 'X'.
  gs_control_parameters-preview = 'X'. 

3. when you call fm_module, uncomment control_parameters!

	call function fm_name
	exporting
	* archive_index =
	* archive_parameters =
	control_parameters = gs_control_parameters
	* mail_appl_obj =
	* mail_recipient =
	* mail_sender =
	* output_options =
	* user_settings = 'X'
	....

then, It doesn't display dailog box anymore, and preview the form...

I wish I could help you.

good luck^^

Best Regards

Kyung Woo.

0 Kudos

hey kyung woo nam,

thanks for your reply.

i tried ur settings.

i get error like this in status bar.

include text SF_ADRS_SENDER does not exist(Object TEXT, ID ADRS).

what to do now..should i have to create text or include text..can somebody guide here.

ambichan

0 Kudos

Hi ambichan,

Have you tried the sample coding provided by me?

0 Kudos

Hi! ambi chan~~

I tried your code, again.

Error is caused by smartform "SF_EXAMPLE_01",

look at that smartform's source,

-> from SF_EXAMPLE_01
 -> Pages and Windows
  -> Next page
   -> address customer address
    -- addr_incl inlude text for address

you can find text key field "SF_ADRS_SENDER",

but doesn't exist.

when your SAP-BC install ecucation programs(IDES) for SAP,

look like something is unstalled for it.

I tried other smartforms and it works~~~

Try to make other smartforms, and using parameters for printing, I'm sure you can get what you want~

Have a nice day~~

Regars

Kyung Woo.

0 Kudos

when the printer dialog comes: click on print preview or press f8.