cancel
Showing results for 
Search instead for 
Did you mean: 

regarding smartforms

Former Member
0 Kudos

plz send me realtime example for creation of smartforms???????????

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Always try to refer to some standard SMARTFORMS that will help u understand things better..

Check the standard driver program for INVOICE SMARTFORMS <b>RLB_INVOICE</b> and the Smartforms u can look upto is LB_BIL_INVOICE

Thanks.

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

check the link

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

ex- INVOICE FORM

&----


*& Report ZS4

*&

&----


*&

*&

&----


report zs4.

tables: vbrk,vbak,kna1,vbrp,makt.

select-options: s_vbeln for vbrk-vbeln .

*parameters: p_vbeln like vbrk-vbeln.

data:t_vbrk type standard table of vbrk with header line.

data:t_vbak type standard table of vbak with header line.

data:t_kna1 type standard table of kna1 with header line.

data:t_vbrp type standard table of vbrp with header line.

data:t_makt type standard table of makt with header line.

data:t_vbfa type standard table of vbfa with header line.

start-of-selection.

select * from vbrk into table t_vbrk where vbeln in s_vbeln.

if t_vbrk[] is not initial.

select * from vbfa into table t_vbfa

for all entries in t_vbrk where vbeln = t_vbrk-vbeln.

select * from kna1 into table t_kna1

for all entries in t_vbrk where kunnr = t_vbrk-kunag.

endif.

if t_vbfa[] is not initial.

select * from vbak into table t_vbak

for all entries in t_vbfa where vbeln = t_vbfa-vbelv .

endif.

if t_vbak[] is not initial.

select * from vbrp into table t_vbrp

for all entries in t_vbrk where vbeln = t_vbrk-vbeln.

endif.

if t_vbrp[] is not initial.

select * from makt into table t_makt

for all entries in t_vbrp where matnr = t_vbrp-matnr and spras = 'E'.

endif.

  • if t_kna1[] is not initial.

  • select * from makt into table t_makt

  • for all entries in t_vbrp where matnr = t_vbrp-matnr.

  • endif.

*loop at t_vbrk.

*write : / t_vbrk-vbeln.

*endloop.

*loop at t_vbfa.

*write : / t_vbfa-vbeln,t_vbfa-vbelv.

*endloop.

*loop at t_vbak.

*write : / t_vbak-vbeln, t_vbak-kunnr.

*endloop.

*loop at t_vbrp.

*write : / t_vbrp-vbeln , t_vbrp-matnr.

*endloop.

*loop at t_makt.

*write: / t_makt-matnr, t_makt-maktx.

*endloop.

  • call function '/1BCDWB/SF00000220'

  • tables

  • it_vbrk = t_vbrk

  • it_kna1 = t_kna1

  • it_vbrp = t_vbrp

  • it_makt = t_makt

  • it_vbak = t_vbak

  • exceptions

  • formatting_error = 1

  • internal_error = 2

  • send_error = 3

  • user_canceled = 4

  • others = 5.

  • if sy-subrc <> 0.

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

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

  • endif.

call function '/1BCDWB/SF00000263'

tables

it_vbrk = t_vbrk

it_kna1 = t_kna1

it_vbrp = t_vbrp

it_makt = t_makt

it_vbak = t_vbak

exceptions

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

others = 5.

if sy-subrc <> 0.

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

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

endif.

Former Member
0 Kudos

Hi subash,

Please see the driver program code below. It is very simple one.

report  zsmartformsv1                           .
tables:likp.
data:v_fname type rs38l_fnam,
     v_string(10) type c value 'Smartforms'.

types:begin of typ_deliv,
       vbeln type vbeln_vl,
       posnr type posnr_vl,
       matnr type matnr,
       lfimg type lfimg,
       meins type meins,
       maktx type maktx,
     end of typ_deliv.

data: itab type standard table of typ_deliv with header line.
selection-screen:begin of block blk1 with frame title text-001.
select-options:s_vbeln for likp-vbeln.
selection-screen:end of block blk1.

select a~vbeln
       b~posnr
       b~matnr
       b~lfimg
       b~meins
       c~maktx
       into table itab
       from likp as a
       inner join lips as b on a~vbeln = b~vbeln
       inner join makt as c on b~matnr = c~matnr
       where a~vbeln in s_vbeln and
             c~spras = sy-langu.

data v_formname type rs38l_fnam.

call function 'SSF_FUNCTION_MODULE_NAME'
  exporting
    formname                 = 'ZSMARTFORMSV1'
*   VARIANT                  = ' '
*   DIRECT_CALL              = ' '
 importing
   fm_name                  = v_formname
* 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.

call function '/1BCDWB/SF00000781'
* EXPORTING
*   ARCHIVE_INDEX              =
*   ARCHIVE_INDEX_TAB          =
*   ARCHIVE_PARAMETERS         =
*   CONTROL_PARAMETERS         =
*   MAIL_APPL_OBJ              =
*   MAIL_RECIPIENT             =
*   MAIL_SENDER                =
*   OUTPUT_OPTIONS             =
*   USER_SETTINGS              = 'X'
* IMPORTING
*   DOCUMENT_OUTPUT_INFO       =
*   JOB_OUTPUT_INFO            =
*   JOB_OUTPUT_OPTIONS         =
  tables
    itab                       = itab
* EXCEPTIONS
*   FORMATTING_ERROR           = 1
*   INTERNAL_ERROR             = 2
*   SEND_ERROR                 = 3
*   USER_CANCELED              = 4
*   OTHERS                     = 5
          .
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.

Thanks,

Suma.

Former Member
0 Kudos

hi subash i will send one example program if u need more help i will tell u?

REPORT ZBABUSMORTFORMS2 .

tables kna1.

Data : it_tab like table of kna1,

FM_NAME TYPE RS38L_FNAM.

select-options kunnr for kna1-kunnr.

select * from kna1 into table it_tab where kunnr in kunnr.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'ZBABU_SMARTFORM2'

IMPORTING

FM_NAME = fm_name

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

CALL FUNCTION fm_name

TABLES

IT_KNA1 = it_tab

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5 .