Crear_ot y confirmar_ot.
Crear OT:
Primero se verifica el status de la orden, de esta forma sólo se confirma en caso de que no
lo esté:
SELECT SINGLE kquit
FROM ltak
INTO kquit
WHERE lgnum EQ p_stloc
AND tanum EQ p_tanum.
Luego se obtienen las posiciones de la orden de transporte y se llena la tabla que recibirá el
módulo de función de confirmación:
*Se obtienen las posiciones de la orden de transporte
SELECT tapos pquit
FROM ltap
INTO TABLE it_ltap
WHERE lgnum EQ p_stloc
AND tanum EQ p_tanum.
LOOP AT it_ltap.
APPEND it_ltap_conf.
CLEAR it_ltap_conf.
ENDLOOP.
*Confirmar orden
CALL FUNCTION 'L_TO_CONFIRM'
EXPORTING
i_lgnum = p_stloc
i_tanum = p_tanum
i_squit = 'X'
TABLES
t_ltap_conf = it_ltap_conf
* T_LTAP_CONF_HU =
* T_LTAP_CONF_HU_SERIAL =
EXCEPTIONS
to_confirmed = 1
to_doesnt_exist = 2
item_confirmed = 3
item_subsystem = 4
item_doesnt_exist = 5
item_without_zero_stock_check = 6
item_with_zero_stock_check = 7
one_item_with_zero_stock_check = 8
item_su_bulk_storage = 9
item_no_su_bulk_storage = 10
one_item_su_bulk_storage = 11
foreign_lock = 12
squit_or_quantities = 13
vquit_or_quantities = 14
bquit_or_quantities = 15
quantity_wrong = 16
double_lines = 17
kzdif_wrong = 18
no_difference = 19
no_negative_quantities = 20
wrong_zero_stock_check = 21
su_not_found = 22
no_stock_on_su = 23
su_wrong = 24
too_many_su = 25
nothing_to_do = 26
no_unit_of_measure = 27
xfeld_wrong = 28
update_without_commit = 29
no_authority = 30
lqnum_missing = 31
charg_missing = 32
no_sobkz = 33
no_charg = 34
nlpla_wrong = 35
two_step_confirmation_required = 36
two_step_conf_not_allowed = 37
pick_confirmation_missing = 38
quknz_wrong = 39
hu_data_wrong = 40
no_hu_data_required = 41
hu_data_missing = 42
hu_not_found = 43
picking_of_hu_not_possible = 44
not_enough_stock_in_hu = 45
serial_number_data_wrong = 46
serial_numbers_not_required = 47
no_differences_allowed = 48
serial_number_not_available = 49
serial_number_data_missing = 50
to_item_split_not_allowed = 51
input_wrong = 52
OTHERS = 53
.