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_MULTIPLE

former_member182371
Active Contributor
0 Kudos

Hi,

has anyone of you an example of how to create a TO for a delivery via FM L_TO_CREATE_MULTIPLE? or at least some useful hints?

Best regards.

15 REPLIES 15

Former Member
0 Kudos

Hello,

The FM U have mentiones in the forum is used by these Include.

LL2018U01 BAPI for Stock Data per Quant

LLMDEU09 Process IDoc WMMTOD01: Create transfer orders

LWFR5F0C

RLLT0G00 Return delivery to stock

RLS10034 Stock transfer per mouse click: Start

Try to do the same to ur report.

If useful award points.

Vasanth

sunilachyut
Contributor
0 Kudos

Is there any reason/restriction for not creating a TO using FM L_TO_CREATE_DN. Normally L_TO_CREATE_MULTIPLE is using for putaway's to bin, if there is no restriction let me know I can provide you details to create TO using L_TO_CREATE_DN.

hith

Sunil Achyut

former_member182371
Active Contributor
0 Kudos

Hi,

the data for input i intend to use are:

VBELN (delivery number)

and

VELNR.

Best regards.

former_member182371
Active Contributor
0 Kudos

Hi,

the correct 2nd value is VLENR.

(Sorry)

Best regards.

0 Kudos

Am not sure what field VLENR corresponds to but the following would be your call if you are trying to create a TO based on delivery:

CALL FUNCTION 'L_TO_CREATE_DN'

EXPORTING

i_lgnum = lwa_likp-lgnum

i_vbeln = lwa_likp-vbeln

it_delit = lt_delit

i_teilk = i_partialto "Partial TO Create

IMPORTING

e_tanum = lv_tanum

e_teilk = lv_teilk

EXCEPTIONS

ERROR_MESSAGE.

You have the option to commit and also if you are creating in an update task.

hith

Sunil Achyut

former_member182371
Active Contributor
0 Kudos

Hi,

VLENR stands for "Source storage unit number".

Best regards.

0 Kudos

The L_TO_CREATE_DN function module has an internal table in which you can specify the source storage unit number IT_DELIT. In your case you have to fill the POSNR (Delivery line item), ANFME (Quantity), ALTME (Alternative UOM) and VLENR and pass it to the function module along with the other parameters described in earlier reply.

You might also have to provide VLTYP, VLBER, VLPLA, VPPOS as a different bins can have the same unit number.

hith

Sunil Achyut

Message was edited by: Sunil Achyut

former_member182371
Active Contributor
0 Kudos

Hi,

this is the code i´m doing tests with:

REPORT Zxxx.

TABLES: LTAK, T340D, L03B_DELIT.

DATA: WHS_ID like lein-lgnum,

P_DELV_HEADERS_TABLE_VBELN like likp-vbeln,

LV_TEILK like t340d-teilv VALUE ' ',

LS_T340D like T340D.

CONSTANTS:

con_x type c value 'X'.

DATA: it_delit TYPE L03B_DELIT_t with header line.

DATA: lv_tanum type ltak-tanum.

CLEAR: WHS_ID, P_DELV_HEADERS_TABLE_VBELN.

WHS_ID = '130'.

P_DELV_HEADERS_TABLE_VBELN = '80000677'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = P_DELV_HEADERS_TABLE_VBELN

IMPORTING

OUTPUT = P_DELV_HEADERS_TABLE_VBELN.

SELECT SINGLE * FROM T340D INTO LS_T340D WHERE LGNUM = WHS_ID.

IF SY-SUBRC = 0.

IF LS_T340D-TEILV = CON_X.

LV_TEILK = CON_X.

ENDIF.

ENDIF.

CLEAR it_delit.

it_delit-posnr = '000010'.

it_delit-anfme = '10'.

it_delit-altme = 'UN'.

CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'

EXPORTING

INPUT = it_delit-altme

IMPORTING

OUTPUT = it_delit-altme.

it_delit-vltyp = 'AL1'.

it_delit-vlber = '001'.

it_delit-vlpla = 'AL1001'.

it_delit-vppos = '01'.

it_delit-vlenr = '0080000677'.

APPEND it_delit.

CALL FUNCTION 'L_TO_CREATE_DN'

EXPORTING

I_LGNUM = WHS_ID

I_VBELN = P_DELV_HEADERS_TABLE_VBELN

  • I_REFNR = ' '

  • I_SQUIT = ' '

  • I_NIDRU = ' '

  • I_DRUKZ = ' '

  • I_LDEST = ' '

  • I_KOMIM = ' '

  • I_EINLM = ' '

  • I_EINTA = ' '

  • I_NOSPL = ' '

  • I_UPDATE_TASK = ' '

I_COMMIT_WORK = CON_X

I_BNAME = SY-UNAME

I_TEILK = LV_TEILK

  • I_SOLEX = 0

  • I_PERNR = 0

IT_DELIT = IT_DELIT[]

IMPORTING

E_TANUM = LV_TANUM

E_TEILK = LV_TEILK

  • TABLES

  • T_LTAK =

  • T_LTAP_VB =

  • T_WMGRP_MSG =

EXCEPTIONS

FOREIGN_LOCK = 1

DN_COMPLETED = 2

PARTIAL_DELIVERY_FORBIDDEN = 3

XFELD_WRONG = 4

LDEST_WRONG = 5

DRUKZ_WRONG = 6

DN_WRONG = 7

SQUIT_FORBIDDEN = 8

NO_TO_CREATED = 9

TEILK_WRONG = 10

UPDATE_WITHOUT_COMMIT = 11

NO_AUTHORITY = 12

NO_PICKING_ALLOWED = 13

DN_HU_NOT_CHOOSABLE = 14

INPUT_ERROR = 15

OTHERS = 16

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

and the message i get is:

The transport order must have al least one position.

Why is this happening?.

Best regards.

0 Kudos

Can you please tell me if its a "Transport Order" or "Transfer Order". If its transfer order it might be because your it_delit internal table might not have records. Also your declaration of internal table shouldnt have a header line.

DATA: it_delit TYPE L03B_DELIT_t with header line.

Declare it the following way

DATA : l_it_delit type L03B_DELIT_t.

For some reason when you pass an internal table with header line the FM thinks there are no records in the internal table.

hith

Sunil Achyut

former_member182371
Active Contributor
0 Kudos

Hi Sunil,

it´s a transport order

Best regards

0 Kudos

Did you try changing the declaration of internal table as suggested. If yes, am not sure why its throwing that error. Can you try to debug and see where its complaining, that way you can atleast know which parameters are missing.

hith

Sunil Achyut

former_member182371
Active Contributor
0 Kudos

Hi Sunil and thanks for your interest,

I´ve done the corrections you propose and i get the following dump:

CALL_FUNCTION_CONFLICT_TYPE

CX_SY_DYN_CALL_ILLEGAL_TYPE

An exception occurred.

This exception will be dealt with in more detail below.

The exception, assigned to the class

'CX_SY_DYN_CALL_ILLEGAL_TYPE', was not caught, which led to a runtime error.

The reason for this exception is:

The call to the function module "L_TO_CREATE_DN" is incorrect:

The function module interface allows you to specify only fields of a particular type under "IT_DELIT".

The field "IT_DELIT" specified here has a different field type.

Best regards.

0 Kudos

Can you please post your code so that I can see whats going on.

hith

Sunil Achyut

former_member182371
Active Contributor
0 Kudos

Hi here goes the code:

REPORT ZTEST.

DATA: WHS_ID like lein-lgnum,

P_DELV_HEADERS_TABLE_VBELN like likp-vbeln,

LV_TEILK like t340d-teilv VALUE ' ',

LS_T340D like T340D.

CONSTANTS:

con_x type c value 'X'.

DATA: it_delit TYPE L03B_DELIT.

DATA: lv_tanum type ltak-tanum.

CLEAR: WHS_ID, P_DELV_HEADERS_TABLE_VBELN.

  • Número de almacén

WHS_ID = '130'.

  • Número de albarán de entrega

P_DELV_HEADERS_TABLE_VBELN = '0080000673'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = P_DELV_HEADERS_TABLE_VBELN

IMPORTING

OUTPUT = P_DELV_HEADERS_TABLE_VBELN.

SELECT SINGLE * FROM T340D INTO LS_T340D WHERE LGNUM = WHS_ID.

IF SY-SUBRC = 0.

IF LS_T340D-TEILV = CON_X.

LV_TEILK = CON_X.

ENDIF.

ENDIF.

CLEAR it_delit.

it_delit-posnr = '000010'.

it_delit-anfme = '1000'.

it_delit-altme = 'UN'.

CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'

EXPORTING

INPUT = it_delit-altme

IMPORTING

OUTPUT = it_delit-altme.

it_delit-vltyp = 'AL1'.

it_delit-vppos = '10'.

CALL FUNCTION 'L_TO_CREATE_DN'

EXPORTING

I_LGNUM = WHS_ID

I_VBELN = P_DELV_HEADERS_TABLE_VBELN

I_COMMIT_WORK = CON_X

I_BNAME = SY-UNAME

I_TEILK = LV_TEILK

IT_DELIT = IT_DELIT

IMPORTING

E_TANUM = LV_TANUM

E_TEILK = LV_TEILK

EXCEPTIONS

FOREIGN_LOCK = 1

DN_COMPLETED = 2

PARTIAL_DELIVERY_FORBIDDEN = 3

XFELD_WRONG = 4

LDEST_WRONG = 5

DRUKZ_WRONG = 6

DN_WRONG = 7

SQUIT_FORBIDDEN = 8

NO_TO_CREATED = 9

TEILK_WRONG = 10

UPDATE_WITHOUT_COMMIT = 11

NO_AUTHORITY = 12

NO_PICKING_ALLOWED = 13

DN_HU_NOT_CHOOSABLE = 14

INPUT_ERROR = 15

OTHERS = 16

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Best regards.

0 Kudos

Ok your problem is the function module is expecting an internal table as parameter and you are sending it a work area.

  • This is a work area and not an internal table

DATA: it_delit TYPE L03B_DELIT.

You can do two ways :

1) DATA: it_delit TYPE table of L03B_DELIT.

or

2) DATA: it_delit TYPE L03B_DELIT_t.

The first way is you are expicitly declaring an internal table. The second way is you are defining a internal table which refers to an internal table defined in DD.

To append the record declare a work area

DATA : l_wa_delit type L03B_DELIT

l_wa_delit-posnr = '000010'.

l_wa_delit-anfme = '1000'.

l_wa_delit-altme = 'UN'.

****Add the other fields in the work area

APPEND l_wa_delit TO it_delit.

Do the above and am assuming it should work this time.

hith

Sunil Achyut

Pl. award points if helpful