Application Development 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: 

CALL_FUNCTION_CONFLICT_TAB_TYPE error

Former Member
0 Kudos

HI,

I have added a field CINFO of type KDMAT in an existing structure. After that I created a table type which is of line type of this structure .Now while executing the program I am getting the error CALL_FUNCTION_CONFLICT_TAB_TYPE ,

Please suggest what can be the problem

10 REPLIES 10

raja_thangamani
Active Contributor
0 Kudos

Loot tcode ST22 will show what went wrong. Also post your code here

Raja T

Former Member
0 Kudos

Manik,

What i feel is this structure might have used by other programs.

Pls. mark if useful.

0 Kudos

no ,that structure in not used any where else,

actully for modifying a program i copied the program and created the new structure just like the original program has used and added an additional field in the structure.

REPORT zsd_ssf_driver_xport_invoice1 .

TABLES:

vbrk,

vbrp,

vbpa,

vbfa,

vbak,

vbap,

likp,

konv,

t001,

t001w,

t005t,

t005u,

kna1,

adrc,

a537,

konp.

DATA : BEGIN OF t_a537 OCCURS 0,

lifnr LIKE a537-lifnr,

matnr LIKE a537-matnr,

knumh LIKE a537-knumh,

END OF t_a537.

TYPES: BEGIN OF typ_litem ,

posnr LIKE vbrp-posnr,

mno(20),

pack(20),

matnr LIKE vbrp-matnr,

  • arktx LIKE vbrp-arktx,

arktx(60),

fkimg LIKE vbrp-fkimg,

netwr LIKE vbrp-netwr,

kdmat LIKE vbap-kdmat,

END OF typ_litem,

BEGIN OF typ_sdoc,

vbeln LIKE vbrp-vbeln,

vgbel LIKE vbrp-vgbel,

aubel LIKE vbrp-aubel,

END OF typ_sdoc,

BEGIN OF typ_pono,

vbeln LIKE vbak-vbeln,

bstnk LIKE vbak-bstnk,

bstdk LIKE vbak-bstdk,

END OF typ_pono,

BEGIN OF typ_term ,

zterm LIKE tvzbt-zterm,

vtext LIKE tvzbt-vtext,

END OF typ_term,

BEGIN OF typ_xadr,

bukrs LIKE t001-bukrs,

name1 LIKE adrc-name1,

name2 LIKE adrc-name2,

street LIKE adrc-street,

city1 LIKE adrc-city1,

post_code1 LIKE adrc-post_code1,

landx LIKE t005t-landx,

END OF typ_xadr,

BEGIN OF typ_cust1,

vbeln LIKE likp-vbeln,

kunnr LIKE kna1-kunnr,

land1 LIKE kna1-land1,

kunag LIKE kna1-kunnr,

name1 LIKE kna1-name1,

name2 LIKE kna1-name2,

name3 LIKE kna1-name3,

name4 LIKE kna1-name4,

stras LIKE kna1-stras,

ort01 LIKE kna1-ort01,

pstlz LIKE kna1-pstlz,

regio LIKE kna1-regio,

bezei LIKE t005u-bezei,

END OF typ_cust1,

BEGIN OF typ_cust2,

kunnr LIKE kna1-kunnr,

land1 LIKE kna1-land1,

name1 LIKE kna1-name1,

name2 LIKE kna1-name2,

name3 LIKE kna1-name3,

name4 LIKE kna1-name4,

stras LIKE kna1-stras,

ort01 LIKE kna1-ort01,

pstlz LIKE kna1-pstlz,

regio LIKE kna1-regio,

bezei LIKE t005u-bezei,

END OF typ_cust2,

      • for sales dealer

BEGIN OF typ_sdel,

vbeln LIKE vbak-vbeln,

lifnr LIKE vbpa-lifnr,

END OF typ_sdel,

BEGIN OF typ_sdname,

lifnr LIKE lfa1-lifnr,

name1 LIKE lfa1-name1,

END OF typ_sdname,

BEGIN OF typ_xhdr,

vbeln LIKE vbrk-vbeln, "invoice number

fkdat LIKE vbrk-fkdat,

inco1 LIKE vbrk-inco1,

inco2 LIKE vbrk-inco2,

waerk LIKE vbrk-waerk,

bukrs LIKE vbrk-bukrs,

zterm LIKE vbrk-zterm,

sordno LIKE vbak-vbeln, " sales doc number

delno LIKE likp-vbeln,

      • Suporting manufacturer for xport invoice1

      • Partner function CR

lifnr LIKE vbpa-lifnr,

svname LIKE lfa1-name1,

xref(20),

bstnk LIKE vbak-bstnk,

bstdk LIKE vbak-bstdk,

oref(132),

pcby(25),

prc(25),

vfno LIKE t173t-bezei,

pload(25),

pdis(50),

vtext(50),

cname1(40),

cname2(40),

cstreet(35),

ccity(35),

cpcode(10),

clandx(15),

ctel_no(16),

kunag(10),

kunnr(10),

tname1(40),

tname2(40),

tname3(40),

tname4(40),

tstras(35),

tort01(35),

tpstlz(10),

tlandx(20),

oname1(40),

oname2(40),

oname3(40),

oname4(40),

ostras(35),

oort01(35),

opstlz(10),

olandx(20),

gtot LIKE vbrp-netwr,

zf00 LIKE vbrp-netwr,

zinp LIKE vbrp-netwr,

amt_word(160),

ctext(200),

fobval LIKE vbrp-netwr,

END OF typ_xhdr.

DATA: t_output_options TYPE ssfcompop OCCURS 0 WITH HEADER LINE,

t_control_parameters TYPE ssfctrlop OCCURS 0 WITH HEADER LINE ,

fm_name1 TYPE rs38l_fnam,

language TYPE sflangu,

t_xhdr TYPE typ_xhdr OCCURS 0 WITH HEADER LINE ,

t_sdoc TYPE typ_sdoc OCCURS 0 WITH HEADER LINE ,

t_pono TYPE typ_pono OCCURS 0 WITH HEADER LINE ,

t_xadr TYPE typ_xadr OCCURS 0 WITH HEADER LINE ,

t_term TYPE typ_term OCCURS 0 WITH HEADER LINE ,

t_cust1 TYPE typ_cust1 OCCURS 0 WITH HEADER LINE ,

t_cust2 TYPE typ_cust2 OCCURS 0 WITH HEADER LINE ,

t_sdel TYPE typ_sdel OCCURS 0 WITH HEADER LINE,

t_sdname TYPE typ_sdname OCCURS 0 WITH HEADER LINE,

t_header LIKE zsd_struct_packing_list1 OCCURS 0 WITH HEADER LINE,

<b>t_item TYPE ZSD_TABTYP_PACKING_LIST_ITEM1,

wa_item LIKE zsd_struct_packing_list_item2,

</b> t_litem TYPE typ_litem OCCURS 0 WITH HEADER LINE,

slno TYPE i VALUE 0,

totlin TYPE i VALUE 0,

mslines LIKE tline OCCURS 1 WITH HEADER LINE,

tidno LIKE stxl-tdid,

tname LIKE stxl-tdname,

tobjt LIKE stxl-tdobject,

word LIKE spell,

n_amount(12) TYPE p DECIMALS 2,

chk_date TYPE sy-datum,

desc4(35),

desc1(132),

desc2(132),

  • DESC3 TYPE ZSD_STRUCT_PACKING_LIST_ITEM-ARKTX,

condno LIKE vbrk-knumv,

cval LIKE konv-kbetr,

gtot LIKE vbrp-netwr,

tzf00 LIKE vbrp-netwr,

tzinp LIKE vbrp-netwr,

tot LIKE vbrp-netwr,

plant LIKE vbrp-werks,

ckey LIKE vbrk-waerk,

sordno LIKE vbak-vbeln,

delno LIKE likp-vbeln,

invno LIKE vbrk-vbeln,

BEGIN OF t_xhdr1 OCCURS 0,

vbeln LIKE vbrk-vbeln,

fksto LIKE vbrk-fksto,

END OF t_xhdr1.

***

DATA : posn TYPE vbap-posnr VALUE '000010',

supv TYPE vbpa-parvw VALUE 'SP' ,

unld TYPE vbpa-parvw VALUE 'WE',

mode TYPE likp-vsart.

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

SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.

SELECT-OPTIONS: s_invno FOR vbrk-vbeln OBLIGATORY.

SELECTION-SCREEN END OF BLOCK blk1.

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

INITIALIZATION.

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

CLEAR: t_header, slno.

REFRESH t_item.

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

AT SELECTION-SCREEN.

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

SELECT vbeln

INTO TABLE t_xhdr1

FROM vbrk

WHERE vbeln IN s_invno

AND fksto NE 'X'.

IF sy-subrc NE 0.

MESSAGE e002(zmsg).

ENDIF.

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

START-OF-SELECTION.

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

t_output_options-tdcopies = 5.

t_output_options-TDDEST = 'LP01'.

PERFORM get_header_info.

DATA records TYPE i VALUE 0.

DESCRIBE TABLE t_xhdr LINES records.

LOOP AT t_xhdr INTO t_xhdr .

CLEAR t_control_parameters.

IF records EQ 1.

t_control_parameters-no_open = ' '.

t_control_parameters-no_close = ' '.

t_control_parameters-no_dialog = ' '.

APPEND t_control_parameters.

ELSE.

CASE sy-tabix.

WHEN 1.

t_control_parameters-no_open = ' '.

t_control_parameters-no_close = 'X'.

t_control_parameters-no_dialog = ' '.

APPEND t_control_parameters.

WHEN records.

t_control_parameters-no_open = 'X'.

t_control_parameters-no_close = ' '.

t_control_parameters-no_dialog = 'X'.

APPEND t_control_parameters.

WHEN OTHERS.

t_control_parameters-no_open = 'X'.

t_control_parameters-no_close = 'X'.

t_control_parameters-no_dialog = 'X'.

APPEND t_control_parameters.

ENDCASE.

ENDIF.

ckey = t_xhdr-waerk.

t_header-invno = t_xhdr-vbeln.

t_header-invdat = t_xhdr-fkdat.

t_header-inco1 = t_xhdr-inco1.

t_header-inco2 = t_xhdr-inco2.

t_header-waerk = t_xhdr-waerk.

      • Exporter Address

t_header-ename1 = t_xhdr-cname1.

t_header-ename2 = t_xhdr-cname2.

t_header-estreet = t_xhdr-cstreet.

t_header-ecity = t_xhdr-ccity.

t_header-epcode = t_xhdr-cpcode.

t_header-ecountry = t_xhdr-clandx.

      • Consignee

t_header-cname1 = t_xhdr-tname1.

t_header-cname2 = t_xhdr-tname2.

t_header-cname3 = t_xhdr-tname3.

t_header-cname4 = t_xhdr-tname4.

t_header-cstreet = t_xhdr-tstras.

t_header-ccity = t_xhdr-tort01.

t_header-cpcode = t_xhdr-tpstlz.

t_header-ccountry = t_xhdr-tlandx.

      • Buyer if any

t_header-xname1 = t_xhdr-oname1.

t_header-xname2 = t_xhdr-oname2.

t_header-xname3 = t_xhdr-oname3.

t_header-xname4 = t_xhdr-oname4.

t_header-xstreet = t_xhdr-ostras.

t_header-xcity = t_xhdr-oort01.

t_header-xpcode = t_xhdr-opstlz.

t_header-xcountry = t_xhdr-olandx.

t_header-xref = t_xhdr-xref.

t_header-pordno = t_xhdr-bstnk.

t_header-porddat = t_xhdr-bstdk.

t_header-oref = t_xhdr-oref.

t_header-pcby = t_xhdr-pcby.

t_header-prc = t_xhdr-prc.

t_header-pload = t_xhdr-pload.

t_header-pdis = t_xhdr-pdis.

t_header-terms = t_xhdr-vtext.

      • Sales Order Text

t_header-ctext = t_xhdr-ctext.

REFRESH t_litem.

PERFORM get_line_items.

      • Added on 11072005

PERFORM get_fob_value.

t_header-zf00 = t_xhdr-zf00.

t_header-zinp = t_xhdr-zinp.

t_header-gtot = t_xhdr-gtot.

t_header-amt_word = t_xhdr-amt_word.

      • Get mode of transport from LIKP table

SELECT SINGLE vsart INTO mode FROM likp WHERE vbeln = t_xhdr-delno.

      • FOB Value calculation

IF mode = '04'.

t_header-fobval = ( t_header-gtot + t_xhdr-fobval ) / 2.

ELSEIF mode = '02'.

t_header-fobval = gtot.

ENDIF.

      • Vessel/Flight No

      • Mode of transport has to be picked up from LIKP

SELECT SINGLE bezei INTO t_xhdr-vfno

FROM t173t

WHERE spras = sy-langu AND

vsart = mode.

IF sy-subrc = 0.

t_header-vfno = t_xhdr-vfno.

ENDIF.

          • Added Supporting Manufacturer**************

t_header-supmanuf = t_xhdr-lifnr.

t_header-svname = t_xhdr-svname.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZSD_SSF_XPORT_INVOICE1'

  • VARIANT = ' '

  • DIRECT_CALL = ' '

IMPORTING

fm_name = fm_name1

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 fm_name1

EXPORTING

mode = mode

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

control_parameters = t_control_parameters

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

output_options = t_output_options

user_settings = 'X'

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

t_header = t_header "STRUCTURE

t_item = t_item "TABLE TYPE

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.

CLEAR: t_xhdr,

t_item,

t_header,

gtot.

ENDLOOP.

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

  • FORM GET_HEADER_INFO.

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

FORM get_header_info.

SELECT vbeln fkdat inco1 inco2 waerk bukrs vkorg

vtweg spart zterm kunag

INTO CORRESPONDING FIELDS OF TABLE t_xhdr

FROM vbrk

WHERE vbeln IN s_invno.

SELECT vbeln vgbel aubel

INTO TABLE t_sdoc

FROM vbrp

FOR ALL ENTRIES IN t_xhdr

WHERE vbeln = t_xhdr-vbeln.

      • Header table loop starts here

LOOP AT t_xhdr.

READ TABLE t_sdoc WITH KEY vbeln = t_xhdr-vbeln.

IF sy-subrc EQ 0.

MOVE t_sdoc-vgbel TO t_xhdr-delno. "delivery no

MOVE t_sdoc-aubel TO t_xhdr-sordno. " sales ord no

MODIFY t_xhdr.

ENDIF.

  • Exporter Ref

tidno = 'Z017'.

tname = t_xhdr-delno.

tobjt = 'VBBK'.

PERFORM findtext.

LOOP AT mslines.

t_xhdr-xref = mslines-tdline(50).

EXIT.

ENDLOOP.

  • Other's Ref

tidno = 'Z018'.

tname = t_xhdr-delno.

tobjt = 'VBBK'.

PERFORM findtext.

LOOP AT mslines.

t_xhdr-oref = mslines-tdline(50).

EXIT.

ENDLOOP.

  • Pre-Carraige By

tidno = 'Z019'.

tname = t_xhdr-delno.

tobjt = 'VBBK'.

PERFORM findtext.

LOOP AT mslines.

t_xhdr-pcby = mslines-tdline(50).

EXIT.

ENDLOOP.

  • Place Of reciept by Pre-Carraige

tidno = 'Z020'.

tname = t_xhdr-delno.

tobjt = 'VBBK'.

PERFORM findtext.

LOOP AT mslines.

t_xhdr-prc = mslines-tdline(50).

EXIT.

ENDLOOP.

  • Vessel/Flight No

  • tidno = 'Z021'.

  • tname = t_xhdr-delno.

  • tobjt = 'VBBK'.

  • PERFORM findtext.

*

  • LOOP AT mslines.

  • t_xhdr-vfno = mslines-tdline(50).

  • EXIT.

  • ENDLOOP.

  • Port Of Loading

  • tidno = 'Z022'.

  • tname = t_xhdr-delno.

  • tobjt = 'VBBK'.

  • PERFORM findtext.

  • LOOP AT mslines.

  • t_xhdr-pload = mslines-tdline(50).

  • EXIT.

  • ENDLOOP.

      • Port of discharge has to be displayed from Delivery -> Shipment

      • Likp-traid

SELECT SINGLE traid INTO t_xhdr-pload

FROM likp WHERE vbeln = t_xhdr-delno.

  • Port Of Discharge

      • have to get from exporter name T_HEADER-ENAME1

  • SELECT SINGLE ablad INTO t_xhdr-pdis

  • FROM knva WHERE kunnr = t_xhdr-kunag.

SELECT SINGLE * FROM likp WHERE vbeln = t_xhdr-delno.

SELECT SINGLE ablad INTO t_xhdr-pdis

FROM vbpa WHERE vbeln = t_xhdr-sordno AND

parvw = unld AND

kunnr = likp-kunnr.

  • TIDNO = 'Z027'.

  • TNAME = T_XHDR-DELNO.

  • TOBJT = 'VBBK'.

  • PERFORM FINDTEXT.

  • LOOP AT MSLINES.

  • SELECT SINGLE adlab FROM knva

  • t_xhdr-pdis = mslines-tdline(50).

  • EXIT.

  • ENDLOOP.

      • get sales order CUSTUM text

tidno = '0001'.

CONCATENATE t_xhdr-sordno posn

  • t_litem-posnr

INTO tname.

tobjt = 'VBBP'.

PERFORM findtext.

LOOP AT mslines.

CONCATENATE t_xhdr-ctext mslines-tdline INTO t_xhdr-ctext.

  • EXIT.

ENDLOOP.

MODIFY t_xhdr.

ENDLOOP.

      • Header loop ends here

SELECT vbeln bstnk bstdk

INTO TABLE t_pono

FROM vbak

FOR ALL ENTRIES IN t_xhdr

WHERE vbeln = t_xhdr-sordno.

LOOP AT t_xhdr.

READ TABLE t_pono WITH KEY vbeln = t_xhdr-sordno.

IF sy-subrc EQ 0.

MOVE t_pono-bstnk TO t_xhdr-bstnk.

MOVE t_pono-bstdk TO t_xhdr-bstdk.

MODIFY t_xhdr.

ENDIF.

ENDLOOP.

  • Terms Of Delivery & Payment

SELECT zterm vtext

INTO TABLE t_term

FROM tvzbt

FOR ALL ENTRIES IN t_xhdr

WHERE zterm = t_xhdr-zterm

AND spras EQ 'E'.

LOOP AT t_xhdr.

READ TABLE t_term WITH KEY zterm = t_xhdr-zterm.

IF sy-subrc EQ 0.

MOVE t_term-vtext TO t_xhdr-vtext.

MODIFY t_xhdr.

ENDIF.

ENDLOOP.

  • Exporter Address

SELECT t1bukrs acname1 acname2 acstreet ac~city1

acpost_code1 t5landx

INTO TABLE t_xadr

FROM t001 AS t1

INNER JOIN adrc AS ac

ON acaddrnumber EQ t1adrnr

INNER JOIN t005t AS t5

ON t5~spras = 'E'

AND t5land1 = accountry

FOR ALL ENTRIES IN t_xhdr

WHERE t1~bukrs = t_xhdr-bukrs.

LOOP AT t_xhdr.

READ TABLE t_xadr WITH KEY bukrs = t_xhdr-bukrs.

IF sy-subrc EQ 0.

MOVE t_xadr-name1 TO t_xhdr-cname1.

MOVE t_xadr-name2 TO t_xhdr-cname2.

MOVE t_xadr-street TO t_xhdr-cstreet.

MOVE t_xadr-city1 TO t_xhdr-ccity.

MOVE t_xadr-post_code1 TO t_xhdr-cpcode.

MOVE t_xadr-landx TO t_xhdr-clandx.

MODIFY t_xhdr.

ENDIF.

ENDLOOP.

SELECT lkvbeln lkkunnr k1land1 lkkunag k1name1 k1name2

k1name3 k1name4 k1stras k1ort01 k1pstlz t5bezei

INTO CORRESPONDING FIELDS OF TABLE t_cust1

FROM likp AS lk

INNER JOIN kna1 AS k1

ON k1kunnr = lkkunag

INNER JOIN t005u AS t5

ON t5~spras = 'EN'

AND t5land1 = k1land1

AND t5bland = k1regio

FOR ALL ENTRIES IN t_xhdr

WHERE lk~vbeln = t_xhdr-delno.

LOOP AT t_xhdr.

READ TABLE t_cust1 WITH KEY vbeln = t_xhdr-delno.

IF sy-subrc EQ 0.

MOVE t_cust1-kunag TO t_xhdr-kunag.

MOVE t_cust1-kunnr TO t_xhdr-kunnr.

MOVE t_cust1-name1 TO t_xhdr-tname1.

MOVE t_cust1-name2 TO t_xhdr-tname2.

MOVE t_cust1-name3 TO t_xhdr-tname3.

MOVE t_cust1-name4 TO t_xhdr-tname4.

MOVE t_cust1-stras TO t_xhdr-tstras.

MOVE t_cust1-ort01 TO t_xhdr-tort01.

MOVE t_cust1-pstlz TO t_xhdr-tpstlz.

MOVE t_cust1-ort01 TO t_xhdr-tlandx.

MODIFY t_xhdr.

ENDIF.

ENDLOOP.

*********selecting supporting vendor code**********

IF t_xhdr[] IS NOT INITIAL.

SELECT pvbeln plifnr

FROM vbpa AS p INNER JOIN vbrp AS v

ON vaubel = pvbeln

INTO TABLE t_sdel

FOR ALL ENTRIES IN t_xhdr

WHERE p~vbeln = t_xhdr-sordno "sales odr no

AND p~parvw = supv.

LOOP AT t_xhdr.

READ TABLE t_sdel WITH KEY vbeln = t_xhdr-sordno.

IF sy-subrc = 0.

MOVE t_sdel-lifnr TO t_xhdr-lifnr.

MODIFY t_xhdr.

ENDIF.

CLEAR : t_xhdr,t_sdel.

ENDLOOP.

ENDIF.

      • select the name of the supporting vendor

IF t_xhdr[] IS NOT INITIAL.

SELECT lifnr

name1

FROM lfa1

INTO TABLE t_sdname

FOR ALL ENTRIES IN t_xhdr

WHERE lifnr = t_xhdr-lifnr.

LOOP AT t_xhdr.

READ TABLE t_sdname WITH KEY lifnr = t_xhdr-lifnr.

IF sy-subrc = 0.

MOVE t_sdname-name1 TO t_xhdr-svname.

MODIFY t_xhdr.

ENDIF.

CLEAR : t_xhdr,t_sdname.

ENDLOOP.

ENDIF.

        • supporting dealear ends here****************

SELECT k1kunnr k1name1 k1name2 k1name3

k1name4 k1stras k1ort01 k1pstlz t5~bezei

INTO CORRESPONDING FIELDS OF TABLE t_cust2

FROM kna1 AS k1

INNER JOIN t005u AS t5

ON t5~spras = 'EN'

AND t5land1 = k1land1

AND t5bland = k1regio

FOR ALL ENTRIES IN t_xhdr

WHERE k1~kunnr = t_xhdr-kunnr.

LOOP AT t_xhdr.

READ TABLE t_cust2 WITH KEY kunnr = t_xhdr-kunnr.

IF sy-subrc EQ 0.

MOVE t_cust2-name1 TO t_xhdr-oname1.

MOVE t_cust2-name2 TO t_xhdr-oname2.

MOVE t_cust2-name3 TO t_xhdr-oname3.

MOVE t_cust2-name4 TO t_xhdr-oname4.

MOVE t_cust2-stras TO t_xhdr-ostras.

MOVE t_cust2-ort01 TO t_xhdr-oort01.

MOVE t_cust2-pstlz TO t_xhdr-opstlz.

MOVE t_cust2-bezei TO t_xhdr-olandx.

MODIFY t_xhdr.

ENDIF.

ENDLOOP.

ENDFORM. "GET_HEADER_INFO

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

*FORM GET_LINE_ITEMS.

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

FORM get_line_items.

*LINE ITEMS SECTION

SELECT posnr matnr arktx fkimg netwr

INTO CORRESPONDING FIELDS OF TABLE t_litem

FROM vbrp

WHERE vbeln = t_xhdr-vbeln.

SELECT kdmat

INTO CORRESPONDING FIELDS OF TABLE t_litem

FROM vbap

WHERE vbeln = t_xhdr-vbeln.

LOOP AT t_litem INTO t_litem.

*Mark/Case No

tidno = '0002'.

CONCATENATE t_xhdr-delno

t_litem-posnr

INTO tname.

tobjt = 'VBBP'.

PERFORM findtext.

LOOP AT mslines.

wa_item-mno = mslines-tdline(40).

EXIT.

ENDLOOP.

*Packing Type

tidno = '0003'.

CONCATENATE t_xhdr-delno

t_litem-posnr

INTO tname.

tobjt = 'VBBP'.

PERFORM findtext.

LOOP AT mslines.

wa_item-pack = mslines-tdline(40).

EXIT.

ENDLOOP.

*Goods Description

wa_item-partno = t_litem-matnr.

wa_item-pdesc = t_litem-arktx.

*Customer Info

wa_item-cinfo = t_litem-kdmat.

*Goods Quantity

wa_item-qty = t_litem-fkimg.

  • WA_ITEM-VRKME = LIPS-VRKME.

        • Marked by Binita on 17.10 on rEQUEST OF AVTAR /JAYESH

*Goods Amount & rate

        • wa_item-amount = t_litem-netwr.

        • wa_item-rate = t_litem-netwr / t_litem-fkimg.

SELECT SINGLE knumv INTO vbrk-knumv FROM vbrk

WHERE vbeln = t_xhdr-vbeln.

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

*ADDED BY BINITA ON 12.12.2005 pARTS eXPORT iNVOICE D01K909869

SELECT SINGLE kbetr

INTO konv-kbetr

FROM konv

WHERE knumv = vbrk-knumv

AND kposn = t_litem-posnr

AND kschl = 'ZPA1'.

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

*ADDED BY BINITA ON 17.10.2005 FOR EXPORT iNVOICE

***/ PUNE - Changed from = 'ZPR1' in delhi

  • to kschl = 'ZPR4'

  • By Sunil H.

SELECT SINGLE kbetr

INTO konv-kbetr

FROM konv

WHERE knumv = vbrk-knumv

AND kposn = t_litem-posnr

AND kschl = 'ZPR4'.

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

wa_item-rate = konv-kbetr.

wa_item-qty = t_litem-fkimg.

n_amount = wa_item-qty * wa_item-rate.

wa_item-amount = n_amount.

n_amount = 0.

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

  • D01K908565 changes

SELECT SINGLE fkart INTO vbrk-fkart FROM vbrk

WHERE vbeln = t_xhdr-vbeln.

IF vbrk-fkart = 'ZXFR'.

SELECT SINGLE kwert INTO konv-kwert

FROM konv

WHERE knumv = vbrk-knumv

AND kposn = t_litem-posnr

AND kschl = 'ZPR2'.

wa_item-amount = konv-kwert.

CLEAR konv-kwert.

ENDIF.

  • D01K908565 changes end

SELECT SINGLE kwert INTO konv-kwert

FROM konv

WHERE knumv = vbrk-knumv

AND kposn = t_litem-posnr

AND kschl = 'ZF00'.

tzf00 = tzf00 + konv-kwert.

CLEAR konv-kwert.

SELECT SINGLE kwert INTO konv-kwert

FROM konv

WHERE knumv = vbrk-knumv

AND kposn = t_litem-posnr

AND kschl = 'ZINP'.

tzinp = tzinp + konv-kwert.

gtot = gtot + wa_item-amount .

APPEND wa_item TO t_item.

CLEAR wa_item.

CLEAR konv-kwert.

ENDLOOP.

t_xhdr-zf00 = tzf00.

t_xhdr-zinp = tzinp.

t_xhdr-gtot = gtot + tzf00 + tzinp.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

amount = t_xhdr-gtot

currency = ckey

  • FILLER = ' '

language = sy-langu

IMPORTING

in_words = word

EXCEPTIONS

not_found = 1

too_large = 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.

t_xhdr-amt_word = word-word.

CONCATENATE t_xhdr-amt_word 'AND' word-decword 'PENSE'

INTO t_xhdr-amt_word SEPARATED BY space.

MODIFY t_xhdr.

CLEAR: tzf00, tzinp.

ENDFORM. "GET_LINE_ITEMS

&----


*& Form FINDTEXT

&----


  • text

----


FORM findtext.

REFRESH mslines.

CALL FUNCTION 'READ_TEXT'

EXPORTING

client = sy-mandt

id = tidno

language = sy-langu

name = tname

object = tobjt

TABLES

lines = mslines

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8.

DELETE mslines WHERE tdline IS INITIAL.

ENDFORM. "FINDTEXT

&----


*& Form get_fob_value

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM get_fob_value .

***Added date chk for 31.12.9999 on on 1.12.2005 becoz there was no

**valuein production for lovem_ko field.As result Fob value was

**calculating wrong for CFR .It was considering all pricing for an item

**defined till date .

chk_date = '31129999'.

SELECT lifnr

matnr

knumh

FROM a537 INTO TABLE t_a537

FOR ALL ENTRIES IN t_litem

WHERE lifnr = t_xhdr-lifnr AND

matnr = t_litem-matnr and

datab LE SY-DATUM and

datbi GE sy-datum.

LOOP AT t_a537.

READ TABLE t_litem WITH KEY matnr = t_a537-matnr.

SELECT SINGLE * FROM konp WHERE knumh = t_a537-knumh and

loevm_ko NE 'X' .

IF sy-subrc = 0.

t_xhdr-fobval = t_xhdr-fobval + konp-kbetr * t_litem-fkimg.

ENDIF.

ENDLOOP.

ENDFORM. " get_fob_value

There was structure called zsd_struct_packing_list_item, i created zsd_struct_packing_list_item2 just like that and added one field , also i created a table type of the new structure, now after execution i m getiing this error

0 Kudos

Hi,

In smartform->FormInterface->Tables

t_item like zsd_struct_packing_list_item1

0 Kudos

Hi,

I observed one more thing.

You are appending

APPEND wa_item TO t_item.

But the types of wa_item and t_item are diffrent.

data : t_item TYPE ZSD_TABTYP_PACKING_LIST_ITEM1,

wa_item LIKE zsd_struct_packing_list_item2.

Whatever table parameters you are passing from program,it should present in dictionary(SE11) either as table or structure.

0 Kudos

here ZSD_TABTYP_PACKING_LIST_ITEM1 is table type of zsd_struct_packing_list_item2

0 Kudos

I have already defined the structure and the table type in the dictionary

0 Kudos

Hey guys its working now, thanks a lot for all ur help

0 Kudos

Hi,

Could you reward points for all useful answers by clicking the star next to reply?

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

You are passing tlitem to smartform.For passing a table in smartform,you need the table to be defined globally in SE11.Define a structure which consists of components as mentioned in typ_litem.If both zsd_struct_packing_list_item2 and typ_litem are same,just use zsd_struct_packing_list_item2 while declaring tlitem

data tlitem type standard table of zsd_struct_packing_list_item2 .

Kindly reward points by clicking the star on the left of reply,if it helps.Hope it will solve the problem.

Jayanthi Jayaraman