Shipment no range-GR-No(VTTK-EXTI2)

Dear All, As per our new requirement ,We have to maintain external (or internal)no range for -G.R.Number---(VT03N--VTTK-EXTI2),Please provide the process.

Have a look at this
Shipment Document : Custom fields population in VT01N
G. Lakshmipathi

Similar Messages

  • Query regarding Shipment

    Dear Folks,
       Need standard tcode for report...List of shipments whose PGI is not done.
    Regrads,
    SGR.Kishore

    Hi,
    I think you can get it in VTTK table itself.
    In shipment, your status profile will control when PGI is done adn accordingly the planning and execution dates are updated. So if you know the date which is relevant for PGI, you can find out all the shipments for which this date is empty.
    We use the field Shipment completion date(actual) to complete the PGI (vttk-dtabf). Also you can make use of the status of the shipment,may be fields like VTTK-STABF, STTEN etc.....
    As a report, you can check VT20

  • Handling unit - Shipment

    Hi all,
    I would like to get the number of handling units in a shipment. I dont find VTTK or VEKP fulfils this requirement.
    Can you please suggest any idea ?
    Rgds,
    Seema

    Hi Seema,
    You can get the handling unit number from VBFA table.
    Hit the VBFA table by giving VBELV as delivery number and VBTYP_N as 'X' ( which is nothing but handling unit).
    In field VBELN you will get the handling unit.
    You can use this handling unit number an hit VEKP Table to get more details on handling unit.
    Regards.

  • Trigger output in VT02N automatically when changes done to Shipment.

    i have created new output type ZXXX for VT01N and VT02N (shipment) for sending Fax.
    my task is:
    this output type has to be triggered automatically and fax has to
    be resent when any of below changes made using Tcode VT02N
    here are the changes:
    Changes made to the shipment start date/time field-
    VTTK-TKNUM- DPTBG
    VTTK-TKNUM- UPTBG
    When there are stop order changes made to the stages
    VTTS=TKNUM-TSRFO
    When the carrier is changed in the shipment
    VTTK-TDLNR
    When delivery appointment date/times are entered or changed.
    VTTS-TKNUM-DPTEN.
    VTTS-TKNUM-UPTEN.
    how can we do this?
    Edited by: RamaKrishna Karnati on Jun 10, 2008 3:12 PM
    Edited by: RamaKrishna Karnati on Jun 10, 2008 3:30 PM
    Edited by: RamaKrishna Karnati on Jun 10, 2008 3:31 PM

    Hi,
    try the user exit EXIT_SAPLV56U_004.
    use the following tables parameters of this function module to determine whether the values are changed:
    I_XVTTK - Shipment Headers (Current)
    I_YVTTK - Shipment Headers (Old)
    I_XVTTS - Shipment Stages (Current)
    I_YVTTS - Shipment Stages (Old)
    if any change is made to any of the fields, you can trigger the standard output type by using the function module WFMC_MESSAGE_SINGLE. you will have to pass a structure of type NAST with the required vlaues.
    try this...
    cheers
    jubin

  • Required Shade column

    Hello Abap Gurus;
    I have a report of invoice list.In this report i want shade column
    of the SD document: Delivery: Item data in which the shade is displayed.I m attaching the code also.
    *& Report  ZRPT_SD_002
    REPORT  zrpt_sd_002 LINE-SIZE 70 NO STANDARD PAGE HEADING
                            MESSAGE-ID zcvs.
                              TABLES
    TABLES : vbak  ,              " Sales Document Header
             vbap  ,              " Sales Document Item
             kna1  ,              " Customer Master
             vbkd  ,              " Business Data
             t023t ,              " MAterial Group
             ekkn  ,
             mara ,
             lfa1,
             t134t ,              " Material Type
             t024d ,              " MAterial Controller
             t188t ,              " Zone
             tvkbt ,              " Sales OFfice Text
             tvaut ,              " Order Reason
             vbfa  ,              " Order Status
             vbep  ,              " Schedule Line Data
             mska  ,              " Sales Order Stock
             vbrp  ,              " Billing Header
             afko  ,              " Production Order
             vbrk  ,              " Billing Header
             konv  ,              " Condition Type Table
             likp  ,              " Delivery Header
             knb1  ,
             bkpf  ,
             cabnt , vttp,vttk,
             tvro,vbpa.
    TYPE-POOLS
    TYPE-POOLS : slis.
    VARIABLE DECLARATION
    DATA       : maktx  LIKE makt-maktx,
                 knttp  LIKE ekpo-knttp,
                 city1  LIKE adrc-city1,
                 tknum  LIKE vttk-tknum,
                 name1  LIKE lfa1-name1,
                 lzone  LIKE kna1-lzone,
                 mtbez  LIKE t134t-mtbez,
                 wgbez  LIKE t023t-wgbez,            " Material Group Text
                 bezei  LIKE tvaut-bezei,            " Order Reason Text
                 kvgr1  LIKE vbak-kvgr1,             " Product Manager
                 vtext  LIKE t188t-vtext,            " Product Manager Text
                 vtext2 LIKE t188t-vtext,            " Regional Mgnr Text
                 vtext3 LIKE t188t-vtext,            " Key Account Group
                 vtext4 LIKE t188t-vtext,            " Special Group
                 vtext5 LIKE t188t-vtext,            " Executive
                 vbezei LIKE tvkbt-bezei,            " Sales office
                 matkl  LIKE mara-matkl,             " Material Group
                 mtart  LIKE mara-mtart,             " Material Type
                 erdat  LIKE vbak-erdat,
                 audat  LIKE vbak-audat,
                 auart  LIKE vbak-auart,
                 bstkd  LIKE vbkd-bstkd,
                 prdha  LIKE mara-prdha,
                 belnr  LIKE bkpf-belnr,
                 text(30)   TYPE  c ,
                 v_tabix LIKE sy-tabix,
                 lifnr    LIKE lfa1-lifnr,
                 tname    LIKE lfa1-name1,
                 bstdk    LIKE vbkd-bstdk,
                 ordat    LIKE vbrk-erdat,
                 stext    LIKE tspat-vtext,
                 ktext    LIKE t151t-ktext,
                 v_brtxt  LIKE t016t-brtxt,
                 v_month  TYPE i,p_mon  TYPE i,
                 v_mname(20),p_mname(20),
                 v_ptext  LIKE t052u-text1.
    DATA : cl_data LIKE clobjdat OCCURS 0 WITH HEADER LINE.
    DATA : i_cl_data LIKE clobjdat OCCURS 0 WITH HEADER LINE.
    DATA :       dmbtr LIKE bseg-dmbtr,
                 gbsta LIKE vbup-gbsta,
                 mbdat LIKE vbep-mbdat,
                 kalab LIKE mska-kalab,
                 bonba LIKE vbrp-bonba,
                 gltrp LIKE afko-gltrp,
                 mblnr LIKE mseg-mblnr,
                 budat LIKE mkpf-budat,
                 prtext  LIKE t179t-vtext,
                 signi LIKE vttk-signi,       " Truck Number
                 landx LIKE t005t-landx.
    DATA :       BEGIN OF tline OCCURS 0 .
            INCLUDE STRUCTURE tline .
    DATA :       END OF tline .
    DATA :       soh LIKE rstxt-tdname ,
                 destcty(30).
    DATA :       klmeng LIKE  vbap-klmeng.
    DATA :       tabix  LIKE  sy-tabix.
    DATA :       cmgst  LIKE  vbuk-cmgst,
                 option(10) TYPE c .
    DATA : BEGIN OF delivery_header.
            INCLUDE STRUCTURE likp.
    DATA : END OF delivery_header.
    DATA : BEGIN OF shipment_header.
            INCLUDE STRUCTURE vttk.
    DATA : END OF shipment_header.
    DATA : BEGIN OF ivbrk OCCURS 0.
            INCLUDE STRUCTURE vbrk.
    DATA : brsch LIKE kna1-brsch,
           name1 LIKE kna1-name1,
           ort01  LIKE kna1-ort01.
    DATA : END OF ivbrk.
    DATA : v_regio LIKE kna1-regio,
           v_brsch LIKE kna1-brsch,
           v_ort01 LIKE kna1-ort01,
           v_land1  LIKE kna1-land1.
    New For Days Start
    DATA: len TYPE i.
    DATA : BEGIN OF head OCCURS 0,
           field(5),
           text(30),
           END OF head.
    DATA :   p_ftext1(30),
             p_ftext2(30),
             p_ftext3(30),
             p_ftext4(30),
             p_ftext5(30),
             p_ftext6(30).
    New For Days End
                          DECLARATION FOR ALV
    DATA: fieldtab TYPE slis_t_fieldcat_alv,
           heading  TYPE slis_t_listheader,
           layout   TYPE slis_layout_alv,
           events   TYPE slis_t_event,
           repname  LIKE sy-repid,
           f2code   LIKE sy-ucomm VALUE  '&ETA',
           g_save(1) TYPE c,
           g_variant LIKE disvariant,
           gx_variant LIKE disvariant,
           g_exit(1) TYPE c.
    DATA: keyinfo  TYPE slis_keyinfo_alv.
    CONSTANTS: formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
    DATA: alv_print        TYPE slis_print_alv.
    DATA: alv_detail_func(30).
    DATA: g_pos TYPE i.
    DATA: tabname   TYPE slis_tabname.
    INTERNAL TABLES DECLARATION
    DATA : BEGIN OF ivbeln OCCURS 1,
           vbeln    LIKE vbrk-vbeln,         " Billing Document
           posnr    LIKE vbrp-posnr,         " Billing Doc Item
           fkart    LIKE vbrk-fkart,         " Billing Type
           vbtyp    LIKE vbrk-vbtyp,         " SD Docnument Category
           vbtyp_desc(35)         ,          " Vbtyp description
           vkgrp    LIKE vbrp-vkgrp,         " Sales Group
           fkdat    LIKE vbrk-fkdat,         " Billing Date
           matnr    LIKE vbrp-matnr,         " Material
           arktx    LIKE vbrp-arktx,         " Material Desc
           kunnr    LIKE vbrk-kunag,         " Customer Code
           name1    LIKE kna1-name1,         " Customer Name
           ort01    LIKE kna1-ort01,         " Customer City
           fkimg    LIKE vbrp-fkimg,         " Billed Qty
           werks    LIKE vbrp-werks,         " Plant
           pl_land1 LIKE t001w-land1,        " Plant Country
           pl_regio LIKE t001w-regio,        " Plant Region Code
           regio_tx LIKE t005u-bezei,        " Plant Region Name
           netwr    LIKE vbrp-netwr,         " Net Price
           vkorg    LIKE vbrk-vkorg,         " Sales Organisation
           vtext    LIKE tvkot-vtext,        " Sales Org.Text
           vtweg    LIKE vbrk-vtweg,         " Distribution Channel
           vttxt    LIKE tvtwt-vtext,        " Dist.Channel Text
           vkbur    LIKE vbrp-vkbur,         " Sales Office
           vbezei   LIKE tvkbt-bezei,        " Sales Office Text
           spart    LIKE vbrp-spart,         " Division
           stext    LIKE tspat-vtext,        " Sales Division Text
           kvgr1    LIKE vbrp-kvgr1,         " District
           vtext1   LIKE tvv1t-bezei,        " District Name
           kvgr2    LIKE vbrp-kvgr2,         " Taluka
           vtext2   LIKE t188t-vtext,        " Taluka Name
           kvgr3    LIKE vbrp-kvgr3,         " Village
           vtext3   LIKE t188t-vtext,        " Village Name
           kvgr4    LIKE vbrp-kvgr4,         " Special Group
           vtext4   LIKE t188t-vtext,        " Special Group
           kvgr5    LIKE vbrp-kvgr5,         " Executive
           vtext5   LIKE t188t-vtext,        " Executive Text
          ZZLZONE  LIKE  VBAP-ZZLZONE ,     " Transport.Zone(Sold To Party)
           lztxt    LIKE  tzont-vtext,       " Trans.Zone Desc(Sold To Party)
           waerk    LIKE vbap-waerk,         " Document Currency
           inco1    LIKE vbkd-inco1,         " Inco Terms1
           inco2    LIKE vbkd-inco2,         " Inco Terms2
           bukrs    LIKE vbrk-bukrs,         " Company Code
           lgort    LIKE vbrp-lgort,         " Storage Loc
           vrkme    LIKE  vbrp-vrkme,        " Sales Unit
           aubel    LIKE  vbrp-aubel,        " Sales Doc
           aupos    LIKE  vbrp-aupos,        " Sales Doc Item
           audat    LIKE  vbak-audat,        " Sales Order Date
           klmeng   LIKE  vbap-klmeng,       " Sales Qty
           knumv    LIKE  konv-knumv,        " Cond.Doc No
           frate    LIKE  konv-kbetr,        " Rate
           fvalue   LIKE  konv-kwert,        " Value
           erate    LIKE  konv-kbetr,        " Excise Rate
           evalue   LIKE  konv-kwert,        " Excise Value
           kschl    LIKE  konv-kschl,        " Condition Type
           mtart    LIKE  mara-mtart,        " Material TYpe
           matkl    LIKE  mara-matkl,        " Material Group
           stceg    LIKE  vbrk-stceg,        " VAT Reg.No
           sfakn    LIKE  vbrk-sfakn,        " Cancelled Bill Doc No
           sfakn1   LIKE  vbrk-sfakn,        " Reversed Bill Doc No
           rfbsk    LIKE  vbrk-rfbsk,        " Accounting Transfer Status
           fksto    LIKE  vbrk-fksto,        " Bill Doc.Cancel Ind
           fksto_tx(60),                     " Bill Doc.Cancel text
           erdat    LIKE  vbrk-erdat,        " Creation Date
           erzet    LIKE  vbrk-erzet,        " Creattion Time
           regio    LIKE  kna1-regio,        " Region
           pstyv    LIKE  vbrp-pstyv,        " Sales Doc Item Cat.
           vgbel    LIKE  vbak-vgbel,        " Ref.Doc No
           vgpos    LIKE  vbap-vgpos,        " Ref.Doc.Item.No
           cmgst    LIKE  vbuk-cmgst,        " Credit Status
           zterm    LIKE  vbrk-zterm,        " Pay Term
           auart    LIKE  vbak-auart,        " Sales Order Type
           bstkd    LIKE  vbkd-bstkd,        " Cust.PO No
           bstdk    LIKE  vbkd-bstdk,        " Cust.PO Date
           mwsbp    LIKE  vbrp-mwsbp,        " Tax Amount
           belnr    LIKE  bkpf-belnr,        " Acc.Doc No
           kzwi1    LIKE  vbrp-kzwi1  ,      " Base Price
           kzwi2    LIKE  vbrp-kzwi2  ,      "
           kzwi3    LIKE  vbrp-kzwi3  ,      " Discounts
           kzwi4    LIKE  vbrp-kzwi4,        " Packing and forwarding
           kzwi5    LIKE  vbrp-kzwi5  ,      " Excise
           kzwi6    LIKE  vbrp-kzwi6  ,      " LST/ CST
           mtbez    LIKE  t134t-mtbez,       " Material Type Text
           wgbez    LIKE t023t-wgbez,        " Material Group Text
           land1    LIKE vbrk-land1,         " Country
           landx(20),                        " Country Text
           abrvw    LIKE tvlvt-abrvw,        " Usage Ind.
           reasn    LIKE tvlvt-bezei,        " Desc
           prdha    LIKE mara-prdha,         " Prod Hir.
           edg(2),
           char1    LIKE  ausp-atwrt ,       " Characteristic
           char2    LIKE  ausp-atwrt ,       " Characteristic
           char3    LIKE  ausp-atwrt ,       " Characteristic
           char4    LIKE  ausp-atwrt ,       " Characteristic
           char5    LIKE  ausp-atwrt ,       " Characteristic
           char6    LIKE  ausp-atwrt ,       " Characteristic
           char7    LIKE  ausp-atwrt ,       " Characteristic
           char8    LIKE  ausp-atwrt ,       " Characteristic
           char9    LIKE  ausp-atwrt ,       " Characteristic
           char10   LIKE ausp-atwrt ,        " Characteristic
           char11   LIKE ausp-atwrt ,        " Characteristic
           char12   LIKE ausp-atwrt ,        " Characteristic
           char13   LIKE ausp-atwrt ,        " Characteristic
           char14   LIKE ausp-atwrt ,        " Characteristic
           char15   LIKE ausp-atwrt ,        " Characteristic
           char16   LIKE ausp-atwrt ,        " Characteristic
           lifnr    LIKE lfa1-lifnr,         " Vendor
           tname    LIKE lfa1-name1,         " Vendor Name
           ordat    LIKE vbrk-fkdat,         " order Date
           charg    LIKE vbrp-charg,         " Batch
           kdgrp_auft LIKE vbrp-kdgrp_auft,  " Customer Sales Group
           ktext    LIKE t151t-ktext,        " Customer Sales Group Text
           signi    LIKE vttk-signi,         " License No
           route    LIKE likp-route,         " Route
           routid   LIKE tvro-routid,        " Route ID
           rt_bezei LIKE tvrot-bezei,        " Route Desc
           vstel    LIKE likp-vstel,         " Shipping Point
           sp_vtext LIKE tvstt-vtext,        " Ship Point Desc
           distz    LIKE v_tvro_com-distz,   " Distance
           brsch    LIKE kna1-brsch,         " Industry Key
           brtxt    LIKE t016t-brtxt,        " Industry Name
           mname    LIKE kna1-name1,         " Name
           exnum    LIKE j_1iexchdr-exnum,   " Ex.Number
           exdat    LIKE j_1iexchdr-exdat,   " Ex.Date
           exbed    LIKE j_1iexcdtl-exbed,   " Ex.BED Amt
           ecs      LIKE j_1iexcdtl-ecs,     " Ex.ECESS Amt
           expind   LIKE j_1iexchdr-expind,  " Export Ind.
           expind_desc LIKE dd07t-ddtext,    " Export Ind.Desc
           exgrp    LIKE j_1iexchdr-exgrp,   " Exc.Group
           srgrp    LIKE j_1iexchdr-srgrp,   " Series Group
           sanum    LIKE vbap-vbeln,         " Sales Order No
           sapos    LIKE vbap-posnr,         " SO Item No
           tknum    LIKE vttk-tknum,         " Shipment No
           exti1    LIKE vttk-exti1,         " Vehicle Number
           exti2    LIKE vttk-exti2,         " Driver Name
           tr_count TYPE i,                  " Truck Count
           vsart    LIKE vttk-vsart,         " Shipment Type
           st_bezei LIKE t173t-bezei,        " Shipment Type Desc
           zb00     LIKE konv-kbetr,         " Basic Rate
           xcpdk    LIKE vbpa-xcpdk,         " One Time Account
           adrnr    LIKE vbpa-adrnr,         " Address Number
           shpcd    LIKE kna1-kunnr,         " Ship to Party
           shpnm    LIKE kna1-name1,         " Ship to Party Name
           sh_regio LIKE kna1-regio,         " Region(SH)
           sh_land1 LIKE kna1-land1,         " Country
          SH_LZONE LIKE  VBAP-ZZLZONE ,     " Transport.Zone(Ship To Party)
           sh_lztxt LIKE  tzont-vtext,       " Trans.Zone Desc(Ship To Party)
           mblnr    LIKE mseg-mblnr,         " Material Doc No
           budat    LIKE mkpf-budat,         " Doc Date
           konda    LIKE vbrk-konda,         " Sales Zone
           ptext    LIKE t188t-vtext,        " Text
           zrbat    LIKE konv-kwert,         " Rebate Amount
           serdt    LIKE vbak-erdat,         " S.A Create Date
           groes    LIKE mara-groes,         " Size/Dimensions
           dtext(20),                        "
           prodt(20),                        "
           mtext(20),                        "
           prdqy    LIKE vbrp-fkimg,         "
           aufnr    LIKE afko-aufnr,         " Order No
           city1    LIKE adrc-city1,         " City
           packno(3),                        " Pack No
           inv_rate LIKE konv-kbetr,         " Inv Rate
           inv_amt  LIKE konv-kwert,         " Inv Amount
           frt_rate LIKE konv-kbetr,         " Frt Rate
           frt_amt  LIKE konv-kwert,         " Frt Amount
           td_fkimg LIKE vbrp-fkimg,         " Trade Inv.Qty
           nt_fkimg LIKE vbrp-fkimg,         " Non-Trade Inv.Qty
           st_fkimg LIKE vbrp-fkimg,         " Stk.Trsf.Inv.Qty
           tot_fkimg LIKE vbrp-fkimg,        " Total
           or_dl_vbeln  LIKE lips-vbeln,     " Original Delivery
           or_dl_posnr  LIKE lips-posnr,     " Original Del.Item
           or_in_vbeln  LIKE vbrp-vbeln,     " Original Invoice
           or_in_fkdat  LIKE vbrk-fkdat,     " Original Inv.Date
           or_in_posnr  LIKE vbrp-posnr,     " Original Inv.Item
           or_in_knumv  LIKE vbrk-knumv,     " Original Inv.Cond.No
           or_in_frt_amt LIKE konv-kwert,    " Original Frt Amount
           or_in_fkimg   LIKE vbrp-fkimg,    " Original Qty
           diff_date  TYPE  p,               " Date Differance
           pfield1      LIKE vbrp-fkimg,                        " Day 1
           pfield2      LIKE vbrp-fkimg,                        " Day 2
           pfield3      LIKE vbrp-fkimg,                        " Day 3
           pfield4      LIKE vbrp-fkimg,                        " Day 4
           pfield5      LIKE vbrp-fkimg,                        " Day 5
           pfield6      LIKE vbrp-fkimg,     " Above Days
           pfield7      LIKE vbrp-fkimg,     " TOTAL DAYS
           bolnr        LIKE likp-bolnr,    " LR/DC No
           INCLUDE STRUCTURE ZSD_MATGROUPS.  " Inc.For Mat.Groups
           chaname TYPE lfa1-name1,
           lcnum  TYPE vbkd-lcnum,
           tdline TYPE tline-tdline,
           docno  type j_1iexchdr-docno.
    DATA:  END   OF ivbeln.
    DATA  : BEGIN OF i_mat_tab OCCURS 0,
            dtext LIKE ivbeln-dtext,
            prodt(20),
            mtext(20),
            name1 LIKE ivbeln-name1,
            kunnr LIKE ivbeln-kunnr,
            fkimg LIKE ivbeln-fkimg,
            END OF i_mat_tab.
    DATA  : BEGIN OF it_vbtyp OCCURS 0.
            INCLUDE STRUCTURE dd07v.
    DATA  : END OF it_vbtyp.
    DATA  : BEGIN OF i_mseg OCCURS 0.
            INCLUDE STRUCTURE mseg.
    DATA  : END OF i_mseg.
    DATA  : BEGIN OF i_mseg_coll OCCURS 0,
            matnr  LIKE mseg-matnr,
            charg  LIKE mseg-charg,
            menge  LIKE mseg-menge,
            aufnr  LIKE mseg-aufnr,
            werks  LIKE mseg-werks,
            END OF i_mseg_coll.
    *-- For Sales Plan Details
    DATA  : exnum    LIKE j_1iexchdr-exnum,
            exdat    LIKE j_1iexchdr-exdat,
            exbed    LIKE j_1iexchdr-exbed,
            expind   LIKE j_1iexchdr-expind,
            exgrp    LIKE j_1iexchdr-exgrp,
            srgrp    LIKE j_1iexchdr-srgrp,
            shpcd    LIKE kna1-kunnr,
            shpnm    LIKE kna1-name1,
            shreg    LIKE kna1-regio,
            shlnd    LIKE kna1-land1,
            xcpdk    LIKE vbpa-xcpdk,
            adrnr    LIKE vbpa-adrnr,
            sanum    LIKE vbap-vbeln,
            serdt    LIKE vbak-erdat,
            ptext    LIKE t188t-vtext,
            sapos    LIKE vbap-posnr.
    DATA  : BEGIN OF iitem OCCURS 1,
            kunnr LIKE ivbeln-kunnr,
            name1 LIKE ivbeln-name1,
            vkbur LIKE ivbeln-vkbur,
            vbezei LIKE ivbeln-vbezei,
            dtext LIKE tvtwt-vtext,
            matnr LIKE ivbeln-matnr,
            arktx LIKE ivbeln-arktx,
           VTWEG LIKE ZCVI_VBRKVBRP-VTWEG,
            land1 LIKE kna1-land1,
            landx LIKE t005t-landx,
            END OF iitem.
    DATA  : BEGIN OF t_konv OCCURS 0,
            knumv LIKE konv-knumv,
            kposn LIKE konv-kposn,
            krech LIKE konv-krech,
            kwert LIKE konv-kwert,
            kbetr LIKE konv-kbetr,
            kawrt LIKE konv-kawrt,
            kschl LIKE konv-kschl,
            END OF t_konv.
    DATA  : kunnr LIKE kna1-name1,
            pdate LIKE sy-datum,
            frate LIKE konv-kbetr,
            erate LIKE konv-kbetr,
            evalue LIKE konv-kwert,
            fvalue LIKE konv-kwert,
            zwels LIKE knb1-zwels.
    *DATA  : BEGIN OF ISDCHAR OCCURS 0 .
           INCLUDE STRUCTURE ZCTA_SDCHAR .
    *DATA    END   OF ISDCHAR .
    DATA  : BEGIN OF it_char OCCURS 0.
    DATA  : tabix(2)     TYPE c,
            atbez(30),
            descrp(30)   TYPE c.
            INCLUDE STRUCTURE vbmuez.
    DATA  : END   OF it_char.
    DATA  : ichar LIKE sel_char OCCURS 0 WITH HEADER LINE.
    DATA  : reasn   LIKE tvlvt-bezei.
                          FIELD-SYMBOLS                                  *
    FIELD-SYMBOLS : <table>    TYPE  table ,
                    <struc> ,
                    <field> ,
                    <component> .
    Data Declaration for Dynamic Assignment                              *
    DATA : alv_fieldcat    TYPE                 slis_t_fieldcat_alv,
           lt_alv_cat      TYPE TABLE OF        lvc_s_fcat,
           it_fieldcat     LIKE LINE  OF        lt_alv_cat.
    DATA : i_table         TYPE REF   TO        data,
           i_structure     TYPE REF   TO        data.
    DATA : new_tabix  LIKE sy-tabix.
    DATA : v_ebeln LIKE ekkn-ebeln ,
           v_ebelp LIKE ekkn-ebelp ,
           groes   LIKE mara-groes.
    DATA : t_char LIKE sel_char OCCURS 0 WITH HEADER LINE.
         Macro Definition for assigning and unassigning component
    Assign a field to a component and component to a structure
    DEFINE assign_component.
      assign &1 to <component>.
      assign component <component> of structure <struc> to <field>.
    END-OF-DEFINITION.
    Unassign a Component.
    DEFINE unassign_field.
      if &1 is assigned.
        unassign &1.
      endif.
    END-OF-DEFINITION.
                    SELECTION - SCREEN
    *For ALV Variant
    SELECTION-SCREEN BEGIN OF BLOCK d WITH FRAME TITLE text-s01.
    PARAMETERS: p_vari LIKE disvariant-variant. " ALV Variant
    SELECTION-SCREEN END OF BLOCK d.
    For Basic Data
    SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-s02.
    SELECT-OPTIONS: s_kunnr FOR vbrk-kunrg MATCHCODE OBJECT debi,
                    s_vbeln FOR vbrk-vbeln MATCHCODE OBJECT vmva,
                    s_fkdat FOR vbrk-fkdat OBLIGATORY,
                    s_matnr FOR vbrp-matnr MATCHCODE OBJECT mat1,
                    s_fkart FOR vbrk-fkart ,
                    s_pstyv FOR vbap-pstyv,
                    s_spart FOR vbrk-spart.
    SELECTION-SCREEN END OF BLOCK a.
    For Organisational Data
    SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-s03.
    SELECT-OPTIONS: s_vkorg FOR vbrk-vkorg,
                    s_vtweg FOR vbrk-vtweg,
                    s_bukrs FOR vbrk-bukrs,
                    s_vkbur FOR vbrp-vkbur,
                    s_regio FOR kna1-regio,
                    s_werks FOR vbrp-werks,
                    s_brsch FOR kna1-brsch.         " Industry Key
    SELECTION-SCREEN END OF BLOCK b.
    NEW ADDED  BY AJAY 22-06-2006
    SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-d01.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(30) text-d02.
    SELECTION-SCREEN POSITION 32.
    PARAMETERS : p_field1(3) TYPE n DEFAULT '001',
                 p_field2(3) TYPE n DEFAULT '005',
                 p_field3(3) TYPE n DEFAULT '007',
                 p_field4(3) TYPE n DEFAULT '009',
                 p_field5(3) TYPE n DEFAULT '015'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK c.
    NEW ADDED END BY AJAY 22-06-2006
                          INITIALIZATION
    INITIALIZATION.
      repname = sy-repid.
      PERFORM build_eventtab USING events[].
      PERFORM build_layout .
      PERFORM initialize_variant.
                          AT SELECTION-SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
      PERFORM f4_for_variant.
    AT SELECTION-SCREEN.
      PERFORM pai_of_selection_screen.
      PERFORM check_input.
                          START OF SELECTION
    START-OF-SELECTION.
      PERFORM build_comment USING heading[].
      PERFORM get_day_label.
      PERFORM get_data.
      PERFORM segregate_dist_chann_qty.
      PERFORM initialise_fieldtab.
      PERFORM attach_char_to_fieldcat.
      PERFORM get_transporter_data.
      PERFORM get_sd_matgroups.
      PERFORM get_plant_from_po.
      PERFORM get_excise_details.
      PERFORM display_data.
                          END OF SELECTION
    END-OF-SELECTION.
                              FORMS
    *&      Form  get_data
    *&      Extracts data as per the users selection criteria.
    FORM get_data.
      DATA domname LIKE dd07v-domname.
      DATA it_vrpma LIKE vrpma OCCURS 0 WITH HEADER LINE.
    In case Doc No is specified in Selection use VBRK
    Else use VRPMA(Material wise Billing Doc)
      IF NOT s_vbeln IS INITIAL.
        SELECT * FROM vbrk CLIENT SPECIFIED
                           INTO CORRESPONDING FIELDS OF TABLE ivbrk
                           WHERE mandt EQ sy-mandt
                                 AND   vbeln IN s_vbeln
                                 AND   fkart IN s_fkart
                                 AND   fkdat IN s_fkdat
                                 AND   kunag IN s_kunnr
                                 AND   vkorg IN s_vkorg
                                 AND   vtweg IN s_vtweg
                                 AND   bukrs IN s_bukrs
                                 AND   rfbsk NE 'E'
                                 AND   sfakn EQ space
                                 AND   fksto EQ space.
      ELSE.
        SELECT * FROM vrpma CLIENT SPECIFIED
                            INTO CORRESPONDING FIELDS OF TABLE it_vrpma
                            WHERE mandt EQ sy-mandt
                                  AND  matnr IN s_matnr
                                  AND  vkorg IN s_vkorg
                                  AND  fkdat IN s_fkdat
                                  AND  vtweg IN s_vtweg
                                  AND  fkart IN s_fkart
                                  AND  kunag IN s_kunnr
                                  AND  fkart NE 'ZCMR'
                                  AND  vbeln IN s_vbeln.
        CHECK NOT it_vrpma[] IS INITIAL.
        SORT it_vrpma BY vbeln.
        SELECT * FROM vbrk INTO CORRESPONDING FIELDS OF TABLE ivbrk
                           FOR ALL ENTRIES IN it_vrpma
                           WHERE vbeln = it_vrpma-vbeln
                                 AND   rfbsk NE 'E'
                                 AND   sfakn EQ space
                                 AND   fksto EQ space.
      ENDIF.
      domname = 'VBTYP'.
    Get the List of all Document Types
      PERFORM get_domtext TABLES it_vbtyp USING domname.
      IF NOT ivbrk[] IS INITIAL.
        SORT ivbrk BY kunag.
        LOOP AT ivbrk.
          v_tabix = sy-tabix.
    Get the Region,Industry Key, Name for Sold To Party
          ON CHANGE OF ivbrk-kunag.
            CLEAR : v_regio,v_brsch,name1,v_ort01,v_land1.
            SELECT SINGLE regio brsch name1 ort01 land1 FROM kna1
                                      CLIENT SPECIFIED
                                      INTO (v_regio,v_brsch,
                                            name1,v_ort01,v_land1 )
                                      WHERE mandt = sy-mandt
                                            AND kunnr = ivbrk-kunag.
          ENDON.
    Check for Region,Industry Key as per the Parameter
          IF NOT s_regio[] IS INITIAL.
            IF NOT v_regio IN s_regio.
              DELETE ivbrk INDEX v_tabix.
              CONTINUE.
            ENDIF.
          ENDIF.
          IF NOT s_brsch[] IS INITIAL.
            IF NOT v_brsch IN s_brsch.
              DELETE ivbrk INDEX v_tabix.
              CONTINUE.
            ENDIF.
          ENDIF.
          ivbrk-regio = v_regio.
          ivbrk-brsch = v_brsch.
          ivbrk-name1 = name1.
          ivbrk-ort01 = v_ort01.
          ivbrk-land1 = v_land1.
          ivbrk-netwr = 0.
          MODIFY ivbrk TRANSPORTING regio brsch
                                    name1 netwr ort01 land1.
          CLEAR  ivbrk.
        ENDLOOP.
    Get the Invoice Details from VBRP Table
        IF NOT ivbrk[] IS INITIAL.
          SELECT * FROM vbrp CLIENT SPECIFIED
                           INTO CORRESPONDING FIELDS OF TABLE ivbeln
                           FOR ALL ENTRIES IN ivbrk
                           WHERE mandt = sy-mandt
                                 AND vbeln = ivbrk-vbeln
                                 AND fkimg NE 0
                                 AND matnr IN s_matnr
                                 AND pstyv IN s_pstyv
                                 AND spart IN s_spart
                                 AND werks IN s_werks
                                 AND vkbur IN s_vkbur.
        ENDIF.
      ENDIF.
      IF NOT ivbeln[] IS INITIAL.
        LOOP AT ivbeln.
          READ TABLE ivbrk WITH KEY vbeln = ivbeln-vbeln.
          IF sy-subrc EQ 0.
            IF ivbrk-netwr IS INITIAL.
              ivbrk-netwr = ivbeln-netwr.
            ENDIF.
            MOVE-CORRESPONDING ivbrk TO ivbeln.
            CLEAR it_vbtyp.
            READ TABLE it_vbtyp WITH KEY domvalue_l = ivbrk-vbtyp.
            ivbeln-vbtyp_desc = it_vbtyp-ddtext.
            MOVE ivbrk-kunag TO ivbeln-kunnr.
            MODIFY ivbeln .
            CLEAR  ivbeln.
          ENDIF.
        ENDLOOP.
        SORT ivbeln BY vbeln posnr.
        DELETE ADJACENT DUPLICATES FROM ivbeln COMPARING ALL FIELDS.
        CLEAR  ivbeln.
    Get the Material Type, Group and Production Hiearchy
        LOOP AT ivbeln.
          ON CHANGE OF ivbeln-matnr.
            CLEAR : mtart,matkl,prdha.
            SELECT SINGLE  mtart matkl prdha FROM mara CLIENT SPECIFIED
                                 INTO (mtart,matkl,prdha)
                                 WHERE mandt EQ sy-mandt
                                       AND matnr EQ ivbeln-matnr.
          ENDON.
          ivbeln-mtart = mtart.
          ivbeln-matkl = matkl.
          ivbeln-prdha = prdha.
          MODIFY ivbeln TRANSPORTING  mtart matkl prdha.
          CLEAR ivbeln.
        ENDLOOP.
        LOOP AT ivbeln.
    Retrieving Sales Order Date ,Customer PO No,Customer PO Date
          ON CHANGE OF ivbeln-aubel.
            CLEAR : bstkd,bstdk,ordat,audat.
            SELECT SINGLE bstkd bstdk  FROM vbkd
                                  CLIENT SPECIFIED
                                  INTO  (bstkd,bstdk)
                                  WHERE mandt EQ sy-mandt
                                        AND vbeln EQ ivbeln-aubel.
            SELECT SINGLE erdat audat FROM  vbak CLIENT SPECIFIED
                                INTO  (ordat,audat)
                                WHERE mandt = sy-mandt
                                      AND vbeln = ivbeln-aubel.
           In case of Stock Transfer, Or Export Excise GP
           SO is really a PO Hence Date is tajken from EKKO
            IF ivbeln-fkart EQ 'ZSTF' OR ivbeln-fkart EQ 'ZSTE'.
              SELECT SINGLE bedat FROM  ekko CLIENT SPECIFIED
                                INTO  (audat)
                                WHERE mandt = sy-mandt
                                      AND ebeln = ivbeln-aubel.
            ENDIF.
          ENDON.
          IF ivbeln-erzet GE '000000' AND ivbeln-erzet LE '070000'.
            ivbeln-erdat = ivbeln-erdat - 1.
          ENDIF.
    Get the Counry Descripion
          ON CHANGE OF ivbeln-land1.
            CLEAR : landx.
            SELECT SINGLE landx INTO landx FROM t005t
                               WHERE land1 EQ ivbeln-land1
                                     AND  spras EQ  sy-langu.
          ENDON.
    For retrieving text for Customer Group
          ON CHANGE OF ivbeln-kdgrp_auft.
            CLEAR : ktext.
            SELECT SINGLE ktext FROM t151t
                                INTO ktext
                                WHERE spras EQ sy-langu
                                AND   kdgrp EQ ivbeln-kdgrp_auft.
          ENDON.
    For Retrieving texts for KVGR1 KVGR2 KVGR3 KVGR4 KVGR5
          ON CHANGE OF ivbeln-kvgr1.
            CLEAR : vtext.
            SELECT SINGLE bezei INTO vtext FROM tvv1t
                                           WHERE kvgr1 EQ ivbeln-kvgr1
                                                 AND spras EQ sy-langu.
          ENDON.
          ON CHANGE OF ivbeln-kvgr2.
            CLEAR :vtext2.
            SELECT SINGLE bezei INTO vtext2 FROM tvv2t
                                           WHERE kvgr2 EQ ivbeln-kvgr2
                                                 AND spras EQ sy-langu.
          ENDON.
          ON CHANGE OF ivbeln-kvgr3.
            CLEAR :vtext3.
            SELECT SINGLE bezei INTO vtext3 FROM tvv3t
                                           WHERE kvgr3 EQ ivbeln-kvgr3
                                                 AND spras EQ sy-langu.
          ENDON.
          ON CHANGE OF ivbeln-kvgr4.
            CLEAR :vtext4.
            SELECT SINGLE bezei INTO vtext4 FROM tvv4t
                                           WHERE kvgr4 EQ ivbeln-kvgr4
                                                 AND spras EQ sy-langu.
          ENDON.
          ON CHANGE OF ivbeln-kvgr5.
            CLEAR : vtext5.
            SELECT SINGLE bezei INTO vtext5 FROM tvv5t
                                           WHERE kvgr5 EQ ivbeln-kvgr5
                                                 AND spras EQ sy-langu.
          ENDON.
    Get the Description for Usage Indicator
          ON CHANGE OF ivbeln-abrvw.
            CLEAR : reasn.
            SELECT SINGLE bezei INTO reasn FROM tvlvt CLIENT SPECIFIED
                                           WHERE mandt = sy-mandt
                                                 AND abrvw EQ ivbeln-abrvw
                                                 AND spras EQ sy-langu.
          ENDON.
    Get Account Document
          ON CHANGE OF ivbeln-vbeln.
            CLEAR : belnr.
            SELECT SINGLE belnr INTO belnr FROM bkpf
                                     CLIENT SPECIFIED
                                           WHERE mandt = sy-mandt
                                             AND awtyp EQ 'VBRK'
                                             AND awkey EQ ivbeln-vbeln.
          ENDON.
    Get Division Text
          ON CHANGE OF ivbeln-spart.
            CLEAR : stext.
            SELECT SINGLE vtext INTO stext FROM tspat
                                           WHERE spart EQ ivbeln-spart
                                            AND spras EQ sy-langu.
          ENDON.
    Get Price group Text
          ON CHANGE OF ivbeln-konda.
            CLEAR : ptext.
            SELECT SINGLE vtext INTO ptext FROM t188t
                                           WHERE konda EQ ivbeln-konda
                                            AND spras EQ sy-langu.
          ENDON.
    Get Transporter Code ,Name
          ON CHANGE OF ivbeln-vbeln.
            CLEAR : lifnr,name1.
            SELECT SINGLE lifnr INTO lifnr FROM vbpa
                                           WHERE vbeln EQ ivbeln-vbeln
                                                 AND parvw EQ 'V1'.
            IF NOT lifnr IS INITIAL.
              SELECT SINGLE name1 FROM lfa1 INTO name1
                                            WHERE lifnr EQ lifnr.
            ENDIF.
    *Ship To party Details
            CLEAR: shpcd,shpnm,city1,kna1,xcpdk,adrnr.
            SELECT SINGLE kunnr xcpdk adrnr
                          INTO (shpcd,xcpdk,adrnr)
                          FROM vbpa
                          WHERE vbeln EQ ivbeln-vbeln
                                AND   parvw EQ 'WE'.
            IF NOT shpcd IS INITIAL.
              IF xcpdk EQ 'X'.
                SELECT SINGLE name1 city1 transpzone region country
                          FROM adrc
                          INTO (shpnm,city1,lzone,shreg,shlnd)
                              WHERE addrnumber EQ adrnr.
              ELSE.
                SELECT SINGLE name1 ort01 lzone regio land1
                          FROM kna1
                          CLIENT SPECIFIED
                          INTO (shpnm,city1,lzone,shreg,shlnd)
                              WHERE mandt = sy-mandt
                              AND kunnr EQ shpcd.
              ENDIF.
            ENDIF.
          ENDON.
    Retrieve Text for Sales Office
          ON CHANGE OF ivbeln-vkbur.
            CLEAR : vbezei.
            SELECT SINGLE bezei FROM tvkbt
                                INTO vbezei
                                WHERE spras EQ sy-langu
                                AND   vkbur EQ ivbeln-vkbur.
          ENDON.
    Retrieve Text for Industry Key
          ON CHANGE OF ivbeln-brsch.
            CLEAR : v_brtxt.
            SELECT SINGLE brtxt FROM t016t
                                INTO v_brtxt
                                WHERE spras EQ sy-langu
                                AND   brsch EQ ivbeln-brsch.
          ENDON.
    Retrieve Text for Payment Terms
          ON CHANGE OF ivbeln-zterm.
            CLEAR : v_ptext.
            SELECT SINGLE text1 FROM t052u
                                INTO v_ptext
                                WHERE spras EQ sy-langu
                                AND   zterm EQ ivbeln-zterm.
          ENDON.
    Get Material Type Description,Material Group Desc
          ON CHANGE OF ivbeln-mtart OR ivbeln-matkl.
            CLEAR : wgbez,mtbez.
            SELECT SINGLE wgbez FROM t023t
                               INTO wgbez
                               WHERE spras EQ sy-langu
                               AND   matkl EQ ivbeln-matkl.
            SELECT SINGLE mtbez FROM t134t
                                INTO mtbez
                                WHERE spras EQ sy-langu
                                AND   mtart EQ ivbeln-mtart.
          ENDON.
    Get Delivery doc Number.
          SELECT SINGLE vbeln erdat FROM vbfa INTO
                                    (mblnr,budat)
                                    WHERE vbelv = ivbeln-vgbel
                                    AND   posnv = ivbeln-vgpos
                                    AND    vbtyp_n = 'R'.
          CLEAR : exnum,exdat.
    Get the Excise Related Data
          SELECT SINGLE exnum exdat FROM j_1iexchdr CLIENT SPECIFIED
                                    INTO (exnum,exdat)
                                    WHERE  mandt = sy-mandt
                                           AND  trntyp = 'DLFC'
                                           AND  rdoc   = ivbeln-vbeln
                                           AND  rind   = 'N'
                                           AND  status = 'C'.
          IF sy-subrc = 0.
            SELECT SINGLE exbed ecs INTO (ivbeln-exbed,ivbeln-ecs)
                                    FROM j_1iexcdtl
                                    CLIENT SPECIFIED
                                          WHERE mandt = sy-mandt
                                            AND rdoc2 = ivbeln-vbeln
                                            AND ritem2 = ivbeln-posnr.
            IF sy-subrc NE 0.
              ivbeln-exbed = 0.
              CLEAR ivbeln-exnum.
            ENDIF.
          ENDIF.
    Read Characteristics
          IF NOT ichar[] IS INITIAL.
            PERFORM  read_characteristics   TABLES   ichar
                                            USING    ivbeln-we

    I have solved my query....

  • Need Select  Query

    hi,
       Need Select  Query for this...
    12.     Check if the document category TVLK-VBTYP = ‘7’ where TVLK-LFART = LIKP-LFART (Delivery Type) then this is and Inbound Delivery for a purchase order.
    13.     Check the value of field Shipment External ID#1 (VTTK-EXTI1) is not initial then check the BOL Data Format. If not VICSBOL then set the variable LI_INBVICS = ‘N’. and  assign Shipment External ID#1 to Shipment External ID#2 i. e VTTK-EXTI2 = VTTK-EXTI1. and  Check the TMS  BOL Format. If VICSBOL then set LI_INBVICS = ‘Y’ .

    Hi,
    1)
    IF TVLK-VBTYP = ‘7’ and TVLK-LFART = LIKP-LFART.
    Inbound Is for a Purchase order.
    ELSE.
    Inbound Is not for a Purchase order.
    Endif.
    2)
    IF not VTTK-EXTI1 is initial.
    IF BOL DATA <> VICSBOL.
    LI_INBVICS = ‘N’.
    VTTK-EXTI2 = VTTK-EXTI1
    else if BOL DATA <> VICSBOL.
    LI_INBVICS = ‘Y’
    Endif.
    endif.
    endif.

  • Output determination routines

    Hi,
    I have an enhancement to develop output determination routines for the Output types in the Shipment document to trigger outbound interface to the Freight Forwarder based on the Shipment statuses.
    Need to develop 2 routines say 950,951.
    SD Shipment :
    Output Type      Application      Routine Number
    ZE01                           V7                              9XX
    ZE02                            V7                              9XX
    Routine for ZE01.
    For the Shipment document number in the table VTTK (VTTK-TKNUM),check status VTTK-STTRG = 1 (Planning completed) then the Output will be triggered.
    Routine for ZE02.
    For  the Shipment document in the table VTTK table check the status in VTTK-STRRG = 4 (Loading End) then issue the output.
    I have created the routines and wrote the code for ZE01 like below.
    FORM KOBED_984.
    *if status of vttk-sttrg(Overall transportation status) is 1,(Planning completed) then outputtype is triggered.
    IF VTTK-STTRG = 1.
      SY-SUBRC = 0.
    ELSE.
       SY-SUBRC = 4.
    ENDIF.
    ENDFORM.
    This will work fine.?Or I need to consider the shipment document number anywhere.?NAST-OBJECTKEY will hold the document number.?i need to loop it.?or just the sy-subrc check is only required..?
    Kindly help..
    /Ranjith

    Hi,
    If you really want to be 100% sure that your requirements are rechecked before output, you need to use your own entry module when processing NASt output
    See e.G. in TNAPR for your output type which print program/ form entry is used and replace it by your own entry module : Then you can check your own rules again and cancel before doing the actual output( i.e. don't call the 'processing' form )
    ( contra : you need make a copy of standard print program )
    Alternatively, you could check e.g. the userexits that are triggered when reading the document data to be printed and set the correct return code ( r.g. retcode = 4 when your validations are not met ). This will stop processing also. ( e.g. GET_DATA_USEREXIT )
    The correct names of the variables etc..depend on the print program that you are actually using .
    ( pro : Could maybe be done without copying standard print program )
    Is it still standard print program ?
    rgds
    Dirk

  • I want  to create dynamic ALV report

    Hi great abapers,
    I want  to create dynamic ALV report.Please help me.
    Regards,
    Billa

    Hi,
    Please check the code below:
    REPORT YMMR_PALLET_OVERVIEW MESSAGE-ID Y_MESSAGE_0001.
    Short description:
    To Display and sum up the Quantity of scanned materials on pallet for*
    each Shipment number for the Packaging Materials. *
    TYPE-POOLS : SLIS.
    TABLES: YYLE0003. " Scanned SSCC No.
    --Structure Declaration--
    Structure for Shipment No. and Date.
    TYPES : BEGIN OF T_VTTK_TAB ,
    TKNUM LIKE VTTK-TKNUM, " Shipment number
    ERDAT LIKE VTTK-ERDAT, " created Date
    END OF T_VTTK_TAB .
    Structure for Shipment No., Packaging Materials and Date.
    TYPES: BEGIN OF T_ITAB2,
    TKNUM LIKE YYLE0003-TKNUM, " Shipment number
    VHILM LIKE YYLE0003-VHILM, " Packaging Materials
    QUANTITY TYPE P,
    ERDAT LIKE YYLE0003-ERDAT, " created Date
    COUNT TYPE I,
    END OF T_ITAB2.
    Structure for Shipment No. and Packaging Materials.
    TYPES: BEGIN OF T_ITAB3,
    TKNUM LIKE YYLE0003-TKNUM, " Shipment number
    VHILM LIKE YYLE0003-VHILM, " Packaging Materials
    QUANTITY TYPE P, " Quantity
    END OF T_ITAB3.
    --Internal table Declaration--
    *Internal tables for the above Declared structures
    DATA: G_VTTK_TAB TYPE TABLE OF T_VTTK_TAB,
    G_ITAB5_TAB TYPE TABLE OF T_ITAB2,
    G_ITAB4_TAB TYPE TABLE OF T_ITAB3,
    G_ITAB3_TAB TYPE TABLE OF T_ITAB2. "#EC NEEDED
    *Internal table Holding Shipment No.and quantity
    DATA: BEGIN OF G_TOTAL_TAB OCCURS 0 ,
    TKNUM TYPE YYLE0003-TKNUM, " Shipment number
    QUANTITY TYPE P,
    COUNT TYPE I,
    END OF G_TOTAL_TAB .
    *Internal table for selection screen data
    DATA: BEGIN OF G_SCANDATA_TAB OCCURS 0,
    VHILM LIKE YYLE0003-VHILM, " Packaging Materials
    EXIDV TYPE EXIDV, " External Handling Unit
    TKNUM LIKE YYLE0003-TKNUM, " Shipment number
    QUANTITY LIKE YYLE0003-QUANTITY, " Quantity
    END OF G_SCANDATA_TAB.
    DATA: BEGIN OF ST_SCANDATA_TAB,
    VHILM LIKE YYLE0003-VHILM, " Packaging Materials
    EXIDV TYPE EXIDV, " External Handling Unit
    TKNUM LIKE YYLE0003-TKNUM, " Shipment number
    QUANTITY LIKE YYLE0003-QUANTITY, " Quantity
    END OF ST_SCANDATA_TAB.
    DATA: BEGIN OF G_SCANDATA_COUNT_TAB OCCURS 0,
    VHILM LIKE YYLE0003-VHILM, " Packaging Materials
    TKNUM LIKE YYLE0003-TKNUM, " Shipment number
    QUANTITY LIKE YYLE0003-QUANTITY, " Quantity
    COUNT TYPE I,
    END OF G_SCANDATA_COUNT_TAB.
    DATA: L_COUNT TYPE I.
    *Internal table for Packaging Materials and quantity
    DATA: BEGIN OF G_ITAB6_TAB OCCURS 0,
    VHILM LIKE YYLE0003-VHILM, " Packaging Materials
    QUANTITY TYPE P, " Quantity
    END OF G_ITAB6_TAB.
    *- Field catalog
    DATA: L_ALV_CAT1_TAB TYPE TABLE OF LVC_S_FCAT.
    --Work area Declaration--
    DATA: WA_VTTK TYPE T_VTTK_TAB,
    WA_ITAB3 TYPE T_ITAB2,
    WA_ITAB5 TYPE T_ITAB2,
    WA_ITAB4 TYPE T_ITAB3,
    WA_ITAB1 LIKE G_SCANDATA_TAB,
    WA_ALV_CAT1 LIKE LINE OF L_ALV_CAT1_TAB.
    ----Variable Defnition -
    DATA: G_CUSTOM_CONTAINER_0100 TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
    G_ALV_GRID_0100 TYPE REF TO CL_GUI_ALV_GRID,
    G_CONTAINER_0100 TYPE SCRFNAME VALUE 'LIST',
    G_MYLAYOUT TYPE LVC_S_LAYO, "#EC NEEDED
    G_WA TYPE REF TO DATA.
    DATA: G_VAR TYPE I, " No of records
    G_VAR1 TYPE CHAR20. " Variable
    --field symbols Declaration--
    FIELD-SYMBOLS : <F_FS> TYPE TABLE,
    <F_FS3> TYPE ANY,
    <F_FS4> TYPE ANY,
    <F_FS5> TYPE ANY,
    <F_WA> TYPE ANY,
    <F_FS15> TYPE ANY,
    <F_FS16> TYPE SY-DATUM,
    <F_FS2> TYPE T_ITAB2,
    <F_FS6> TYPE ANY,
    <F_FS7> TYPE ANY,
    <F_FS12> TYPE ANY,
    <F_FS13> TYPE ANY.
    --Selection Parameters--
    SELECTION-SCREEN: BEGIN OF BLOCK BLCK01 WITH FRAME TITLE TEXT-000.
    "Select options
    SELECT-OPTIONS :
    S_TKNUM FOR YYLE0003-TKNUM , " Shipment number
    S_YYREF FOR YYLE0003-YY_REFERENCE, " Packing reference
    S_YYREFT FOR YYLE0003-YY_REFTP, " Reference type
    S_EXIDV FOR YYLE0003-EXIDV, " External HU
    S_MATNR FOR YYLE0003-MATNR, " Material number
    S_VBELN FOR YYLE0003-VBELN, " SD number
    S_POSNR FOR YYLE0003-POSNR, " Item number
    S_LGTOR FOR YYLE0003-LGTOR, " Door for Wr Hs No
    S_VHILM FOR YYLE0003-VHILM, " Packaging Mat
    S_YYMEIN FOR YYLE0003-YY_MEINH, " Indicator for UOM
    S_QUANTI FOR YYLE0003-QUANTITY, " Quantity
    S_YCHECK FOR YYLE0003-YYCHECKED, " Destination_door
    S_STATUS FOR YYLE0003-STATUS, " Packing status
    S_STASHI FOR YYLE0003-STATUSSHIPTO, " Status on ship-to
    S_LOADTR FOR YYLE0003-LOADTRUCK, " Load truck
    S_ERDAT FOR YYLE0003-ERDAT , " Date
    S_ERZET FOR YYLE0003-ERZET, " Entry time
    S_AEDAT FOR YYLE0003-AEDAT, " Last changed on
    S_ERNAM FOR YYLE0003-ERNAM, " Name of Person
    S_AEZET FOR YYLE0003-AEZET, " Time last change
    S_AENAM FOR YYLE0003-AENAM. " Name of person
    SELECTION-SCREEN: END OF BLOCK BLCK01.
    --INITIALIZATION--
    INITIALIZATION.
    Clear the variables and workarea
    CLEAR :G_VAR,
    G_VAR1,
    WA_VTTK,
    WA_ITAB3,
    WA_ITAB5,
    WA_ITAB4,
    WA_ITAB1,
    WA_VTTK,
    WA_ITAB3,
    WA_ITAB5,
    WA_ITAB4,
    WA_ITAB1.
    --AT SELECTION-SCREEN--
    AT SELECTION-SCREEN.
    To validate the data entered in selection screen
    PERFORM SUB_VALIDATE.
    --START-OF-SELECTION--
    START-OF-SELECTION.
    *To fetch the data from table yyle0003
    PERFORM GET_INPUT_DATA.
    *To create the Dynamic Field Catalog
    PERFORM GET_FIELDCAT.
    To populate the data to final table
    PERFORM GET_FINAL_DATA.
    MODULE status_0100 OUTPUT *
    MODULE STATUS_0100 OUTPUT.
    *set title bar and PF status.
    SET PF-STATUS 'ZVKS'.
    SET TITLEBAR 'ZVKS'.
    CHECK SY-UCOMM IS INITIAL.
    SORT G_SCANDATA_TAB BY TKNUM VHILM.
    *Create object for Custom container
    CREATE OBJECT G_CUSTOM_CONTAINER_0100
    EXPORTING
    CONTAINER_NAME = G_CONTAINER_0100
    EXCEPTIONS
    CNTL_ERROR = 1
    CNTL_SYSTEM_ERROR = 2
    CREATE_ERROR = 3
    LIFETIME_ERROR = 4
    LIFETIME_DYNPRO_DYNPRO_LINK = 5.
    *Create object for ALV grid
    CREATE OBJECT G_ALV_GRID_0100
    EXPORTING I_PARENT = G_CUSTOM_CONTAINER_0100.
    G_MYLAYOUT-GRID_TITLE = 'Display Scanning data'.
    *Call method for table Display
    CALL METHOD G_ALV_GRID_0100->SET_TABLE_FOR_FIRST_DISPLAY
    CHANGING
    IT_OUTTAB = <F_FS>
    IT_FIELDCATALOG = L_ALV_CAT1_TAB
    EXCEPTIONS
    INVALID_PARAMETER_COMBINATION = 1
    PROGRAM_ERROR = 2
    TOO_MANY_LINES = 3
    OTHERS = 4.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    User Interaction
    MODULE USER_COMMAND_0100 INPUT.
    CALL METHOD CL_GUI_CFW=>DISPATCH.
    *To exit , back or cancel
    CASE SY-UCOMM.
    WHEN 'EXIT'.
    LEAVE TO SCREEN 0.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    WHEN 'CANCEL'.
    LEAVE PROGRAM.
    WHEN OTHERS.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Form get_input_data
    This sub routine will get the data from yyle0003 table.
    FORM GET_INPUT_DATA.
    CONSTANTS: C_DOT TYPE C VALUE '.',
    C_CHAR TYPE C VALUE 'D'.
    CLEAR G_SCANDATA_TAB.
    Get the data from yyle0003
    SELECT VHILM " Packaging Materials
    EXIDV " External Handling Unit
    TKNUM " Shipment number
    QUANTITY " Quantity
    FROM YYLE0003
    INTO TABLE G_SCANDATA_TAB
    WHERE TKNUM IN S_TKNUM " Shipment number
    AND YY_REFERENCE IN S_YYREF " Packing reference
    AND YY_REFTP IN S_YYREFT " Reference type
    AND EXIDV IN S_EXIDV " External Handling Unit
    AND MATNR IN S_MATNR " Material number
    AND VBELN IN S_VBELN " SD number
    AND POSNR IN S_POSNR " Item number
    AND LGTOR IN S_LGTOR " Door for warehouse No
    AND VHILM IN S_VHILM " Packaging Materials
    AND YY_MEINH IN S_YYMEIN " Indicator for UOM
    AND QUANTITY IN S_QUANTI " Quantity
    AND YYCHECKED IN S_YCHECK " Destination_door
    AND STATUS IN S_STATUS " Packing status
    AND STATUSSHIPTO IN S_STASHI " Status on ship-to
    AND LOADTRUCK IN S_LOADTR " Load truck
    AND ERDAT IN S_ERDAT " Date
    AND ERZET IN S_ERZET " Entry time
    AND AEDAT IN S_AEDAT " Last changed on
    AND ERNAM IN S_ERNAM " Name of Person
    AND AEZET IN S_AEZET " Time last change
    AND AENAM IN S_AENAM. " Name of person
    If VHILM contains any Decimal '.', replace it with D
    LOOP AT G_SCANDATA_TAB.
    REPLACE C_DOT WITH C_CHAR INTO G_SCANDATA_TAB-VHILM.
    IF SY-SUBRC = 0.
    MODIFY G_SCANDATA_TAB TRANSPORTING VHILM.
    ENDIF.
    CLEAR G_SCANDATA_TAB.
    ENDLOOP.
    *To get the Shipment No Creation date from VTTK.
    SELECT TKNUM
    ERDAT
    FROM VTTK
    INTO TABLE G_VTTK_TAB
    WHERE TKNUM IN S_TKNUM.
    SORT G_SCANDATA_TAB BY VHILM EXIDV. "TKNUM VHILM.
    *To get the repeatition of Pacakaging material for each Shipment.
    *--- to find the count of packaging materials under each shipment
    LOOP AT G_SCANDATA_TAB.
    READ TABLE G_SCANDATA_TAB INTO ST_SCANDATA_TAB INDEX SY-TABIX.
    AT END OF EXIDV.
    L_COUNT = L_COUNT + 1.
    MOVE-CORRESPONDING ST_SCANDATA_TAB TO G_SCANDATA_COUNT_TAB.
    G_SCANDATA_COUNT_TAB-COUNT = L_COUNT.
    CLEAR: ST_SCANDATA_TAB, L_COUNT.
    COLLECT G_SCANDATA_COUNT_TAB.
    ENDAT.
    CLEAR : G_SCANDATA_TAB.
    ENDLOOP.
    ENDFORM. " get_input_data
    *& Form sub_validate
    *This subroutine will validate the data eneterd in the selection screen
    FORM SUB_VALIDATE.
    *Varaiable declaration for Shipment number
    DATA: L_TKNUM TYPE YYLE0003-TKNUM."#EC NEEDED " Shipment number
    *- Condition will not qualify all primary key (IDENT)
    SELECT TKNUM FROM YYLE0003 UP TO 1 ROWS
    INTO L_TKNUM "wa_scandata
    WHERE TKNUM IN S_TKNUM " Shipment number
    AND YY_REFERENCE IN S_YYREF " Packing reference
    AND YY_REFTP IN S_YYREFT " Reference type
    AND EXIDV IN S_EXIDV " External Handling Unit
    AND MATNR IN S_MATNR " Material number
    AND VBELN IN S_VBELN " SD number
    AND POSNR IN S_POSNR " Item number
    AND LGTOR IN S_LGTOR " Door for warehouse No
    AND VHILM IN S_VHILM " Packaging Materials
    AND YY_MEINH IN S_YYMEIN " Indicator for UOM
    AND QUANTITY IN S_QUANTI " Quantity
    AND YYCHECKED IN S_YCHECK " Destination_door
    AND STATUS IN S_STATUS " Packing status
    AND STATUSSHIPTO IN S_STASHI " Status on ship-to
    AND LOADTRUCK IN S_LOADTR " Load truck
    AND ERDAT IN S_ERDAT " Date
    AND ERZET IN S_ERZET " Entry time
    AND AEDAT IN S_AEDAT " Last changed on
    AND ERNAM IN S_ERNAM " Name of Person
    AND AEZET IN S_AEZET " Time last change
    AND AENAM IN S_AENAM. " Name of person
    ENDSELECT.
    IF SY-SUBRC <> 0.
    MESSAGE E987 . " No data found for these selection criterias
    ENDIF.
    ENDFORM. " sub_validate
    *& Form get_fieldcat
    Preparing Field catalog
    FORM GET_FIELDCAT.
    DATA: L_REF TYPE REF TO DATA,
    L_I TYPE I. " Variable
    CONSTANTS: C_CENTER TYPE C VALUE 'C'. " Center Justified
    LOOP AT G_SCANDATA_TAB INTO WA_ITAB1.
    MOVE-CORRESPONDING WA_ITAB1 TO WA_ITAB3.
    APPEND WA_ITAB3 TO G_ITAB3_TAB.
    MOVE-CORRESPONDING WA_ITAB1 TO WA_ITAB4.
    COLLECT WA_ITAB4 INTO G_ITAB4_TAB.
    *To sum up the qunatity field for each TKNUM.
    AT END OF TKNUM.
    SUM.
    MOVE WA_ITAB1-TKNUM TO G_TOTAL_TAB-TKNUM.
    MOVE WA_ITAB1-QUANTITY TO G_TOTAL_TAB-QUANTITY .
    APPEND G_TOTAL_TAB.
    CLEAR G_TOTAL_TAB.
    ENDAT.
    CLEAR : WA_ITAB1,
    WA_ITAB3,
    WA_ITAB4.
    ENDLOOP.
    *--- Begin of change - SKR.EXT - EBDK986377
    SORT G_ITAB4_TAB BY TKNUM.
    *--- End of change - SKR.EXT - EBDK986377
    LOOP AT G_ITAB4_TAB INTO WA_ITAB4.
    MOVE-CORRESPONDING WA_ITAB4 TO WA_ITAB5.
    MOVE-CORRESPONDING WA_ITAB4 TO G_ITAB6_TAB.
    *---- to get the count
    READ TABLE G_SCANDATA_COUNT_TAB WITH KEY TKNUM = WA_ITAB5-TKNUM
    VHILM = WA_ITAB5-VHILM.
    IF SY-SUBRC EQ 0.
    WA_ITAB5-COUNT = G_SCANDATA_COUNT_TAB-COUNT.
    ENDIF.
    APPEND WA_ITAB5 TO G_ITAB5_TAB.
    COLLECT G_ITAB6_TAB.
    ENDLOOP.
    CLEAR : WA_ITAB3.
    SORT G_ITAB4_TAB BY TKNUM VHILM.
    DELETE ADJACENT DUPLICATES FROM G_ITAB4_TAB COMPARING VHILM.
    *To get the Number of fields to be displayed
    DESCRIBE TABLE G_ITAB4_TAB LINES G_VAR.
    L_I = '3'.
    *Field catalog
    WA_ALV_CAT1-FIELDNAME = 'TKNUM'(002).
    WA_ALV_CAT1-COL_POS = 1.
    WA_ALV_CAT1-COLTEXT ='ShipmentNo.'.
    APPEND WA_ALV_CAT1 TO L_ALV_CAT1_TAB.
    CLEAR : WA_ALV_CAT1.
    WA_ALV_CAT1-FIELDNAME = 'ERDAT'(003).
    WA_ALV_CAT1-COL_POS = 2.
    WA_ALV_CAT1-COLTEXT ='Creation_Date.'(005).
    APPEND WA_ALV_CAT1 TO L_ALV_CAT1_TAB.
    CLEAR : WA_ALV_CAT1.
    Create field catalog for each of VHILM
    LOOP AT G_ITAB4_TAB INTO WA_ITAB4.
    IF G_VAR >= 1.
    CONDENSE WA_ITAB4-VHILM NO-GAPS.
    WA_ALV_CAT1-FIELDNAME = WA_ITAB4-VHILM. "l_fieldname.
    WA_ALV_CAT1-COL_POS = L_I.
    WA_ALV_CAT1-COLTEXT = WA_ITAB4-VHILM.
    WA_ALV_CAT1-JUST = C_CENTER. "'C'.
    APPEND WA_ALV_CAT1 TO L_ALV_CAT1_TAB.
    CLEAR WA_ALV_CAT1.
    L_I = L_I + 1.
    ENDIF.
    *TOTAL-last column in the field catalog
    AT LAST.
    WA_ALV_CAT1-FIELDNAME = 'TOTAL'(004).
    WA_ALV_CAT1-COL_POS = L_I.
    WA_ALV_CAT1-COLTEXT = 'TOTAL'(004).
    WA_ALV_CAT1-JUST = C_CENTER. " 'C'.
    APPEND WA_ALV_CAT1 TO L_ALV_CAT1_TAB.
    CLEAR WA_ALV_CAT1.
    ENDAT.
    SORT L_ALV_CAT1_TAB BY FIELDNAME.
    *Non of the field name should not get repeated
    DELETE ADJACENT DUPLICATES FROM L_ALV_CAT1_TAB.
    ENDLOOP.
    SORT L_ALV_CAT1_TAB BY COL_POS.
    *Creating Dynamic Internal table
    CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
    EXPORTING
    IT_FIELDCATALOG = L_ALV_CAT1_TAB
    IMPORTING
    EP_TABLE = L_REF.
    Assigning the Dynamic field Catalog to field symbol.
    ASSIGN L_REF->* TO <F_FS>.
    CREATE DATA G_WA LIKE LINE OF <F_FS>.
    ASSIGN G_WA->* TO <F_WA>.
    DELETE ADJACENT DUPLICATES FROM <F_FS> COMPARING ALL FIELDS.
    ENDFORM. " get_fieldcat
    *& Form display_data
    FORM GET_FINAL_DATA.
    *variable declaration
    DATA: L_TOTAL TYPE I, " Row wise total
    L_FILL TYPE I, " Count
    L_TOT TYPE I. " Grand total
    *To get the TOTAL qunatity in the last line of out put.
    LOOP AT G_ITAB6_TAB.
    CLEAR WA_ITAB5.
    WA_ITAB5-TKNUM = 'TOTAL'(004).
    WA_ITAB5-ERDAT = SPACE.
    MOVE-CORRESPONDING G_ITAB6_TAB TO WA_ITAB5 .
    LOOP AT G_SCANDATA_COUNT_TAB WHERE VHILM = G_ITAB6_TAB-VHILM.
    WA_ITAB5-COUNT = WA_ITAB5-COUNT + G_SCANDATA_COUNT_TAB-COUNT.
    ENDLOOP.
    APPEND WA_ITAB5 TO G_ITAB5_TAB.
    CLEAR WA_ITAB5.
    ENDLOOP.
    DESCRIBE TABLE G_ITAB5_TAB LINES L_TOT.
    *>>>>>>>>
    ****To get total qunatity of all TKNUM
    LOOP AT G_TOTAL_TAB .
    L_TOTAL = L_TOTAL + G_TOTAL_TAB-QUANTITY.
    ENDLOOP.
    *>>>>>>>>
    *To assign ERDAT to g_itab5_tab
    LOOP AT G_ITAB5_TAB INTO WA_ITAB5 .
    READ TABLE G_VTTK_TAB INTO WA_VTTK WITH KEY TKNUM = WA_ITAB5-TKNUM.
    IF SY-SUBRC = 0.
    WA_ITAB5-ERDAT = WA_VTTK-ERDAT.
    MODIFY G_ITAB5_TAB FROM WA_ITAB5 TRANSPORTING ERDAT.
    ENDIF.
    ENDLOOP.
    *Assigning value in each field to respective Field symbols.
    LOOP AT G_ITAB5_TAB ASSIGNING <F_FS2>.
    CLEAR G_TOTAL_TAB-QUANTITY.
    ASSIGN COMPONENT 'TKNUM' OF STRUCTURE <F_FS2> TO <F_FS6>.
    ASSIGN COMPONENT 'TKNUM' OF STRUCTURE <F_WA> TO <F_FS7>.
    <F_FS7> = <F_FS6>.
    CONDENSE <F_FS2>-VHILM NO-GAPS.
    ASSIGN COMPONENT 'VHILM' OF STRUCTURE <F_FS2> TO <F_FS3>.
    ASSIGN COMPONENT 5 OF STRUCTURE <F_FS2> TO <F_FS4>.
    MOVE <F_FS3> TO G_VAR1.
    ASSIGN COMPONENT G_VAR1 OF STRUCTURE <F_WA> TO <F_FS5>.
    <F_FS5> = <F_FS4>.
    ASSIGN COMPONENT 'ERDAT' OF STRUCTURE <F_FS2> TO <F_FS16>.
    ASSIGN COMPONENT 'ERDAT' OF STRUCTURE <F_WA> TO <F_FS15>.
    WRITE <F_FS16> TO <F_FS15> .
    Inorder not to display the date '00/00/000',
    if there is no DATE .
    IF ( <F_FS15> CP '00/*' )
    OR ( <F_FS15> CP '00.*' )
    OR ( <F_FS15> CP '00-*' ).
    <F_FS15> = SPACE.
    ELSEIF ( <F_FS15> CO ' / /' )
    OR ( <F_FS15> CO ' . .' )
    OR ( <F_FS15> CO ' - -' ) .
    <F_FS15> = SPACE.
    ENDIF.
    READ TABLE G_TOTAL_TAB WITH KEY TKNUM = <F_FS6>.
    IF SY-SUBRC = 0.
    ASSIGN G_TOTAL_TAB-QUANTITY TO <F_FS12>.
    ASSIGN COMPONENT 'COUNT' OF STRUCTURE <F_FS2> TO <F_FS12>.
    ASSIGN COMPONENT 'TOTAL' OF STRUCTURE <F_WA> TO <F_FS13>.
    <F_FS13> = <F_FS13> + <F_FS12>.
    L_TOTAL = L_TOTAL + <F_FS12>.
    ENDIF.
    L_FILL = L_FILL + 1.
    IF L_FILL = L_TOT.
    ASSIGN L_TOTAL TO <F_FS12>.
    ASSIGN COMPONENT 'TOTAL' OF STRUCTURE <F_WA> TO <F_FS13>.
    <F_FS13> = <F_FS12>.
    ENDIF.
    AT END OF <F_FS2>-TKNUM.
    APPEND <F_WA> TO <F_FS>.
    CLEAR <F_WA>.
    ENDAT.
    ENDLOOP.
    CLEAR: <F_FS6>,
    <F_FS7>,
    <F_WA>.
    *Call the screen where Custom container is defined
    CALL SCREEN 0100.
    ENDFORM. " display_data
    Regards
    Kannaiah

  • Required SD Tables

    Dear All,
       I require SAP tables, which only store Open Deliveries whose shipment document is not created.
    And table which only stores Shipdocument number whose Cost document not yet created.
    regards
    Ranjit..

    Hi,
    Open Deliveries whose shipments not created -> I am not sure whether we have a direct relationship between Open Deliveries and Shipment
    Shipment Number whose Shipment Cost Document not created -> VTTK
    Reward points if it helps.
    Regards,
    Harsh

  • Link SHIPPMENT and delivery in routine (TCode VOFM)

    Hi Friends,
        I want to link SHIPPMENT(application V7) and delivery (V6) in routine (TCode VOFM). is there any routine or routine structure with the combination of both.
    Thanks in advance.
    Vallamuthu.M

    Hi,
    I'm creating output type ZET1 for shipment. and creating a new'Z' program but its not a print program.
    i'm going to assingn the program in TCode nace.
    my problem is, if shipment status is planned (technically vttk-stdis = X and assigned outbound deliveries in the shipment have export indicator (likp-expkz = X)).  then the output type will be triggered in back ground so i need a runtime data (VT01N Tcode).
    Thanks in Advance.
    Vallamuthu.M

  • Archiving statistics reports

    Hello ILM/Archiving enthusiasts,
    I am starting this discussion on a topic which is  post "archiving statistics" .
    As we know , that after an archive write job is completed and a spool is generated.
    There is good information in these spools , which explain
    for ex: Here is a sample for Shipments
    Shipment  can be archived
    Shipment  cannot be archived because it is linked to a shipment
    Shipment  has total shipment calculation status A (needed: ' '/'C')
    Shipment  lies outside the specified shipment number range
    Shipment  has overall status X (required status = 6).
    Shipment was changed on xx/xx/xxxx (required before xx/xx/xxxx)
    << intentionally left blank >>
    Shipment still contains open deliveries
    the numbers in the spools reflect how much data is getting archived and how much is left out.
    Now , we provide this information to business if they can take any action so that some of the data can be reprocessed so that it can reach the status "Can be archived"
    Is any one who works in the archiving space collecting this information ?
    right now we do it manually and consolidate into a spreadsheet which is a tiresome process.
    are there any programs within SAP where this information is stored.
    any thoughts or ideas ?
    Thanks

    Well thanks for your replies,  I know that there is statistics in SARA,
    this is purely technical, I am refering to the actual spool data which provides information on why some data was not arhchived  basically a one liner statement with a count next to it.
    something like
    Proof of delivery not yet processed82902
    Yes there is the need to develop a custom program and we are working on it
    just curious if someone has done the same development

  • Selection Screen Option

    HI.. I'd like to know how to make it possible..
    [X] ---stand for radiobutton
    [  ] Yes
    [X] No
    I want to make that ..the shipment date range input field is appeared..after choosing "Yes"
    [X] Yes     (in the same row)   Shipment Date ________ to __________ ( select-options: sp_fkdat for vbrk-fkdat. )
    any advices?
    Thx

    Use the following code for ur requirement :
    REPORT zrjntrial_tree LINE-COUNT 65
    LINE-SIZE 80
    NO STANDARD PAGE
    HEADING.
    TABLES : vbrk.
    PARAMETERS : p_radio AS CHECKBOX USER-COMMAND opt1.
    SELECT-OPTIONS : s_vbeln FOR vbrk-vbeln,
                     s_fkdat FOR vbrk-fkdat.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF  screen-name = 'S_FKDAT-LOW' OR screen-name = 'S_FKDAT-HIGH'
        or  screen-name = '%_S_FKDAT_%_APP_%-TEXT' or screen-name = '%_S_FKDAT_%_APP_%-OPTI_PUSH'
        or  screen-name = '%_S_FKDAT_%_APP_%-TO_TEXT' or screen-name = '%_S_FKDAT_%_APP_%-VALU_PUSH'.
          IF p_radio IS NOT INITIAL.
            screen-input = 1.
            screen-output = 1.
            screen-invisible = 0.
            MODIFY SCREEN.
          ELSE.
            screen-input = 0.
            screen-output = 0.
            screen-invisible = 1.
            MODIFY SCREEN.
          ENDIF.
        ENDIF.
      ENDLOOP.
    Regards,
    Himanshu

  • How to populate the field VTTK - EXTI1 in the shipment

    Hi there,
    I have a situation where I need to populate the field VTTK - EXTI1  with certain values, I would like to know if there is a user exit or badi to do this.  Actually the field is empty and it's possible to enter any value.
    Thanks in advance
    Regards

    I have found in the screen of shipments a program where the logic of PBO PAI could be changed.
    INCLUDE mv56aozz.                      " User-modules PBO
    INCLUDE mv56aizz.                      " User-modules PAI
    However in the field vttk-exti1 I don't know how can I asociate a custom match code to this field using Abap code.
    Any help will be appreciate.
    Thanks in advance.
    Alexis

  • Number ranges- Shipment

    Hii All
    I have this issue wherein I have maintained number ranges for shipments from 30000 - 60000.
    The current shipment number is in the range of 59000. So it is getting near to exhaustion.
    I need to changes the number range for the shipments say from 80000 - 100000. But I am not sure whether this range is used somewhere else or not.
    Is there a way wherein I can find out whether this range is used somewhere or not or I can straight away do the change and if i do so what will be the consequences.
    Thanks & Regards
    Gaurav Manocha

    Dear Gaurav
    In the number range, on top, there is a tab "Intervals".  Just block any of the number range and click the tab Intervals.  Now after giving some value in the "No" tab, press F4 in "From number" tab so that system will itself propose unutilised number range.  Maintain that and save.
    thanks
    G. Lakshmipathi

  • Link between ekpo -ebeln and vttk-tknum ie shipment no:.............urgent

    HI all,
      plz help me in getting link between ekpo -ebeln and vttk-tknum ie shipment no:
    reply soon....urgent.
    thanks in advance

    Hi
    Link VTTK and VTTP tables with TKNUM and take the delivery VBELN field  from VTTP
    with that delivery you can find the PO number
    see the reference number in EKKO and EKPO tables by passing this VBELn to XBLNR field
    Or take the VGBELand VGPOS  from LIPS table passing VTTP-VBELN  and pass this values to EKKN-VBELN and EKKN-POSNR and take the EBELN and EBELP which are nothing but EKPO-EBELN and EBELP fields
    Reward points for useful Answers
    Regards
    Anji

Maybe you are looking for

  • Apex Calendar has a row limit per day? character limit per day?

    Hi, I am using the apex calendar in my application and it seems to have a limit of rows it can display per day, does anyone knows anything about it? Or maybe a limit of characters it can display in one day. (full month view) What I need to do is to i

  • Alternative to login.jsp

    Hi Is there an alternative method for accessing Portal/Instant Portal other than by using the default login.jsp. Could for example one of the API packages that are available with OracleAS Portal Developer Kit (PDK) be used as an alternative. If so an

  • Synchronize with Item Problem

    Here's my frustration, please help! I'm using forms 6.0 ( don't think its a version issue ) I have a table with a date column, I'll call it "MYDATE". I have a form with two datetime text items. I plan on using one for the date portion and one for the

  • Deleted Shopping Cart awaiting approval

    Greetings SRM Gurus, I have a case of two shopping carts which are shown (under monitor shopping cart) as having been deleted, yet they are appearing in the users approval list as awaiting approval. In the approval list they are greyed out so the use

  • How do i change ratings in aperture from an edit plugin?

    I can read the properties from the selected images with propertiesWithoutThumbnailForVersion and then objectForKey:kExportKeyMainRating. But i didn't find a way to change the image rating from within the edit Plugin. So far i only found the methods f