‎2006 Aug 21 7:04 PM
Hi friends,
according to the given description i have to write one functional module
plz suggest me the code i should follow .
urgent issue in production.plz
a. Read XSI Tables for the previous days Shipment Number
Read table VTTK for VTTK-SHTYP = ZPLD AND VTTK-ERDAT =[SY-DATUM 1]
Retrieve Shipment numbers with UPS as forwarding agent [VTTK-TKNUM] for [VTRKH-VBELN] =[VTTK-TKNUM] = UPS
b. For each shipment number, VTTP-TKNUM = VTTK-TKNUM, get first delivery number in shipment VTTP-VBELN for VTTP-TPRFO = 0001
Retrieve Shipping point [VTRDI-VSTEL] for VTRDI-VBELN = VTTP-VBELN
c. Read MetaData Transaction Table [VLBL] for Current Shipment number VLBL-VBELN.
For VLBL-VBELN=VTTP-TKNUM, get first delivery number in shipment VTTP-VBELN for VTTP-TPRFO = 0001
Retrieve Shipping point for current shipment [VTRDI-VSTEL] for VTRDI-VBELN = VTTP-VBELN
d. Shipment Number of previous days transmission
For [VTRDI-VSTEL] from step c. equal to [VTRDI-VSTEL] from step b., retrieve [VTTK-TKNUM from step a.
Previous shipment number VLBL-VBELN= VTTK-TKNUM
Get Express Delivery Company Data Field [VLBL-VLABTYP] for VLBL-VBELN=VTTK-TKNUM and VLBL-VLABTYP = ZIBOOKNO {book number from previous shipment}
Shipment Number of current days transmission [VBELN]
Page Number of current days transmission [PAGENO]
If Current page number [VLBL-PAGENO] NE 001
BOOKNO = [VLBLZIBOOKNO] from previous shipment.
Else,
If [VLBLZIBOOKNO] = [VLBL-BOOK1]
BOOKNO = [VLBL-BOOK1]
Else
BOOKNO = [VLBL-BOOK2]
Thanks & Regards
Hridhayanjili.
‎2006 Aug 21 7:44 PM
U can create a function module using transaction code SE37. Once you create the same you would need to use import parameters as shipment type and shipment number and export parameters as the required output.
the code for the function module would be :
ldate = sy-datum - 1.
select tknum from vttk
into itab
where shtyp = 'ZPLD' and
erdat = ldate and
tknum = 'UPS'.
loop at itab.
select vbeln into lvbeln from vttp
where tknum = itab-tknum and tprfo = '0001'.
select vstel into lvstel from vtrdi
where vbeln = lvbeln.
select * into ivlbl from vlbl
where vbeln = itab-tknum.
--- the rest of the specs can be interpretted here
endloop.
-- I have coded the part which I could understand from your techspecs(which in my view are a bit complex to understand.)
Message was edited by: Anurag Bankley
‎2006 Aug 21 7:33 PM
‎2006 Aug 21 7:41 PM
‎2006 Aug 21 7:44 PM
U can create a function module using transaction code SE37. Once you create the same you would need to use import parameters as shipment type and shipment number and export parameters as the required output.
the code for the function module would be :
ldate = sy-datum - 1.
select tknum from vttk
into itab
where shtyp = 'ZPLD' and
erdat = ldate and
tknum = 'UPS'.
loop at itab.
select vbeln into lvbeln from vttp
where tknum = itab-tknum and tprfo = '0001'.
select vstel into lvstel from vtrdi
where vbeln = lvbeln.
select * into ivlbl from vlbl
where vbeln = itab-tknum.
--- the rest of the specs can be interpretted here
endloop.
-- I have coded the part which I could understand from your techspecs(which in my view are a bit complex to understand.)
Message was edited by: Anurag Bankley
‎2006 Aug 21 8:08 PM