SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Create Delivery using SHP_VL10_DELIVERY_CREATE



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> SD
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Wed Nov 07, 2007 12:12 am    Post subject: Create Delivery using SHP_VL10_DELIVERY_CREATE Reply with quote

Create Delivery from Sales Order Document using
FM SHP_VL10_DELIVERY_CREATE:

Code:
DATA:
if_ledat TYPE lfdat_a,
if_nur_vorgabe_pos TYPE xfeld,
it_key_to_enque_t TYPE shp_vl10_package_t,
it_key_to_enque LIKE LINE OF it_key_to_enque_t,
it_komdlgn_t TYPE shp_komdlgn_t,
cx_sd_order TYPE shp_vl10_sd_order,
ct_vbsk_all_t TYPE shp_vbsk_t,
ct_vbls_t TYPE shp_vbls_t,
ct_key_late TYPE shp_vl10_package_t,
ct_vorgabe_daten_t TYPE shp_vorgabe_daten_t,
ct_vorgabe_daten LIKE LINE OF ct_vorgabe_daten_t,
wa_dlvsrc LIKE LINE OF m_it_dlvsrc,
msg TYPE string.


LOOP AT m_it_dlvsrc
INTO wa_dlvsrc.

CLEAR it_key_to_enque.
it_key_to_enque-panum = '1'.
it_key_to_enque-vbobj = 'A'.
it_key_to_enque-vbtyp = 'C'.
it_key_to_enque-vbeln = wa_dlvsrc-vbeln.
it_key_to_enque-posnr = wa_dlvsrc-posnr.
it_key_to_enque-id = '1'.
it_key_to_enque-tabix = '1'.
it_key_to_enque-vstel = wa_dlvsrc-vstel.
APPEND it_key_to_enque TO it_key_to_enque_t.

CLEAR ct_vorgabe_daten.
ct_vorgabe_daten-vgbel = it_key_to_enque-vbeln.
ct_vorgabe_daten-vgpos = it_key_to_enque-posnr.
ct_vorgabe_daten-lfimg = wa_dlvsrc-lfimg.
ct_vorgabe_daten-akmng = 'B'.
ct_vorgabe_daten-postab_tabix = it_key_to_enque-tabix.
ct_vorgabe_daten-panum = it_key_to_enque-panum.
ct_vorgabe_daten-id = it_key_to_enque-id.
APPEND ct_vorgabe_daten TO ct_vorgabe_daten_t.
ENDLOOP.


if_ledat = sy-datum.
if_nur_vorgabe_pos = 'X'.

CALL FUNCTION 'SHP_VL10_DELIVERY_CREATE'
EXPORTING
if_ledat = if_ledat
if_nur_vorgabe_pos = if_nur_vorgabe_pos
it_key_to_enque = it_key_to_enque_t
it_komdlgn = it_komdlgn_t
CHANGING
cx_sd_order = cx_sd_order
ct_vbsk_all = ct_vbsk_all_t
ct_vbls = ct_vbls_t
ct_key_late = ct_key_late
ct_vorgabe_daten = ct_vorgabe_daten_t.

COMMIT WORK AND WAIT.

All created deliveries numbers:
SELECT vbeln
INTO TABLE m_it_vbeln
FROM vbss
FOR ALL ENTRIES IN ct_vbsk_all_t
WHERE sammg = ct_vbsk_all_t-sammg.

All errors during processing:
SELECT msgid msgno msgv1 msgv2 msgv3 msgv4
INTO TABLE it_msg
FROM vbfs
FOR ALL ENTRIES IN ct_vbsk_all_t
WHERE sammg = ct_vbsk_all_t-sammg.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> SD All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.