2013 Dec 05 6:29 AM
Hi,
II am creating the TO using the FM L_TO_CREATE_SINGLE and after that i need to confirm the TO using FM L_TO_CONFIRM.
but in my case To is created, but TO is not confirmed.
Please suggest me how to proceed further.
Regards,
Saran.
2013 Dec 05 7:08 AM
Hi Saran,
Once TO is created with L_TO_CREATE_SINGLE, Please check in the LTAK table. After that you can use the L_TO_CONFIRM.
The two function modules are having the import parameter of commit work. Please check this care fully
.VALUE(I_COMMIT_WORK) LIKE RL03B-COMIT DEFAULT 'X'
VALUE(I_UPDATE_TASK) LIKE RL03A-VERBU DEFAULT SPACE
You can check the detailed exceptions on confirmation TO.
Thanks,
Kiran
2013 Dec 05 6:45 AM
What execption does it raise... Did you use BAPI_TRANSACTION_COMMIT after its executiuon
2013 Dec 05 6:58 AM
No, simply if sy-subrc <> 0. then raising error message as 'TO has not confirmed'.
2013 Dec 05 7:01 AM
What is the exception number or sy-subrc value chekc in debugging..what are the values in SYST structure
Nabheet
2013 Dec 05 7:06 AM
sy-subrc = 8 and I am getting the error message as 'Execute zero stock check'
messsage id L3
message no 110.
2013 Dec 05 7:11 AM
When you have created the TO using L_TO_CREATE_SINGLE did you pass LTAP-NULKO as 1..? If yes then please pas it as blank then this error wont come.
Attach your sample code here
Nabheet
2013 Dec 05 7:46 AM
Hi Madan,
I am not passing LTAP-NULKO in the FM 'L_TO_CREATE_SINGLE'. To which field i need to pass this field.
2013 Dec 05 8:05 AM
In table T_LTAP_VB of function module create single. Please paste your sample code.
2013 Dec 05 8:06 AM
2013 Dec 05 8:10 AM
Hi
I am using in the Module pool.In the FM i am passing the commit work as suggested. But still the TO is not confirmed. here is the code.
*To confirm TO.
CALL FUNCTION 'L_TO_CONFIRM'
EXPORTING
i_lgnum = gw_lrf_wkqu-lgnum
i_tanum = i_tanum
i_squit = 'X'
* I_QUKNZ = ' '
* I_SUBST = ' '
i_qname = sy-uname
i_ename = sy-uname
* I_SOLEX = 0
* I_PERNR = 0
* I_STDAT = INIT_DATUM
* I_STUZT = 0
* I_ENDAT = INIT_DATUM
* I_ENUZT = 0
* I_ISTWM = 0
* I_KOMIM = ' '
* I_EINLM = ' '
* I_TBELI = ' '
i_update_task = ' '
i_commit_work = 'X'
* I_AUSFB = ' '
TABLES
t_ltap_conf = gt_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.
2013 Dec 05 7:08 AM
Hi Saran,
Once TO is created with L_TO_CREATE_SINGLE, Please check in the LTAK table. After that you can use the L_TO_CONFIRM.
The two function modules are having the import parameter of commit work. Please check this care fully
.VALUE(I_COMMIT_WORK) LIKE RL03B-COMIT DEFAULT 'X'
VALUE(I_UPDATE_TASK) LIKE RL03A-VERBU DEFAULT SPACE
You can check the detailed exceptions on confirmation TO.
Thanks,
Kiran
2013 Dec 05 7:13 AM
Hi Kiran,
Confirmation.
I need to declare the two import parameters as defaultly as 'X' and space.
2013 Dec 05 7:14 AM
Hi,
Put the break point and check the reason by debugging.
Please find the validations of Zero stock in below include.
Include: LL03BF0M
if tap-nulko = con_nulko_ja_s and
t_ltap_conf-kznul is initial and
t_ltap_conf-pista is initial and
tap-pvqui is initial.
message e311 with tap-tapos raising item_with_zero_stock_check.
endif.
if tap-nulko = con_nulko_nein and not t_ltap_conf-pista is initial.
message e318 raising wrong_zero_stock_check.
endif.
Thanks,
Kiran
2013 Dec 05 7:16 AM
Hi Saran,
Please find the explanation and apply as per your requirement. I hope it helps to you.
If I_COMMIT_WORK is set, the COMMIT WORK occurs within the function module, otherwise the calling program is responsible for the COMMIT.
Parameters I_UPDATE_TASK and I_COMMIT_WORK are closely related.
I_COMMIT_WORK controls whether or not a COMMIT WORK should be carried out within the function module.
I_UPDATE_TASK controls whether an asynchronous or synchronous update is to be carried out. The synchronous update occurs via SET UPDATE TASK LOCAL, meaning that the database update is only triggered if the ABAP command COMMIT WORK is given. If the COMMIT should first be carried out in the current programm, you cannot access the result of the function module in the database before the COMMIT is submitted.
A COMMIT WORK should always occur between two SAPLL03B function module calls if an I_COMMIT_WORK does not already produce this result. Otherwise, you run the risk of two consecutive TOs using the same stock, for example.
2013 Dec 05 7:35 AM
Hi Kiran,
Still thereis an issue
I have tried with that. But Break point was not triggered.
Please suggest me how to solve this one.
Regards,
Saran.
2013 Dec 05 7:47 AM
Hi Saran,
Can you please post your code here! have you check TO in LTAK table? The First FM is working fine or not!
Thanks,
Kiran
2013 Dec 05 8:05 AM
I am using in the Module pool.
My requirement is in the first screen TO will be created. In the next screen TO is to be confirmed.
First screen code.
TABLES: mlvs, mtcom, mgef, t334t, lprot, lmess.
TYPES:BEGIN OF ty_rl03a,
anfme TYPE rl03tanfme,
anfml TYPE rl03tanfml,
END OF ty_rl03a.
DATA: lw_rl03a TYPE ty_rl03a,
i_lprot TYPE TABLE OF lprot,
i_lmess TYPE TABLE OF lmess.
DATA : lv_altme TYPE ltap-altme ,
lv_nltyp TYPE ltap_nltyp.
lv_qty = ltap-nwirm .
lv_anfme = lv_qty .
lv_altme = lqua-meins.
lv_nltyp = destyp.
SELECT SINGLE werks
FROM t320
INTO v_werks
WHERE lgnum = gw_lrf_wkqu-lgnum.
SELECT SINGLE * FROM t340d
WHERE lgnum = gw_lrf_wkqu-lgnum.
SELECT SINGLE * FROM t333
WHERE lgnum = gw_lrf_wkqu-lgnum
AND bwlvs = '999'.
rl03a-anfme = ltap-nwirm.
rl03a-anfml = ltap-nwirm.
mtcom-kenng = 'MLVS'.
mtcom-matnr = gw_lqua-matnr.
mtcom-werks = gw_lqua-werks.
mtcom-lgnum = gw_lrf_wkqu-lgnum.
ltak-lgnum = gw_lrf_wkqu-lgnum.
ltak-bwlvs = '999'.
ltap-lgnum = gw_lrf_wkqu-lgnum.
ltap-matnr = gw_lqua-matnr.
ltap-werks = gw_lqua-werks.
ltap-meins = lv_altme.
ltap-altme = lv_altme.
ltap-vlpla = t333-vlpla.
ltap-lgort = '2000'.
*ltap-vltyp = gw_lqua-lgtyp.
*ltap-vlpla = gw_lqua-lgpla.
CALL FUNCTION 'MATERIAL_READ'
EXPORTING
schluessel = mtcom
IMPORTING
matdaten = mlvs
* RETURN =
* MATPER =
* TABLES
* SEQMAT01 =
EXCEPTIONS
account_not_found = 1
batch_not_found = 2
forecast_not_found = 3
lock_on_account = 4
lock_on_material = 5
lock_on_plant = 6
lock_on_sales = 7
lock_on_sloc = 8
lock_on_batch = 9
lock_system_error = 10
material_not_found = 11
plant_not_found = 12
sales_not_found = 13
sloc_not_found = 14
slocnumber_not_found = 15
sloctype_not_found = 16
text_not_found = 17
unit_not_found = 18
invalid_mch1_matnr = 19
invalid_mtcom = 20
sa_material = 21
wv_material = 22
waart_error = 23
t134m_not_found = 24
OTHERS = 25
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
mlvs-bezme = 'EA'.
mlvs-mtstb = 'ACTIVE'.
mlvs-vomem = 'L'.
mlvs-iprkz = 'D'.
CALL FUNCTION 'L_TO_PREPARE_ITEM_INT'
EXPORTING
i_ltak = ltak
i_ltap = ltap
i_mlvs = mlvs
i_mgef = mgef
i_rl03a = rl03a
i_t333 = t333
i_t334t = t334t
i_t340d = t340d
IMPORTING
e_ltap = ltap
* E_REDUZ =
TABLES
t_lprot = i_lprot
t_lmess = i_lmess
EXCEPTIONS
call_forbidden = 1
OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'L_TO_CREATE_SINGLE'
EXPORTING
i_lgnum = gw_lrf_wkqu-lgnum "Warehouse num
i_bwlvs = '999'
* I_BETYP = ' '
* I_BENUM = ' '
i_matnr = gw_lqua-matnr "Article num
i_werks = v_werks "Plant/Site
* I_LGORT = ' '
* I_CHARG = ' '
* I_BESTQ = ' '
* I_SOBKZ = ' '
* I_SONUM = ' '
* I_LETYP = ' '
i_anfme = lv_anfme "Qty
i_altme = lv_altme "UOM
* I_WDATU = INIT_DATUM
* I_VFDAT = INIT_DATUM
* I_ZEUGN = ' '
* I_LZNUM = ' '
* I_SQUIT = ' '
* I_NIDRU = ' '
* I_DRUKZ = ' '
* I_LDEST = ' '
* I_WEMPF = ' '
* I_ABLAD = ' '
i_vltyp = gw_lqua-lgtyp "Source SType
* I_VLBER = ' '
i_vlpla = gw_lqua-lgpla "Source SBin
* I_VPPOS = ' '
* I_VLENR = ' '
* I_VLQNR = ' '
i_nltyp = lv_nltyp "Dest SType
* I_NLBER = ' '
* I_NLPLA = ' '
* I_NPPOS = ' '
* I_NLENR = ' '
* I_NLQNR = ' '
* I_RLTYP = ' '
* I_RLBER = ' '
* I_RLPLA = ' '
* I_RLQNR = ' '
I_UPDATE_TASK = ' '
I_COMMIT_WORK = 'X'
* I_BNAME = SY-UNAME
* I_KOMPL = 'X'
* I_SOLEX = 0
* I_PERNR = 0
* I_AUSFB = ' '
IMPORTING
e_tanum = i_tanum
* E_LTAP =
* TABLES
* T_LTAK =
* T_LTAP_VB =
EXCEPTIONS
no_to_created = 1
bwlvs_wrong = 2
betyp_wrong = 3
benum_missing = 4
betyp_missing = 5
foreign_lock = 6
vltyp_wrong = 7
vlpla_wrong = 8
vltyp_missing = 9
nltyp_wrong = 10
nlpla_wrong = 11
nltyp_missing = 12
rltyp_wrong = 13
rlpla_wrong = 14
rltyp_missing = 15
squit_forbidden = 16
manual_to_forbidden = 17
letyp_wrong = 18
vlpla_missing = 19
nlpla_missing = 20
sobkz_wrong = 21
sobkz_missing = 22
sonum_missing = 23
bestq_wrong = 24
lgber_wrong = 25
xfeld_wrong = 26
date_wrong = 27
drukz_wrong = 28
ldest_wrong = 29
update_without_commit = 30
no_authority = 31
material_not_found = 32
lenum_wrong = 33
OTHERS = 34 .
IF sy-subrc = 0.
CALL SCREEN 0303.
ELSE.
PERFORM clear_messages.
message_id = 'ZWM'.
message_number = '001'.
message_var1 = text-167.
lv_screen = '302'.
lrf_wkqu-devty = '16X20'.
PERFORM zmob_error_mess.
ENDIF.
ENDFORM. " CREATE_TO
Second screen code
*To confirm TO.
CALL FUNCTION 'L_TO_CONFIRM'
EXPORTING
i_lgnum = gw_lrf_wkqu-lgnum
i_tanum = i_tanum
i_squit = 'X'
* I_QUKNZ = ' '
* I_SUBST = ' '
i_qname = sy-uname
i_ename = sy-uname
* I_SOLEX = 0
* I_PERNR = 0
* I_STDAT = INIT_DATUM
* I_STUZT = 0
* I_ENDAT = INIT_DATUM
* I_ENUZT = 0
* I_ISTWM = 0
* I_KOMIM = ' '
* I_EINLM = ' '
* I_TBELI = ' '
i_update_task = ' '
i_commit_work = 'X'
* I_AUSFB = ' '
TABLES
t_ltap_conf = gt_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.
2013 Dec 05 8:15 AM
FM L_TO_CREATE_SINGLE is working fine, but the TO is not confirmed.
2013 Dec 05 8:32 AM
in function call of 'L_TO_PREPARE_ITEM_INT' pass LTAP-NULKO as 0.
Nabheet
2013 Dec 05 8:43 AM
Hi,
Dont fill the Squit as 'X'. Please put it as space.
If I_SQUIT is set, all open TO items for a transfer order, which were not explicitly transferred in T_LTAP_CONF, are confirmed without differences. This can lead to errors if items with zero stock check, or withdrawals from storage unit managed bulk storage are contained in this 'remaining quantity', since these items must be confirmed explicitly via T_LTAP_CONF.
2013 Dec 05 8:49 AM
call function 'L_TO_CONFIRM'
exporting
i_lgnum = i_lgnum
i_tanum = i_tanum
i_squit = i_squit ( keep it as default as per FM)
i_subst = i_subst ( Keep it as default as per FM)
i_ename = sy-uname
i_update_task = i_update_task (keep it as default)
i_commit_work = i_commit_work ( Keep it as default)
2013 Dec 05 9:19 AM
As per suggested I have executed like this. But the error message has occured.
message id-- L3
message no--321(No item for confirmation)
below is the FM
CALL FUNCTION 'L_TO_CONFIRM'
EXPORTING
i_lgnum = gw_lrf_wkqu-lgnum
i_tanum = i_tanum
* i_squit = 'X'
* I_QUKNZ = ' '
* I_SUBST = ' '
* i_qname = sy-uname
i_ename = sy-uname
* I_SOLEX = 0
* I_PERNR = 0
* I_STDAT = INIT_DATUM
* I_STUZT = 0
* I_ENDAT = INIT_DATUM
* I_ENUZT = 0
* I_ISTWM = 0
* I_KOMIM = ' '
* I_EINLM = ' '
* I_TBELI = ' '
* i_update_task = ' '
* i_commit_work = 'X'
* I_AUSFB = ' '
TABLES
t_ltap_conf = gt_ltap_conf
* T_LTAP_CONF_HU =
* T_LTAP_CONF_HU_SERIAL =
2013 Dec 05 9:34 AM
In that FM thereis no field like LTAP-NULKO. How to pass to the FM.
Please suggest me
2013 Dec 05 9:50 AM
2013 Dec 05 9:57 AM
Hi Saran,
It is working fine for me, check the below code . I am able to confirm the Transfer Order, Check the code
data: begin of it_ltap_conf occurs 0.
include structure ltap_conf.
data: end of it_ltap_conf.
data: begin of it_ltap occurs 0.
include structure ltap.
data: end of it_ltap.
parameters: p_lgnum type lgnum,
p_tanum type tanum,
p_tapos type tapos.
SELECT SINGLE * FROM ltap
INTO CORRESPONDING FIELDS OF it_ltap
WHERE lgnum EQ p_lgnum
AND tanum EQ p_tanum
AND tapos EQ p_tapos.
UPDATE ltap SET nplei = '1'
WHERE lgnum EQ it_ltap-lgnum
AND tanum EQ it_ltap-tanum
AND tapos EQ it_ltap-tapos.
MOVE-CORRESPONDING it_ltap TO it_ltap_conf.
it_ltap_conf-nista = it_ltap-vsola.
append it_ltap_conf.
call function
'L_TO_CONFIRM'
exporting
i_lgnum = p_lgnum
i_tanum = p_tanum
i_squit = ' '
i_qname = sy-uname
I_ENAME = SY-UNAME
i_komim = ' '
i_update_task = ' '
i_commit_work = 'X'
tables
t_ltap_conf = it_ltap_conf
2013 Dec 05 11:54 AM
Thankful to you Kiran for your suggestions.
My problem was resolved.
Regards,
Saran
2013 Dec 05 11:56 AM
2013 Dec 05 12:27 PM
What was the solution please document it here so that someone else can use it
2013 Dec 05 4:13 PM
Hi Saran,
Good to know that, Can you please close the thread with you comments are findings in to resolve the issue.
Thanks,
Kiran
2013 Dec 06 7:41 AM
Hi
Again the same issue has been raised.
While creating the TO, I am passing the trasfer qty(i_anfme), source storage type is HR1 and dest Stype is HR1. If I pass above parameters TO is not created. But if I pass the Destination Stype as HR2, TO is created. But in this case TO is not created.
Please help me.
Regards,
Saran.
2013 Dec 06 7:44 AM
What error do you get? Which exception is raised... You are creating for same soruce and destination storage type is it feasible?
Nabheet
2013 Dec 06 7:48 AM
Hi,
Again the issue araised.
Please help me how to solve.
In my FM 'L_TO_PREPARE_ITEM_INT' there no field like LTAP-NULKO.
2013 Dec 06 7:58 AM
Hi
It is feasible.
In my requirement, in one screen there is total QTy(GESME) and Available qty(VERME) and Transfer qty as input field and Dest Stype as input fields.
If I enter the transfer qty less than total qty and Dest Stype as HR1 or HR2. then TO will be created and TO will also confirmed.
In the second case, If I enter the Transfer Qty equal to Total qty and dest stype as HR1, the TO is not created. The error message I am getting is 'Storage type HR1 only allows one storage unit per bin'.
Please help me how to solve.
2013 Dec 06 7:59 AM
Hi Saran,
Please understand my explanation below and it is very important to understand the issue.
In general Transfer Order will be created to remove the goods from whare house( Goods Issue ) or placing the goods in the Warehouse ( Goods receipts ).
-> picking transfer order in case of sales
-> Putaway transfer orders in case of Purchasing
This is just printed document to pick or putaway the goods from whare house. Once Picker can Pick or putaway the goods in wharehouse. He confirms it.
Before confirming the TO, It is required to move the goods from which source and destination is required.
In your case if your source and storage types are same and what about bins? it is purely a configuration issue and business purpose involved in this scenario. Check with your functional s?
In my code I have update the NPLEI AS 1 - Storage bin can be changed during confirmation
Thanks,
Kiran
2013 Dec 06 8:03 AM
Hi Saran
Kiran has put his explanantion in such a simple way please understand that. Awesome Kiran:)
function module I_LTAP parameter work area has NULKO
Nabheet
2013 Dec 06 8:11 AM
I understood what u said.
But in another case, If I enter the Dest Storage type as HR2, In this case TO is created and TO is not confirmed.
2013 Dec 06 8:54 AM
2013 Dec 06 9:10 AM
Hi Saran,
I would suggest you go the LT12 transaction and try to confirm the TO. Check still you are getting the same message. If you are able to confirm via transaction, will check the BAPI parameters.
According to your error, some time a storage type will assign to the only a fixed bin!
I hope this will help you to trace the error in the coding.
Thanks,
Kiran
2013 Dec 06 10:57 AM
I have passed LTAP-Nulko. After that one error came i.e. No alternative unit of measure specified.
Like this it is coming.
2013 Dec 06 11:02 AM