‎2006 Jan 16 5:12 PM
Girls,
I use L_TO_CREATE_TR to create a TO refering to a TransportRequest. Works fine, but the palletnumber that I store in IT_TRITE-NLENR does not show up where it should: in the resulting TO in the field NLENR (LT21, Tab Dest.data, field Dest.storage unit)
Ok, happens. But:
When I enter the exact same data in SE37 in the testrundata as is passed to the functionmodule in my program, the palletnumber is stored nicely in the new TO!!
Anybody for any tips how to solve this mystery?
Best regards,
Tim van Steenbergen
‎2006 Jan 16 5:26 PM
SE37 will take care of internal-to-external and external-to-internal conversions needed, whereas you need to do that in your code if you are calling the same function module. See if you need to pass the pallet number in internal format.
Srinivas
‎2006 Jan 16 5:26 PM
SE37 will take care of internal-to-external and external-to-internal conversions needed, whereas you need to do that in your code if you are calling the same function module. See if you need to pass the pallet number in internal format.
Srinivas
‎2006 Jan 16 5:56 PM
Thank you!! The leading zeros fouled me again!@#$%$#@ When am I going to learn?
All I had to do was to add 12 zeros in front of the 8 meaningfull digits and now it works fine.
Thank again,
Tim van Steenbergen
Message was edited by: Tim van Steenbergen
‎2006 Jan 30 6:40 PM
Tim,
Can you post the ABAP you are using to populate IT_TRITE and the subsequent function call. I am struggling with the IT_TRITE population part and any help will be appreciated.
Thanks,
Hari
‎2006 Jan 30 8:49 PM
Hari, here you go:
This is the ABAP and the FM-call:
data LT_TRITE type L03B_TRITE_T.
data WA_TRITE like line of LT_TRITE.
data GV_STORED like VBAPF-QMENGE.
clear: LT_TRITE, WA_TRITE, GV_STORED.
refresh LT_TRITE.
WA_TRITE-TBPOS = GT_LTBP-TBPOS.
WA_TRITE-ANFME = GT_LTBP-MENGE.
WA_TRITE-ALTME = GT_LTBP-MEINS.
WA_TRITE-LETYP = GT_MARA-VHART(3). "3-character storageunittype
concatenate '000000000000' LTAP-NLENR+10(8) into WA_TRITE-NLENR.
"FM L_TO_CREATE_TR wants 20 characters
if GV_DIR = 'N'.
WA_TRITE-NLTYP = '120'.
WA_TRITE-NLPLA = 'OVERDRACHT'.
else.
WA_TRITE-NLTYP = P_NLTYP.
WA_TRITE-NLPLA = P_NLPLA.
endif.
append WA_TRITE to LT_TRITE.
TO aanleggen
clear GT_LTAP_VB.
refresh GT_LTAP_VB.
call function 'L_TO_CREATE_TR'
exporting
I_LGNUM = GC_LGNUM_011 "LGNUM is '011' in my case
I_TBNUM = GT_LTBP-TBNUM
IT_TRITE = LT_TRITE
importing
e_tanum = gv_tanum
tables
T_LTAP_VB = GT_LTAP_VB
exceptions
FOREIGN_LOCK = 1
QM_RELEVANT = 2
TR_COMPLETED = 3
XFELD_WRONG = 4
LDEST_WRONG = 5
DRUKZ_WRONG = 6
TR_WRONG = 7
SQUIT_FORBIDDEN = 8
NO_TO_CREATED = 9
UPDATE_WITHOUT_COMMIT = 10
NO_AUTHORITY = 11
PREALLOCATED_STOCK = 12
PARTIAL_TRANSFER_REQ_FORBIDDEN = 13
INPUT_ERROR = 14
others = 15.
if SY-SUBRC <> 0.
commit work."See FM L_TO_CREATE_TR docu: commit work is needed
perform MELDT_DE_FOUT using SY-MSGID SY-MSGTY SY-MSGNO
SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
else.
This is how IT_TRITE is filled with a testrun in SE37:
TBPO 1
ANFME 1,000
ALT KI
NLENR 79999688 "so, no leading zeros here in SE37
LET BPH
All others empty.
Hopefully helpfull,
Best regards,
Tim van Steenbergen
‎2006 Mar 13 2:41 PM
When running L_TO_CREATE_TR for stock removal i have no problems, the stock is removed from source bin.
But when using L_TO_CREATE_TR for stock placement (to storage Bin, Mvt 312) and when i give in a destination bin the materials are placed on a dynamic bin and not the bin that is entered in the L_TO_CREATE_TR in NLPLA.
Can anybody say what input i do not give or what customizing mistakes i do not see?
Thanx
Coeno den Engelsman
input fields are:
MANDT 800
LGNUM 001
TANUM 0000000380
TAPOS 0000
TBPOS 0001
VORGA TB
NLTYP 001
NLBER 001
NLPLA 01-01-04
BWLVS 312
‎2006 Mar 13 2:50 PM
No time to do that, but here is how yu can figure out if you neeed to tweek customizing or the program:
Do the same with via LT01. If the result is the same, something needs to be customised, else your inputvalues needs adjustement
‎2006 Mar 13 3:11 PM
I am using this Function Module as replacement of LT04.
Because i use this to create a TO based on TR
if i do it with LT04 i have no problems and i can book the transfer on destination bin
‎2006 Mar 17 2:23 PM
Hi,
do you know a function module for creating TO based on material document? Normally i use LB12, and create TO on foreground.
Do you know which function module can do this?
thanx
‎2009 May 04 11:04 PM
Coeno,
Were you able to solve the below issue. I am trying something similar. I want to specify the destination storage unit number in FM 'L_TO_CREATE_TR' (IT_TRITE-NLENR) but SAP over writes it with new SU. I am able to acheive the same using 'LT04' but not through FM. 'L_TO_CREATE_TR' documentation informs that it works in the same way as calling 'LT04' in background. Does this mean we will not be able to control destination bin/SU when calling this FM?
Regards,
Suri.