Skip to Content
0
Former Member
Oct 12, 2006 at 11:26 PM

Fields are not poplulating-

37 Views

Hello Experts,

4 of the fields are not populating in the program

SBANK SERIAL

Notification number

KST Repair Level

KSE Repair Level

Can anyone help me with the code snippet..

The program looks like following

_________________*

  • Global structure of list

type-pools: slis.

tables: likp,

lips,

vbfa,

kssk,

klah,

vbak,

mara,

vbrk,

ser01,

vbpa,

  • nast,

zseri,

  • ltap,

  • pa0001,

  • kna1,

objk,

viqmel,

viqmma.

types: begin of i_delivery,

vbeln like likp-vbeln,

posnr like lips-posnr,

kunnr like likp-kunnr,

kunag like likp-kunag,

vkorg like vbak-vkorg,

matnr like lips-matnr,

lfart like likp-lfart,

arktx like vbap-arktx,

vgbel like lips-vgbel,

vgpos like lips-vgpos,

  • posnr like lips-posnr,

pstyv like lips-pstyv,

wadat type likp-wadat,

lfdat type likp-lfdat,

prodh type lips-prodh,

lfimg type lips-lfimg,

vkbur type lips-vkbur,

vkgrp type lips-vkgrp,

mvgr1 type lips-mvgr1,

sernr like objk-sernr,

sernp like objk-sernr,

equnr like equi-equnr,

bstnk like vbak-bstnk,

vbelv like lips-vgbel,

posnv like lips-posnv,

uecha like lips-uecha,

ernam like vbak-ernam,

erdat like vbak-erdat,

serail like lips-serail,

anzsn like lips-anzsn,

auart like vbak-auart ,

netwr like vbap-netwr,

fstno like vbpa-pernr,

fstnm like pa0001-ename,

ename like pa0001-ename,

qname like ltap-qname,

name1 like kna1-name1,

name3 like kna1-name2,

pernr like vbpa-pernr,

aufnr like viqmel-aufnr,

qmnum like viqmel-qmnum,

mngrp like viqmma-mngrp,

qmcod like viqmel-qmcod,

qmcol like viqmma-mncod,

qmgrp like viqmel-qmgrp,

cotxt(20),

end of i_delivery.

  • Global structure of list

*/ Selection and Input Parameters

selection-screen begin of block block2 with frame title text-003.

select-options: s_vkorg for likp-vkorg no intervals,

s_matnr for lips-matnr,

s_kunag for likp-kunag.

select-options: s_werks for lips-werks.

select-options: s_vbeln for vbfa-vbeln,

s_waist for likp-wadat_ist.

select-options: s_vgbel for lips-vgbel.

selection-screen end of block block2.

ranges: r_vbeln for likp-vbeln.

data: gt_fieldcat type slis_t_fieldcat_alv.

data: gt_outtab type i_delivery occurs 0 with header line,

rt_outtab1 type i_delivery occurs 0 with header line,

i_nast type nast occurs 0 with header line,

gt_list_top_of_page type slis_t_listheader,

gt_events type slis_t_event,

gc_formname_top_of_page type slis_formname value 'TOP_OF_PAGE'.

data: g_repid like sy-repid,

g_count like sy-tabix.

data: begin of i_serail occurs 0,

obknr type ser01-obknr,

lief_nr type ser01-lief_nr,

posnr type ser01-posnr,

anzsn type ser01-anzsn,

end of i_serail.

data: begin of i_object_numbers occurs 0,

obknr type objk-obknr,

sernr type objk-sernr,

matnr type objk-matnr,

taser type objk-taser,

equnr type objk-equnr,

end of i_object_numbers.

data: g_save(1) type c,

  • g_default(1) TYPE c,

g_exit(1) type c,

gx_variant like disvariant,

g_variant like disvariant.

data: g_mnkat like viqmma-mnkat,

g_mngrp like viqmma-mngrp.

  • Initialization fieldcatalog

initialization.

g_repid = sy-repid.

perform fieldcat_init using gt_fieldcat[].

move: 'I' to s_vkorg-sign,

'EQ' to s_vkorg-option,

'5090' to s_vkorg-low.

append s_vkorg.

move: 'I' to s_werks-sign,

'EQ' to s_werks-option,

'9000' to s_werks-low.

append s_werks.

g_save = 'A'.

perform variant_init.

  • Get default variant

gx_variant = g_variant.

call function 'REUSE_ALV_VARIANT_DEFAULT_GET'

exporting

i_save = g_save

changing

cs_variant = gx_variant

exceptions

not_found = 2.

if sy-subrc = 0.

  • p_vari = gx_variant-variant.

endif.

*AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.

  • PERFORM f4_for_variant.

*AT SELECTION-SCREEN.

  • PERFORM pai_of_selection_screen.

  • Start of Selection

start-of-selection.

*PERFORM e03_eventtab_build USING gt_events[].

perform select_data tables gt_outtab.

  • Display list

end-of-selection.

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_background_id = 'ALV_BACKGROUND'

i_callback_user_command = 'USER_COMMAND'

is_variant = g_variant

i_save = g_save

i_callback_program = g_repid

it_fieldcat = gt_fieldcat[]

tables

t_outtab = gt_outtab.

*----


  • Forms

*----


  • Initialization fieldcatalog

form fieldcat_init

using rt_fieldcat type slis_t_fieldcat_alv.

data: ls_fieldcat type slis_fieldcat_alv.

data: pos type i value 1.

clear ls_fieldcat.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'VBELN'.

ls_fieldcat-seltext_s = 'Delivery'.

ls_fieldcat-seltext_m = 'Delivery'.

ls_fieldcat-key = 'X'.

append ls_fieldcat to rt_fieldcat.

clear ls_fieldcat.

pos = pos + 1.

  • ls_fieldcat-col_pos = pos.

  • ls_fieldcat-fieldname = 'POSNR'.

  • ls_fieldcat-key = 'X'.

  • ls_fieldcat-seltext_s = 'Item'.

  • ls_fieldcat-seltext_m = 'Item'.

  • APPEND ls_fieldcat TO rt_fieldcat.

  • CLEAR ls_fieldcat.

pos = pos + 1.

ls_fieldcat-col_pos = pos.

ls_fieldcat-fieldname = 'LFART'.

ls_fieldcat-seltext_s = 'Del Type'.

ls_fieldcat-seltext_m = 'Delivery Type'.

append ls_fieldcat to rt_fieldcat.

clear ls_fieldcat.

  • pos = pos + 1.

  • ls_fieldcat-col_pos = pos.

  • ls_fieldcat-fieldname = 'PSTYV'.

  • ls_fieldcat-seltext_s = 'Category'.

  • ls_fieldcat-seltext_m = 'Item Category'.

  • APPEND ls_fieldcat TO rt_fieldcat.

  • CLEAR ls_fieldcat.

  • pos = pos + 1.

  • ls_fieldcat-col_pos = pos.

  • ls_fieldcat-fieldname = 'VGBEL'.

  • ls_fieldcat-seltext_s = 'Source Doc'.

  • ls_fieldcat-seltext_m = 'Source Doc'.

  • APPEND ls_fieldcat TO rt_fieldcat.

  • CLEAR ls_fieldcat.

*

  • pos = pos + 1.

  • ls_fieldcat-col_pos = pos.

  • ls_fieldcat-fieldname = 'AUART'.

  • ls_fieldcat-seltext_s = 'Type'.

  • ls_fieldcat-seltext_m = 'Type'.

  • APPEND ls_fieldcat TO rt_fieldcat.

  • CLEAR ls_fieldcat.

*

  • pos = pos + 1.

  • ls_fieldcat-col_pos = pos.

  • ls_fieldcat-fieldname = 'BSTNK'.

  • ls_fieldcat-seltext_s = 'Cust PO'.

  • ls_fieldcat-seltext_m = 'Customer PO'.

  • APPEND ls_fieldcat TO rt_fieldcat.

  • CLEAR ls_fieldcat.

*

  • pos = pos + 1.

  • ls_fieldcat-col_pos = pos.

  • ls_fieldcat-fieldname = 'KUNNR'.

  • ls_fieldcat-seltext_s = 'Customer'.

  • ls_fieldcat-seltext_m = 'Customer'.

    • APPEND ls_fieldcat TO rt_fieldcat.

    • CLEAR ls_fieldcat.

    *

    • pos = pos + 1.

    • ls_fieldcat-col_pos = pos.

    • ls_fieldcat-fieldname = 'NAME1'.

    • ls_fieldcat-seltext_s = 'Name'.

    • ls_fieldcat-seltext_m = 'Name1'.

    • APPEND ls_fieldcat TO rt_fieldcat.

    • CLEAR ls_fieldcat.

    *

    • pos = pos + 1.

    • ls_fieldcat-col_pos = pos.

    • ls_fieldcat-fieldname = 'KUNAG'.

    • ls_fieldcat-seltext_s = 'Sold-To'.

    • ls_fieldcat-seltext_m = 'Sold-To'.

    • APPEND ls_fieldcat TO rt_fieldcat.

    • CLEAR ls_fieldcat.

    *

    • pos = pos + 1.

    • ls_fieldcat-col_pos = pos.

    • ls_fieldcat-fieldname = 'NAME3'.

    • ls_fieldcat-seltext_s = 'Name'.

    • ls_fieldcat-seltext_m = 'Name'.

    • APPEND ls_fieldcat TO rt_fieldcat.

    • CLEAR ls_fieldcat.

    *

    • pos = pos + 1.

  • ls_fieldcat-col_pos = pos.

  • ls_fieldcat-fieldname = 'PERNR'.

  • ls_fieldcat-seltext_s = 'Rep'.

  • ls_fieldcat-seltext_m = 'Sales Rep'.

  • APPEND ls_fieldcat TO rt_fieldcat.

  • CLEAR ls_fieldcat.

    • pos = pos + 1.

    • ls_fieldcat-col_pos = pos.

    • ls_fieldcat-fieldname = 'ENAME'.

    • ls_fieldcat-seltext_s = 'Rep Name'.

    • ls_fieldcat-seltext_m = 'Rep Name'.

    • APPEND ls_fieldcat TO rt_fieldcat.

    • CLEAR ls_fieldcat.

    • pos = pos + 1.

    • ls_fieldcat-col_pos = pos.

    • ls_fieldcat-fieldname = 'FSTNO'.

    • ls_fieldcat-seltext_s = 'FST'.

    • ls_fieldcat-seltext_m = 'FST No'.

    • APPEND ls_fieldcat TO rt_fieldcat.

    • CLEAR ls_fieldcat.

    *

    • pos = pos + 1.

    • ls_fieldcat-col_pos = pos.

    • ls_fieldcat-fieldname = 'FSTNM'.

    • ls_fieldcat-seltext_s = 'FST Name'.

    • ls_fieldcat-seltext_m = 'FST Name'.

    • APPEND ls_fieldcat TO rt_fieldcat.

    • CLEAR ls_fieldcat.

    *

    • pos = pos + 1.

    • ls_fieldcat-col_pos = pos.

    • ls_fieldcat-fieldname = 'VKBUR'.

    • ls_fieldcat-seltext_s = 'Area'.

    • ls_fieldcat-seltext_m = 'Area'.

    • APPEND ls_fieldcat TO rt_fieldcat.

    • CLEAR ls_fieldcat.

    *

    • pos = pos + 1.

    • ls_fieldcat-col_pos = pos.

    • ls_fieldcat-fieldname = 'VKGRP'.

    • ls_fieldcat-seltext_s = 'Region'.

    • ls_fieldcat-seltext_m = 'Region'.

    • APPEND ls_fieldcat TO rt_fieldcat.

    • CLEAR ls_fieldcat.

    • pos = pos + 1.

    • ls_fieldcat-col_pos = pos.

    • ls_fieldcat-fieldname = 'WERKS'.

    • ls_fieldcat-seltext_s = 'Plant'.

    • ls_fieldcat-seltext_m = 'Plant'.

    • APPEND ls_fieldcat TO rt_fieldcat.

    • CLEAR ls_fieldcat.

    pos = pos + 1.

    ls_fieldcat-col_pos = pos.

    ls_fieldcat-fieldname = 'MATNR'.

    ls_fieldcat-seltext_s = 'Material'.

    ls_fieldcat-seltext_m = 'Material'.

    append ls_fieldcat to rt_fieldcat.

    clear ls_fieldcat.

    pos = pos + 1.

    • pos = pos + 1.

    • ls_fieldcat-col_pos = pos.

    • ls_fieldcat-fieldname = 'MVGR1'.

    • ls_fieldcat-seltext_s = 'Speciality'.

    • ls_fieldcat-seltext_m = 'Speciality'.

    • APPEND ls_fieldcat TO rt_fieldcat.

    • CLEAR ls_fieldcat.

    *

    • pos = pos + 1.

    • ls_fieldcat-col_pos = pos.

    • ls_fieldcat-fieldname = 'SERNR'.

    • ls_fieldcat-seltext_s = 'Serial'.

    • ls_fieldcat-seltext_m = 'Serial'.

    • APPEND ls_fieldcat TO rt_fieldcat.

    • CLEAR ls_fieldcat.

    *

    • pos = pos + 1.

    • ls_fieldcat-col_pos = pos.

    • ls_fieldcat-fieldname = 'ARKTX'.

    • ls_fieldcat-seltext_s = 'Description'.

    • ls_fieldcat-seltext_m = 'Description'.

    *

    *

    • APPEND ls_fieldcat TO rt_fieldcat.

    • CLEAR ls_fieldcat.

    *

    *

    • pos = pos + 1.

    • ls_fieldcat-col_pos = pos.

    • ls_fieldcat-fieldname = 'ERNAM'.

    • ls_fieldcat-seltext_s = 'Created By'.

    • ls_fieldcat-seltext_m = 'Created By'.

    *

    • APPEND ls_fieldcat TO rt_fieldcat.

    • CLEAR ls_fieldcat.

    • pos = pos + 1.

    • ls_fieldcat-col_pos = pos.

    • ls_fieldcat-fieldname = 'ERDAT'.

    • ls_fieldcat-seltext_s = 'Created On'.

    • ls_fieldcat-seltext_m = 'Created On'.

    *

    *

    • APPEND ls_fieldcat TO rt_fieldcat.

    • CLEAR ls_fieldcat.

    • pos = pos + 1.

    • ls_fieldcat-col_pos = pos.

    • ls_fieldcat-fieldname = 'VSTEL'.

    • ls_fieldcat-seltext_s = 'Ship Point'.

    • ls_fieldcat-seltext_m = 'Shipping Point'.

    *

    • APPEND ls_fieldcat TO rt_fieldcat.

    • CLEAR ls_fieldcat.

    *

    • pos = pos + 1.

    • ls_fieldcat-col_pos = pos.

    • ls_fieldcat-fieldname = 'WADAT'.

    • ls_fieldcat-seltext_s = 'GoodsMvt.Date'.

    • ls_fieldcat-seltext_m = 'Goods Mvt Date'.

    • APPEND ls_fieldcat TO rt_fieldcat.

    • CLEAR ls_fieldcat.

    *

    pos = pos + 1.

    ls_fieldcat-col_pos = pos.

    ls_fieldcat-fieldname = 'SERNP'.

    ls_fieldcat-seltext_s = 'Serial Shipped'.

    ls_fieldcat-seltext_m = 'SBANK Serial'.

    append ls_fieldcat to rt_fieldcat.

    clear ls_fieldcat.

    pos = pos + 1.

    ls_fieldcat-col_pos = pos.

    ls_fieldcat-fieldname = 'SERNP'.

    ls_fieldcat-seltext_s = 'SBANK Serial'.

    ls_fieldcat-seltext_m = 'SBANK Serial'.

    append ls_fieldcat to rt_fieldcat.

    clear ls_fieldcat.

    pos = pos + 1.

    ls_fieldcat-col_pos = pos.

    ls_fieldcat-fieldname = 'VBELV'.

    ls_fieldcat-seltext_s = 'Invoice'.

    ls_fieldcat-seltext_m = 'Invoice'.

    append ls_fieldcat to rt_fieldcat.

    clear ls_fieldcat.

    pos = pos + 1.

    ls_fieldcat-col_pos = pos.

    ls_fieldcat-fieldname = 'NETWR'.

    ls_fieldcat-seltext_s = 'Invoice Amt'.

    ls_fieldcat-seltext_m = 'Invoice Value'.

    append ls_fieldcat to rt_fieldcat.

    clear ls_fieldcat.

    pos = pos + 1.

    ls_fieldcat-col_pos = pos.

    ls_fieldcat-fieldname = 'LFIMG'.

    ls_fieldcat-seltext_s = 'Del Qty'.

    ls_fieldcat-seltext_m = 'Delivery Qty'.

    append ls_fieldcat to rt_fieldcat.

    clear ls_fieldcat.

    pos = pos + 1.

    ls_fieldcat-col_pos = pos.

    ls_fieldcat-fieldname = 'QMNUM'.

    ls_fieldcat-seltext_s = 'Notification'.

    ls_fieldcat-seltext_m = 'Notification'.

    append ls_fieldcat to rt_fieldcat.

    clear ls_fieldcat.

    pos = pos + 1.

    ls_fieldcat-col_pos = pos.

    ls_fieldcat-fieldname = 'QMCOD'.

    ls_fieldcat-seltext_s = 'KST Rep Level '.

    ls_fieldcat-seltext_m = 'KST Repair Level '.

    append ls_fieldcat to rt_fieldcat.

    clear ls_fieldcat.

    pos = pos + 1.

    ls_fieldcat-col_pos = pos.

    ls_fieldcat-fieldname = 'QMCOL'.

    ls_fieldcat-seltext_s = 'KSE Rep Level'.

    ls_fieldcat-seltext_m = 'KSE Repair Level'.

    append ls_fieldcat to rt_fieldcat.

    clear ls_fieldcat.

    pos = pos + 1.

    ls_fieldcat-col_pos = pos.

    ls_fieldcat-fieldname = 'SERNR'.

    ls_fieldcat-seltext_s = 'Serial Nbr'.

    ls_fieldcat-seltext_m = 'Serial Nbr'.

    append ls_fieldcat to rt_fieldcat.

    clear ls_fieldcat.

    endform. "fieldcat_init

    • Data selection

    form select_data tables rt_outtab like gt_outtab[].

    clear: r_vbeln[].

    • Read all Invoices for the Selection

    select distinct h~vbeln h~kunnr h~kunag

    d~posnr d~matnr d~anzsn

    d~serail d~vgbel d~vgpos

    d~posnv d~lfimg d~arktx

    d~uecha h~lfart h~erdat

    h~ernam h~lfdat d~prodh

    h~vkorg d~vkbur d~vkgrp

    d~mvgr1 h~wadat_ist d~pstyv

    into (rt_outtab-vbeln, rt_outtab-kunnr,

    rt_outtab-kunag, rt_outtab-posnr,

    rt_outtab-matnr, rt_outtab-anzsn,

    rt_outtab-serail, rt_outtab-vgbel,

    rt_outtab-vgpos, rt_outtab-posnv,

    rt_outtab-lfimg, rt_outtab-arktx,

    rt_outtab-uecha, rt_outtab-lfart,

    rt_outtab-erdat, rt_outtab-ernam,

    rt_outtab-lfdat, rt_outtab-prodh,

    rt_outtab-vkorg, rt_outtab-vkbur,

    rt_outtab-vkgrp, rt_outtab-mvgr1,

    rt_outtab-wadat, rt_outtab-pstyv)

    from likp as h inner join lips as d

    on h~vbeln = d~vbeln

    where h~vbeln in s_vbeln

    and h~vkorg in s_vkorg

    AND h~lfart EQ 'LF'

    • AND h~kunnr IN s_kunnr

    and h~kunag in s_kunag

    • AND h~erdat IN s_erdat

    and d~matnr in s_matnr

    • AND d~prodh IN s_prodh

    • AND d~vgbel IN s_vbelv

    and d~matnr like 'S%'.

    select single * from vbak where vbeln = rt_outtab-vgbel.

    if: sy-subrc eq 0.

    move vbak-vbeln to rt_outtab-vgbel.

    move vbak-auart to rt_outtab-auart.

    endif.

    select single * from mara where matnr = rt_outtab-matnr

    and mtart eq 'FERT'.

    check sy-subrc eq 0.

    if not rt_outtab-posnv is initial.

    rt_outtab-vgpos = rt_outtab-posnv.

    endif.

    clear: vbfa.

    select single vbeln rfwrt into (rt_outtab-vbelv, rt_outtab-netwr)

    from vbfa where vbelv eq rt_outtab-vgbel

    and posnv eq rt_outtab-vgpos

    and vbtyp_n eq 'M'.

    append rt_outtab.

    if not r_vbeln-low is initial.

    if r_vbeln-low gt rt_outtab-vbeln.

    r_vbeln-low = rt_outtab-vbeln.

    endif.

    if r_vbeln-high lt rt_outtab-vbeln.

    r_vbeln-high = rt_outtab-vbeln.

    endif.

    else.

    r_vbeln-low = rt_outtab-vbeln.

    r_vbeln-high = rt_outtab-vbeln.

    endif.

    clear: rt_outtab.

    endselect.

    if not r_vbeln is initial.

    move: 'I' to r_vbeln-sign,

    'BT' to r_vbeln-option.

    append r_vbeln.

    select * into corresponding fields of table i_serail

    from ser01 where lief_nr in r_vbeln.

    endif.

    sort i_serail.

    if not i_serail[] is initial.

    select * into corresponding fields of table i_object_numbers

    from objk

    for all entries in i_serail

    where obknr eq i_serail-obknr

    and taser eq 'SER01'.

    endif.

    sort i_object_numbers by obknr.

    loop at rt_outtab.

    • Read Ship-to Customer

  • SELECT SINGLE adrnr INTO vbpa-adrnr FROM vbpa

  • WHERE vbeln EQ rt_outtab-vgbel

  • AND parvw EQ 'WE'.

  • Read the Sold To Name

  • SELECT SINGLE name1 INTO rt_outtab-name1

  • FROM kna1 WHERE kunnr EQ rt_outtab-kunnr.

  • *

    • CLEAR: rt_outtab-pernr.

    • PERFORM get_repname USING rt_outtab-vgbel

    • rt_outtab-vgpos

    • CHANGING rt_outtab-pernr

    • rt_outtab-ename.

    *

    • Read the Sold To Name

  • SELECT SINGLE name1 INTO rt_outtab-name3

  • FROM kna1 WHERE kunnr EQ rt_outtab-kunag.

  • *

    *

    • SELECT SINGLE pernr INTO rt_outtab-fstno FROM vbpa

    • WHERE vbeln EQ rt_outtab-vgbel

    • AND parvw EQ 'P3'.

    • CLEAR: vbpa-adrnr.

    • CLEAR: pa0001.

    • SELECT SINGLE ename INTO rt_outtab-fstnm FROM pa0001

    • WHERE pernr EQ rt_outtab-fstno.

    *

    • Read Ship-to Customer

    clear: objk.

    if not rt_outtab-serail is initial.

    read table i_serail with key lief_nr = rt_outtab-vbeln

    posnr = rt_outtab-posnr.

    if sy-subrc eq 0.

    do i_serail-anzsn times.

    read table i_object_numbers with key obknr = i_serail-obknr

    binary search.

    if sy-subrc eq 0.

    rt_outtab-equnr = i_object_numbers-equnr.

    rt_outtab-sernr = i_object_numbers-sernr.

    delete i_object_numbers index sy-tabix.

    move '1' to rt_outtab-lfimg.

    select single aufnr qmnum equnr qmcod

    into (rt_outtab-aufnr, rt_outtab-qmnum,

    rt_outtab-equnr, rt_outtab-qmcod)

    from viqmel where kdauf = rt_outtab-vgbel

    and kdpos = rt_outtab-vgpos

    and qmnum = rt_outtab-qmnum.

    • check sy-subrc eq 0.

    • select single qmnum aufnr qmgrp qmcod from viqmel

    • into (rt_outtab-qmnum, rt_outtab-aufnr,

    • rt_outtab-qmgrp, rt_outtab-qmcod)

    • where kdpos = rt_outtab-vgpos

    • and qmnum = rt_outtab-qmnum.

    • rt_outtab1 = rt_outtab.

    • Read Serial Number from Name Plate Data.

    clear: klah, kssk.

    select single atwrt

    • into (rt_outtab-sernp)

    into (rt_outtab-sernr)

    from ( klah as a inner join kssk as k

    on aclint = kclint )

    join ausp as p

    on kobjek = pobjek

    and kclint = patinn

    where a~klart = '002'

    and a~class = 'KSE_SN_ENDOSCOPES'

    and k~objek = rt_outtab-equnr.

    rt_outtab1 = rt_outtab.

    *KSE Repair level (activity code text from KSE-SM07 code group)

    clear: rt_outtab-qmcol.

    clear: g_mnkat, g_mngrp.

    select single mnkat mngrp mncod into

    (g_mnkat, g_mngrp, rt_outtab-qmcol)

    from viqmma where qmnum = rt_outtab1-qmnum

    and mngrp eq 'KSE-SM07'

    and kzloesch eq space.

    select single kurztext into rt_outtab1-cotxt

    from qpct where katalogart eq g_mnkat

    and codegruppe eq g_mngrp

    and code eq rt_outtab-qmcol

    and sprache eq sy-langu.

    rt_outtab1 = rt_outtab.

    • KSE Repair level (activity code text from KST)

    select single mnkat into g_mnkat

    from viqmma where qmnum = rt_outtab1-qmnum

    and kzloesch eq space.

    select single kurztext into rt_outtab1-cotxt

    from qpct where katalogart eq g_mnkat

    • and codegruppe eq g_mngrp

    • and code eq rt_outtab-qmcol

    and sprache eq sy-langu.

    rt_outtab1 = rt_outtab.

    append rt_outtab1.

    endif.

    enddo.

    endif.

    endif.

    endloop.

    clear: rt_outtab[].

    rt_outtab[] = rt_outtab1[].

    sort rt_outtab by vbeln posnr.

    endform.

    ----


    • FORM get_repname *

    ----


    • ........ *

    ----


    • --> P_VBELN *

    • --> P_POSNR *

    • --> P_PERNR *

    • --> P_ENAME *

    ----


    form get_repname using p_vbeln

    p_posnr

    changing p_pernr

    p_ename. "

    data: i_vbpa like vbpa occurs 0 with header line.

    clear: i_vbpa[].

    call function 'Z_DETERMINE_ACTIVE_SALES_REP'

    exporting

    g_salesdocument = p_vbeln

    g_sales_item = p_posnr

    tables

    st_vbpa = i_vbpa.

    read table i_vbpa index 1.

    if sy-subrc = 0.

    p_pernr = i_vbpa-pernr.

    select single ename into p_ename

    from pa0001

    where pernr = i_vbpa-pernr.

    endif.

    endform. " get_repname

    ----


    • FORM E03_EVENTTAB_BUILD *

    ----


    • ........ *

    ----


    • --> E03_LT_EVENTS *

    ----


    form e03_eventtab_build using e03_lt_events type slis_t_event.

    data: ls_event type slis_alv_event.

    *

    call function 'REUSE_ALV_EVENTS_GET'

    exporting

    i_list_type = 0

    importing

    et_events = e03_lt_events.

    read table e03_lt_events with key name = slis_ev_top_of_page

    into ls_event.

    if sy-subrc = 0.

    move gc_formname_top_of_page to ls_event-form.

    append ls_event to e03_lt_events.

    endif.

    endform.

    ----


    • FORM TOP_OF_PAGE *

    ----


    • ........ *

    ----


    form top_of_page.

    *

    call function 'REUSE_ALV_COMMENTARY_WRITE'

    exporting

    it_list_commentary = gt_list_top_of_page.

    endform.

    *&----


    *& Form USER_COMMAND

    *&----


    form user_command using r_ucomm like sy-ucomm

    rs_selfield type slis_selfield.

    case r_ucomm.

    when '&IC1'.

    perform display_delivery using r_ucomm

    rs_selfield.

    endcase.

    endform.

    &----


    *& Form display_delivery

    &----


    form display_delivery

    using r_ucomm like sy-ucomm

    rs_selfield type slis_selfield.

    case rs_selfield-sel_tab_field.

    when '1-VBELN'.

    set parameter id 'VL' field rs_selfield-value.

    call transaction 'VL03N' and skip first screen.

    when '1-VBELV'.

    set parameter id 'VF' field rs_selfield-value.

    call transaction 'VF03N' and skip first screen.

    endcase.

    endform.

    &----


    *& Form VARIANT_INIT

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    form variant_init.

    *

    clear g_variant.

    g_variant-report = g_repid.

    endform. " VARIANT_INIT

    &----


    *& Form F4_FOR_VARIANT

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    form f4_for_variant.

    *

    call function 'REUSE_ALV_VARIANT_F4'

    exporting

    is_variant = g_variant

    i_save = g_save

    • it_default_fieldcat =

    importing

    e_exit = g_exit

    es_variant = gx_variant

    exceptions

    not_found = 2.

    if sy-subrc = 2.

    message id sy-msgid type 'S' number sy-msgno

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

    else.

    if g_exit = space.

    • p_vari = gx_variant-variant.

    endif.

    endif.

    endform.

    &----


    *& Form PAI_OF_SELECTION_SCREEN

    &----


    • text

    ----


    form pai_of_selection_screen.

    *

    • IF NOT p_vari IS INITIAL.

    move g_variant to gx_variant.

    • MOVE p_vari TO gx_variant-variant.

    call function 'REUSE_ALV_VARIANT_EXISTENCE'

    exporting

    i_save = g_save

    changing

    cs_variant = gx_variant.

    g_variant = gx_variant.

    • ELSE.

    perform variant_init.

    • ENDIF.

    endform. " PAI_OF_SELECTION_SCREEN