Skip to Content
0
Apr 03, 2007 at 04:51 PM

outbound delivery creation using Function Module

245 Views

Hi folks,

Iam trying to create Outbound delivery using Function module "RV_DELIVERY_CREATE' and passed all the mandatory parameters as input to this function module, but unfortunately it never created outbound delivery.

Every helpful answer will be rewarded. please try to reply with a sample code . plz gurus help me out in this as it is very urgent.

Below is the Snap of my code:

type-pools: VLIKP,VLGGT.

TABLES TVSA.

data: lt_split TYPE VLIKP_T_SPLITPROT.

data: ls_split type VLIKP_S_SPLITPROT.

DATA LF_NUMKI LIKE INRI-NRRANGENR.

data: y type char18.

SELECT SINGLE * FROM TVSA WHERE SMART = 'L'.

LF_NUMKI = TVSA-NUMKI.

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING

NR_RANGE_NR = 'U8'

OBJECT = 'RV_BELEG'

IMPORTING

NUMBER = Y.

tables: VBAK,VBAP,VBEP,VBUP,VBKD .

data: ls_vbsk type VBSK,

  • ls_vbap type VBAPVB,

lt_vbak type standard table of VBAK,

lt_vbap type standard table of VBAPVB,

lt_vbep type standard table of VBEPVB,

lt_vbfa type standard table of VBFAVB,

lt_vbfs type standard table of vbfs,

lt_vbkd type standard table of VBKDVB,

lt_vbls type standard table of VBLS,

lt_vbpa type standard table of VBPAVB,

lt_vbuk type standard table of vbuk,

lt_vbup type standard table of VBUPVB,

lt_dat type standard table of VLGGT_VORGABE_DATEN_S,

ls_dat type VLGGT_VORGABE_DATEN_S.

select * from VBAK into corresponding fields of table lt_vbak where vbeln = '3100000061'.

select * from VBAP into corresponding fields of table lt_vbap where vbeln = '3100000061'.

select * from VBEP into corresponding fields of table lt_vbep where vbeln = '3100000061'.

select * from VBFA into corresponding fields of table lt_vbfa where VBELV = '3100000061'.

select * from VBFs into corresponding fields of table lt_vbfs where vbeln = '3100000061'.

select * from VBKD into corresponding fields of table lt_vbkd where vbeln = '3100000061'.

select * from VBpa into corresponding fields of table lt_vbpa where vbeln = '3100000061'.

select * from VBUK into corresponding fields of table lt_vbuk where vbeln = '3100000061'.

select * from VBUp into corresponding fields of table lt_vbup where vbeln = '3100000061'.

data: ls_vbap type VBAPVB,

ls_vbls type VBLS.

loop at lt_vbap into ls_vbap.

ls_dat-RFBEL = ls_vbap-vbeln.

ls_dat-RFPOS = ls_vbap-posnr.

move-corresponding ls_vbap to ls_dat .

append ls_dat to lt_dat.

endloop.

ls_vbsk-MANDT = SY-MANDT.

ls_vbsk-PROGRAMM = SY-REPID.

ls_vbsk-SELSET = SY-SLSET.

ls_vbsk-BATCH = SY-BATCH.

ls_vbsk-ERNAM = SY-UNAME.

ls_vbsk-ERDAT = SY-DATLO.

ls_vbsk-UZEIT = SY-TIMLO.

ls_vbsk-SAMMG = Y.

ls_vbsk-VSTEL = 'D320'.

**L_VBSK-VTEXT = TVSTT-VTEXT. "Text zur Versandstelle

select single vtext from tvstt into ls_vtext where spras = 'E' and VSTEL = 'D320'.

Ls_VBSK-VTEXT = ls_vtext .

ls_vbsk-SMART = 'L'.

CALL FUNCTION 'RV_DELIVERY_CREATE'

EXPORTING

SELEKTIONSDATUM = sy-datum

vbsk_i = ls_vbsk

  • I_LIEFERART = ' '

IT_VORGABE_DATEN = lt_dat

  • IF_NUR_VORGABE_POS = ' '

  • IF_VBLS_POS_RUECK =

  • IF_SYNCHRON = 'X'

IF_NO_COMMIT = 'X'

  • IF_NO_DEQUE = ' '

  • IT_HU_SERNR =

  • IT_HANDLING_UNITS =

  • IS_DELIVERY_EXTEND =

  • IS_CONTROL =

  • IF_CHECK_SPEVI =

IMPORTING

  • VBSK_E =

ET_SPLITPROT = lt_split

tables

lvbak = lt_vbak

lvbap = lt_vbap

lvbep = lt_vbep

lvbfa = lt_vbfa

lvbfs = lt_vbfs

lvbkd = lt_vbkd

lvbls = lt_vbls

lvbpa = lt_vbpa

lvbuk = lt_vbuk

lvbup = lt_vbup