cancel
Showing results for 
Search instead for 
Did you mean: 

smart forms

Former Member
0 Kudos

I have two field values populated in the internal table mara which i want to use in smart forms.

wat are all the settings to be done in the smartforms for these two fields to be displayed from the internal table.

kindly help me with the sample codes

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Follow this code and steps ull understand how to proceed.

this is a example code.

select mandt

carrid

connid

fldate

price

into table i_sflight

from sflight.

data: V_FUNCTION type TDSFNAME,

wa_param type ssfctrlop,

wa_otf type ssfcrescl,

i_otfdata type table of itcoo,

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'Zpractice'

VARIANT = ' '

DIRECT_CALL = ' '

IMPORTING

FM_NAME = v_FUNCTION

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

IF SY-SUBRC 0.

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

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

ENDIF.

·

o

managing print parameters for the PDF output

wa_param-langu = sy-langu.

wa_param-no_dialog = 'X'.

wa_param-getotf = 'X'.

call generated function module.

CALL FUNCTION C_FUNCTION

EXPORTING

sflight = i_sflight

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

.

if sy-subrc 0.

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

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

endif.

refresh i_otfdata.

i_otfdata] = wa_otf-otfdata[.

*To get PDF Output

call function 'SSFCOMP_PDF_PREVIEW'

EXPORTING

i_otf = i_otfdata

EXCEPTIONS

CONVERT_OTF_TO_PDF_ERROR = 1

CNTL_ERROR = 2

OTHERS = 3.

if sy-subrc 0.

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

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

endif.

Now in your program jus change field names that must be displayed.

In smartforms

1)goto form attributes and set your output options

page format usually DINA4

2)goto form interface and set

parameter name:sflight

type: type

associated type: filghttab

3)in global data set wa_fight type sfilght.

4)Create a page

5) create a template and pass those fields in respective cells

thanks

Reward oints if useful

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Just refer this :

You can understood the smartform.

http://www.saptechnical.com/Tutorials/Smartforms/PO/page1.htm

Regards,

Shiva Kumar

Former Member
0 Kudos

Hai,

Create a Z structure with two fields u used in ur Internal table.

Then in Smartforms->forminterface ->tables->declare a internal of type zstructure.

Loop through the internal table and display the contents.

Swetha Singh

Former Member
0 Kudos

Hi Preet

You can use select statement to extract these two fields to your mara internal table. Do this either in your abap interface program else in your forms.

If u are doing this in forms, u need to simply give your internal table name and its type in form interface -> import parameters and in global definitions specify your work areas.

and right click on your main window ->flow logic -> program lines

inside this you need to give your input and output parameters.

After this just insert a table/template to pass your work areas in which the two fields which you have extracted will be present.

save and activate your form to see the output.

Regards

Swetha

Edited by: Swetha on May 28, 2008 8:02 AM