Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

L_TO_CREATE_TR testrunresult differs from programresult

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

9 REPLIES 9

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

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.