cancel
Showing results for 
Search instead for 
Did you mean: 

field T_STCD1 does not exist in form this erroe msg coming in smartform

Former Member
0 Kudos

hi,

in my smartform, if i give one set of input like, 1st qtr of 2008, vendor and compcode, its displaying the value.

but if i give the input like 1st qtr of 2007, vendor and some other compcode its giving some error like

field T_STCD1 does not exist in form .

this error coming after printpreview and not displaying.

how can i debug it.

can any one help me...........plz

its very urgent.

thanks.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

hi,

Following error is coming up in my smartform.

Field T_STCD1 does not exist in form.

Message no. SSFCOMPOSER604

msg num is 604.

can any body guide me how to correct this one.

thanks

Santosini

Former Member
0 Kudos

hi pk ,

are u getting anything from this code?

i mean why this error is coming for one input and alright for other input.

******************************************

any one else is there. plz help me.

*****************************************

thanks

Santosini

former_member184657
Active Contributor
0 Kudos

ok my guess wud be that, the error u are getting wud be coz,

u are selecting certain dates from the year 2007.

now that wud mean a diff financial year. usually all documents number have the same number series for all financial years. and the check is made against the respective financial year.

sorry i do not have the time to go thru all that code right now. but i'll certainly look into it at a later time.

for the meanwhile, try to check for the financial year thingy.

gudluck...

pk

Former Member
0 Kudos

report zmm_vat_ex_cert message-id zz .

************************************************************************

  • TABLE DECLARATION *

************************************************************************

tables: bseg , tvko.

***********************************************************************

*Intenal Tables Declarations *

************************************************************************

types: begin of it_address_type .

include structure zvat_vendor.

types :end of it_address_type.

types : begin of it_address_info_type.

include structure zadrc_table.

types: end of it_address_info_type.

types : begin of it_desig_type.

include structure zmm_vat_sign.

types: end of it_desig_type.

types: begin of it_bkpf_type,

bukrs type bkpf-bukrs,

belnr type bkpf-belnr,

gjahr type bkpf-gjahr,

blart type bkpf-blart,

bldat type bkpf-bldat,

xblnr type bkpf-xblnr,

awkey type bkpf-awkey ,

end of it_bkpf_type.

types : begin of it_bseg_type,

bukrs like bseg-bukrs,

belnr like bseg-belnr,

gjahr like bseg-gjahr,

bschl like bseg-bschl,

mwskz like bseg-mwskz,

shkzg like bseg-shkzg,

wrbtr like bseg-wrbtr,

sgtxt type bseg-sgtxt,

end of it_bseg_type.

types: begin of it_rseg_type,

ebeln like ekpo-ebeln,

ebelp like ekpo-ebelp,

bukrs like bkpf-bukrs,

txz01 type ekpo-txz01,

wrbtr type rseg-wrbtr,

end of it_rseg_type.

data:begda type d, endda type d.

types: begin of it_item_type.

include structure zitem_vat.

types:end of it_item_type.

data: it_rseg type table of it_rseg_type,

wa_it_rseg like line of it_rseg.

data: gt_addr type table of it_address_type.

data gt_addr_info type table of it_address_info_type.

data gt_bkpf type table of it_bkpf_type.

data gt_bseg type table of it_bseg_type.

data:

gt_tvko type standard table of tvko,

gt_item type table of it_item_type,

h_itab type table of it_bseg_type,

it_desig type table of it_desig_type,

temp_item type table of it_item_type .

data:wa_addr like line of gt_addr,

wa_addr_info like line of gt_addr_info,

wa_bkpf like line of gt_bkpf,

wa_bseg like line of gt_bseg,

wa_item like line of gt_item,

wa_h_itab like line of h_itab,

wa_it_desig like line of it_desig,

wa_temp_item like line of temp_item,

  • wa_tvko LIKE LINE OF gt_tvko.

wa_tvko type tvko.

----


  • Data Declaration *

----


data: sumtotal type bseg-wrbtr, "rbkp-waers ,

sl_no type zmm_vatex_sno-serial_no,

fiscal_year type string,

fm_name type rs38l_fnam ,

w_q_flag(5),

w_quarter type string ,

close_date type sy-datum ,

fiscal type sy-datum, fiscal_nxt type sy-datum,

gv_belnr type bkpf-belnr,

gv_gjahr type bkpf-gjahr.

data: ca_quarter type i.

data: l_adrnr type t001-adrnr.

data wa_vatex_sno type zmm_vatex_sno.

data: q(1).

data: stdtext(25).

----


  • S E L E C T I O N S C R E E N *

----


selection-screen begin of block b1 with frame title text-s01.

select-options: s_date for sy-datum obligatory no-extension.

parameters : vendor type lfa1-lifnr obligatory ,

compcode type bkpf-bukrs obligatory.

select-options taxcode for bseg-mwskz obligatory default 'VI'.

selection-screen end of block b1.

************************************************************************

  • at selection screen

************************************************************************

at selection-screen on s_date.

if s_date-low0(4) <> s_date-high0(4).

message e023 with text-e01.

endif.

*get calendar quarter using the month entered in From date.

*calculate the fiscal year and quarter

if s_date-low4(2) > '0' and s_date-low4(2) <= '3' .

ca_quarter = 1.

fiscal0(4) = s_date-high0(4) .

fiscal_nxt0(4) = s_date-high0(4) - 1.

concatenate fiscal_nxt2(2) '-' fiscal2(2) into fiscal_year .

concatenate 'last quarter of year ' fiscal_nxt0(4) '-' fiscal0(4)

into w_quarter separated by space .

q = '4'.

elseif ( s_date-low4(2) > '3' and s_date-low4(2) <= '6' ).

ca_quarter = 2.

fiscal0(4) = s_date-high0(4) + 1.

fiscal_nxt0(4) = s_date-high0(4).

concatenate fiscal_nxt2(2) '-' fiscal2(2) into fiscal_year .

concatenate '1st quarter of year ' fiscal_nxt0(4) '-' fiscal0(4)

into w_quarter separated by space .

q = '1'.

elseif ( s_date-low4(2) > '6' and s_date-low4(2) <= '9' ).

ca_quarter = 3.

fiscal0(4) = s_date-high0(4) + 1.

fiscal_nxt0(4) = s_date-high0(4).

concatenate fiscal_nxt2(2) '-' fiscal2(2) into fiscal_year .

concatenate '2nd quarter of year ' fiscal_nxt0(4) '-' fiscal0(4) INTO

w_quarter separated by space .

q = '2'.

elseif ( s_date-low4(2) > '9' and s_date-low4(2) <= '12' ).

ca_quarter = 4.

w_quarter = '3rd quarter of year'.

fiscal0(4) = s_date-high0(4) + 1.

fiscal_nxt0(4) = s_date-high0(4).

concatenate fiscal_nxt2(2) '-' fiscal2(2) into fiscal_year .

concatenate '3rd quarter of year ' fiscal_nxt0(4) '-' fiscal0(4) INTO

w_quarter separated by space .

q = '3'.

endif.

*get first and last day of quarter by fetching calendar quarter and year in FM

call function 'HR_99S_GET_DATES_QUARTER'

exporting

im_quarter = ca_quarter

im_year = s_date-low+0(4)

importing

ex_begda = begda

ex_endda = endda.

*validate the input dates is start and end of quarter

if s_date-low <> begda or s_date-high <> endda.

message e023 with 'Enter quarter begin and end dates only'.

endif.

*get last day of next month. for close date

endda = endda + 1.

call function 'RP_LAST_DAY_OF_MONTHS'

exporting

day_in = endda

importing

last_day_of_month = close_date

exceptions

day_in_no_date = 1

others = 2.

if sy-subrc <> 0.

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

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

endif.

*----


*

  • Start of Selection

*

*----


*

start-of-selection.

*CNO is specific to a Quarter/ Company code/ Vendor.

unpack vendor to vendor.

clear:sl_no, wa_vatex_sno.

select single * from zmm_vatex_sno into wa_vatex_sno where from_date

eq s_date-low and to_date eq s_date-high and vendor eq vendor

and compcode eq compcode.

if sy-subrc eq 0.

sl_no = wa_vatex_sno-serial_no.

else.

select max( serial_no ) from zmm_vatex_sno into wa_vatex_sno-serial_no WHERE

from_date eq s_date-low and to_date eq s_date-high and compcode eQ compcode.

if sy-subrc = 0.

sl_no = wa_vatex_sno-serial_no + 1.

else.

sl_no = 1.

endif.

wa_vatex_sno-from_date = s_date-low.

wa_vatex_sno-to_date = s_date-high.

wa_vatex_sno-vendor = vendor.

wa_vatex_sno-compcode = compcode.

wa_vatex_sno-serial_no = sl_no.

insert zmm_vatex_sno from wa_vatex_sno.

endif.

*data selection from bkpf by date,fiscal and compcode

refresh gt_bkpf.

select bukrs

belnr

gjahr

blart

bldat

xblnr

awkey

into table gt_bkpf from bkpf

where bukrs eq compcode and

budat in s_date and gjahr eq fiscal+0(4).

check not gt_bkpf[] is initial.

refresh gt_bseg.

select bukrs

belnr

gjahr

bschl

mwskz

shkzg

wrbtr

sgtxt from bseg into table gt_bseg

for all entries in gt_bkpf where

bukrs eq compcode and

mwskz in taxcode and

lifnr eq vendor and

belnr = gt_bkpf-belnr and

gjahr = gt_bkpf-gjahr and shkzg = 'H'.

************************************

  • selection without vendor and posting key 40 *

************************************

refresh h_itab.

select bukrs

belnr

gjahr

bschl

mwskz

shkzg

wrbtr from bseg into table h_itab

for all entries in gt_bseg

where bukrs = gt_bseg-bukrs and

belnr = gt_bseg-belnr and

mwskz = gt_bseg-mwskz and

gjahr = gt_bseg-gjahr and

( bschl = '40' or bschl = '21' ).

if sy-subrc = 0.

  • deduct the amount if posting key is 40 for PO based docs

clear wa_h_itab.

loop at h_itab into wa_h_itab where bschl = '40'.

clear wa_bseg.

read table gt_bseg into wa_bseg with key belnr = wa_h_itab-belnr.

if sy-subrc = 0.

read table gt_bkpf into wa_bkpf with key belnr = wa_h_itab-belnr.

if wa_bkpf-blart <> 'KR'.

wa_bseg-wrbtr = wa_bseg-wrbtr - wa_h_itab-wrbtr.

endif.

modify gt_bseg from wa_bseg

transporting wrbtr where belnr = wa_bseg-belnr

and bschl = wa_bseg-bschl .

endif.

clear wa_h_itab.

endloop.

  • deduct the amount if posting key is 21 for non-PO based docs

clear wa_h_itab.

loop at h_itab into wa_h_itab where bschl = '21'.

clear wa_bseg.

read table gt_bseg into wa_bseg with key belnr = wa_h_itab-belnr.

if sy-subrc = 0.

read table gt_bkpf into wa_bkpf with key belnr = wa_h_itab-belnr.

if wa_bkpf-blart = 'KR'.

wa_bseg-wrbtr = wa_bseg-wrbtr - wa_h_itab-wrbtr.

endif.

modify gt_bseg from wa_bseg

transporting wrbtr where belnr = wa_bseg-belnr.

endif.

clear wa_h_itab.

endloop.

endif.

  • final internal table

clear wa_item. refresh gt_item. clear wa_bseg.

loop at gt_bseg into wa_bseg.

read table gt_bkpf into wa_bkpf with key belnr = wa_bseg-belnr .

if sy-subrc = 0.

move :

wa_bkpf-xblnr to wa_item-xblnr,

wa_bkpf-belnr to wa_item-belnr,

wa_bkpf-bldat to wa_item-bldat,

wa_bseg-wrbtr to wa_item-wrbtr.

endif.

*selections for item description

refresh it_rseg.

select ekpoebeln ekpoebelp ekpobukrs txz01 rsegwrbtr

into table it_rseg

from rseg join ekpo

on rsegebeln = ekpoebeln

and rsegebelp = ekpoebelp

and rsegbukrs = ekpobukrs

where rsegbelnr = wa_bkpf-awkey(10) and rseggjahr = wa_bkpf-gjahr AND

ekpo~bukrs = wa_bkpf-bukrs.

if sy-subrc = 0.

loop at it_rseg into wa_it_rseg.

wa_item-txz01 = wa_it_rseg-txz01 .

if sy-tabix <> 1.

  • wa_item-wrbtr = wa_it_rseg-wrbtr .

wa_item-wrbtr = space .

endif.

append wa_item to gt_item.

endloop.

else.

wa_item-txz01 = wa_bseg-sgtxt.

append wa_item to gt_item.

endif.

clear: wa_bseg, wa_item.

endloop.

*if records not found give message.

if gt_item[] is initial.

message e000(vz) with text-x01.

endif.

  • calculate the sumtotal

loop at gt_item into wa_item.

sumtotal = sumtotal + wa_item-wrbtr .

endloop.

*----


*

  • Selecting supplier address *

*----


select single * from tvko into wa_tvko where vkorg = compcode.

  • append wa_tvko to gt_tvko.

if wa_tvko-vkorg = '2014'.

stdtext = 'Z_2014_SOFTEX'.

elseif wa_tvko-vkorg = '2006'.

stdtext = 'Z_2006_SOFTEX'.

else.

stdtext = wa_tvko-txnam_adr.

endif.

select lifnr

name1

name2

ort01

ort02

pfach

stras

regio from lfa1 into table gt_addr

where lifnr eq vendor .

----


  • Selecting sez address *

----


  • SELECT SINGLE adrnr FROM t001 INTO l_adrnr WHERE bukrs EQ compcode.

  • SELECT name1

  • name2

  • city1

  • city2

  • post_code1

  • post_code2

  • street

  • house_num1

  • FROM adrc INTO TABLE gt_addr_info

  • WHERE addrnumber = l_adrnr.

----


  • Information for designation *

----


select * from zmm_vat_sign into table it_desig where company = compcode

.

----


  • Call Function module SSF_FUNCTION_MODULE_NAME *

----


call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = 'ZMM_VAT_EX_CERT'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

importing

fm_name = fm_name

  • 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 module fm_name *

----


call function fm_name

exporting

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

doc_num = sl_no

quarter = w_quarter

date = s_date-high

sumtotal = sumtotal

close_date = close_date

fiscal_year = fiscal_year

ca_quarter = q

text_name = stdtext

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

tables

itab = gt_item

it_address = gt_addr

it_infoaddress = gt_addr_info

it_designation = it_desig

it_tvko = gt_tvko

  • 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

this is a smartform.

for some select option output is coming correctly.

for some other select option this msg is coming,exits .

'field T_STCD1 does not exist in form '.

how i can correct it?

former_member184657
Active Contributor
0 Kudos

pls revert back with ur code..

pk

Former Member
0 Kudos

Hi,

For debugging -

1. Write BREAK POINT in the code window.

2. Put a break point on the call function in the driver program

3. Put a break point in the generated Function module.

OR

1) DEBUG Smart form:

1) One way to debug smart form is to debug the Function Module of that smart forms.

If you want to debug particular smart form node that the solution would be,

insert a "Program Line" just above the node you want to debug and this program line write a normal abap breakpoint.

So whenever you call the smart forms, it will stop at this breakpoint and you can debug onwards.

2) SFTRACE can be used for debugging SMARTFORMS.

Read More here.

http://help.sap.com/saphelp_erp2004/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm

OR

First go to smart form transaction and then press F8, then the windows change to the function of the smart form, then click in display and then click in find, and choose the control program and find a part of the source code and put a break point.

OR

Four ways you can debugging.....

1. place SFTRACE in place where we enter T_CODE and press ENTER.

after that press F8.

2. /H

3 /SH

4.after generating the function module there is a button DEBUGGING

Plz rewards points,

Regards,

Ganesh.