2006 Apr 20 7:23 AM
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
2006 Apr 20 9:37 AM
Hi Shehryar,
I think this link would help you out.
http://www.sap-img.com/smartforms/sap-smart-forms.htm
Regards,
Sumana
2006 Apr 20 7:29 AM
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
2006 Apr 20 7:30 AM
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
2006 Apr 20 7:42 AM
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
http://searchsap.techtarget.com/tip/1,289483,sid21_gci846990,00.html
THE TCODE TO START THE SMARTFORMS IS SMARTFORM
THANKS
MRUTYUN
2006 Apr 20 8:58 AM
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
2006 Apr 20 8:59 AM
2006 Apr 20 9:10 AM
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
2006 Apr 20 7:49 AM
Hi,
Check this SMART FORMS help, here it is given in detail step by step,
Regards
vijay
2006 Apr 20 9:37 AM
Hi Shehryar,
I think this link would help you out.
http://www.sap-img.com/smartforms/sap-smart-forms.htm
Regards,
Sumana
2006 Apr 20 11:55 AM
Ravi, i didnt get you there...
Sumana , thanks for the link .. but it didnt help
2006 Apr 20 12:09 PM
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
2006 Apr 20 3:11 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |