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

on idea abt smart forms :(

Former Member
0 Likes
1,426

i have this program which i want to do with smart forms..

PARAMETER cid TYPE sbook-carrid.

DATA it_bookings TYPE ty_bookings.

DATA wa TYPE sbook.

data num type i.

CALL FUNCTION 'Z_UMERFUNCTIONMODULE1'

EXPORTING

carrid = cid

IMPORTING

my_bookings = it_bookings

EXCEPTIONS

bad_carrier_id = 1

OTHERS = 2.

.

IF sy-subrc <> 0.

MESSAGE a001(zumr).

ELSE.

LOOP AT it_bookings INTO wa.

WRITE: / wa-bookid,

wa-order_date.

HIDE: wa-bookid, wa-order_date.

ENDLOOP.

ENDIF.

FUNCTION z_umerfunctionmodule1.

*"----


""Local interface:

*" IMPORTING

*" VALUE(CARRID) LIKE SBOOK-CARRID

*" EXPORTING

*" VALUE(MY_BOOKINGS) TYPE TY_BOOKINGS

*" EXCEPTIONS

*" BAD_CARRIER_ID

*"----


data count type i.

select count( distinct bookid ) from sbook into count where carrid =

carrid.

if count = 0.

raise BAD_CARRIER_ID.

endif.

select * from sbook into table my_bookings where carrid = carrid.

sort my_bookings by order_Date.

write : / count.

ENDFUNCTION.

if anyone can spare their time , i wud be mpre than welcome..thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,401

Hi Shehryar,

I think this link would help you out.

http://www.sap-img.com/smartforms/sap-smart-forms.htm

Regards,

Sumana

11 REPLIES 11
Read only

Former Member
0 Likes
1,401

Hi,

I guess you are just starting on SMART Forms. The example you are trying is not a case where SMART Forms is generally used. It is used to take print outs of business documents like orders, invoices etc.

Take a look at the following links which provide you more info.

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

http://www.sap-img.com/smartforms/sap-smart-forms.htm

http://help.sap.com/saphelp_46c/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm

See the demo programs and smartforms SF_EXAMPLE_*

regards,

Ravi

Note : Please mark the helpful answers

Read only

Former Member
0 Likes
1,401

HI dahar,

goto <b>smartforms</b> transaction..

create a smartform and inside that create a TABLES node..

just create a tables type in the SMARTFORMS and then

use the same in the TABLES node in the form..

copy the function module name from the menu..

ENVIRONMENT->FUNCTION MODULE NAME..

use the name and call it from your program..

in that pass your internal table..

it will be looped and displayed automatically..

check the foll. liknk to get an idea on smartforms..

<a href="http://www.sapgenie.com/abap/smartforms.htm">http://www.sapgenie.com/abap/smartforms.htm</a>

regards

satesh

Read only

Former Member
0 Likes
1,401

HI

GOOD

AS YOU HAVE MENTIONED THAT YOU WANT TO DO THIS IN SMART FORM IT IS VERY EASY BUT YOU HAVE NOT METIONED YOUR REQUREIENTS IN DETAIL.

ANYWAY GO THROUGH THIS LINKS I HOPE THIS WILL HELP YOU TO UNDERSTAND THE SMARTFORM BETTER TO WORK WITH.

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

http://www.sap-img.com/smartforms/smartform-tutorial.htm

WWW.SAPPOINT.COM

http://searchsap.techtarget.com/tip/1,289483,sid21_gci846990,00.html

THE TCODE TO START THE SMARTFORMS IS SMARTFORM

THANKS

MRUTYUN

Read only

0 Likes
1,401

i have a internal table in my abap program(my_bookings).

|

|_ MY_BOOKINGS TYPE TY_BOOKINGS.

then i process it as,

SELECT * FROM sbook INTO TABLE my_bookings WHERE carrid = cid.

(where 'cid' is a parameter defined, in the program)

then i pass this internal table(my_bookings) to the smartform(thru the 'tables' tab of the form interface

|

|_ MY_BOOKINGS TYPE TY_BOOKINGS.

i have made a work area 'wa_book' in the global definition of the type sbook

|

|_ wa_book TYPE sbook.

i create a table node and in the 'data' tab i do this,

|

|_ MY_BOOKINGS INTO wa_book.

then i define a table line and then a text(cell) . In the text i am outputting &wa_book-bookid& &wa_book-order_date&=

-


THE CALLING PROGRAM

-


DATA: fm_name TYPE rs38l_fnam.

  • At the end of your program.

  • Passing data to SMARTFORMS

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZSMART'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

fm_name = fm_name

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

IF sy-subrc <> 0.

WRITE: / 'ERROR 1'.

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

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

ENDIF.

CALL FUNCTION fm_name

TABLES

my_bookings = my_bookings

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

when i run it i am getting &<b>wa_book-bookid& &wa_book-order_date&</b> as the output instead of the original field values.

I hope i am well comprehended by you all. help !

thanks.

Shehryar Dahar

Read only

0 Likes
1,401

what am i doing wrong ?!

Read only

0 Likes
1,401

Hi,

Don't type in the field names there, drag and drop from the field list, on to the text element. You can get the field list by clicking on the second button from the right on the toolbar.

Regards,

Ravi

Note : Please mark all the helpful answers

Read only

Former Member
0 Likes
1,401

Hi,

Check this SMART FORMS help, here it is given in detail step by step,

http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.h...

Regards

vijay

Read only

Former Member
0 Likes
1,402

Hi Shehryar,

I think this link would help you out.

http://www.sap-img.com/smartforms/sap-smart-forms.htm

Regards,

Sumana

Read only

0 Likes
1,401

Ravi, i didnt get you there...

Sumana , thanks for the link .. but it didnt help

Read only

0 Likes
1,401

Hi,

You would have typed the name of the field from which you want to display the value, right. Instead of typing the name, expand the FIELD LIST and drag and drop the field from which you want to pick up the value.

Regards,

Ravi

Note : Please mark the helpful answers

Read only

0 Likes
1,401

thanks ravi ... it works perfectly fine..!!!