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: 

BAPI for transfer order creation - LT03

Former Member
0 Kudos

Hello Community,

Could you advice on the BAPI for creation of transfer orders in LT03?

Thanks in advance,

PT

18 REPLIES 18

former_member188685
Active Contributor
0 Kudos

Don't think that this is not a BAPI(but it is RFC) if you want to use this from external system.

use any one of the below..

L_TO_CREATE_MULTIPLE
L_TO_CREATE_SINGLE

I used one of my requirements it is working fine..

Former Member
0 Kudos

Hi developer,

Function Module 'L_TO_CREATE_DN' should do it.

Example:

DATA lt_ltak TYPE STANDARD TABLE OF ltak_vb WITH HEADER LINE.
"TO Header
DATA lt_ltap1 TYPE STANDARD TABLE OF ltap_vb WITH HEADER LINE.
"TO Items
DATA lt_msg TYPE STANDARD TABLE OF wmgrp_msg WITH HEADER LINE.
DATA lt_delit TYPE TABLE OF l03b_delit.
DATA lt_wa_delit TYPE l03b_delit.
"TO Items with Pallet data
DATA lv_tanum TYPE ltak-tanum. "TO Number

LOOP AT t_pallet.
MOVE t_pallet-posnr TO lt_wa_delit-posnr.
MOVE t_pallet-curr_qty TO lt_wa_delit-anfme.
MOVE t_pallet-vrkme TO lt_wa_delit-altme.
MOVE t_pallet-charg TO lt_wa_delit-charg.
MOVE t_pallet-lgtyp TO lt_wa_delit-vltyp.
MOVE t_pallet-lgpla TO lt_wa_delit-vlpla.

UNPACK t_pallet-lenum TO lt_wa_delit-vlenr.

APPEND lt_wa_delit TO lt_delit.
CLEAR lt_wa_delit.

ENDLOOP.

    * Bapi to Create the TO

CALL FUNCTION 'L_TO_CREATE_DN'
EXPORTING
i_lgnum = t_user-lgnum
i_vbeln = zmilk_zlm26_str-vbeln
i_squit = c_true
it_delit = lt_delit
IMPORTING
e_tanum = lv_tanum
TABLES
t_ltak = lt_ltak
t_ltap_vb = lt_ltap1
t_wmgrp_msg = lt_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.

Regards

Anup.

0 Kudos

Hi Anup,

I am doing RF programming & need to get data or create TO in background,

can u help me on that

thanks in advance its urgent

Regards

Tabrez

Former Member
0 Kudos

Hello,

I'm using 'L_TO_CREATE_DN' to create the delivery note as sugested but I need to pass the value of ZEUGN(Certificate field).

Do you know were to fill the field?

Thanks in advance,

PT

0 Kudos

You can pass the info using the Below functions..

You need to pass that to LTAP structure.

L_TO_CREATE_MULTIPLE
L_TO_CREATE_SINGLE

0 Kudos
TABLES
*"              T_LTAP_CREAT

you can find the Parameter in the table T_LTAP_CREAT

you can fill that here.

Former Member
0 Kudos

Hi,

Try this coding

Function Module 'L_TO_CREATE_DN' should do it.

Example:

DATA lt_ltak TYPE STANDARD TABLE OF ltak_vb WITH HEADER LINE.

"TO Header

DATA lt_ltap1 TYPE STANDARD TABLE OF ltap_vb WITH HEADER LINE.

"TO Items

DATA lt_msg TYPE STANDARD TABLE OF wmgrp_msg WITH HEADER LINE.

DATA lt_delit TYPE TABLE OF l03b_delit.

DATA lt_wa_delit TYPE l03b_delit.

"TO Items with Pallet data

DATA lv_tanum TYPE ltak-tanum. "TO Number

LOOP AT t_pallet.

MOVE t_pallet-posnr TO lt_wa_delit-posnr.

MOVE t_pallet-curr_qty TO lt_wa_delit-anfme.

MOVE t_pallet-vrkme TO lt_wa_delit-altme.

MOVE t_pallet-charg TO lt_wa_delit-charg.

MOVE t_pallet-lgtyp TO lt_wa_delit-vltyp.

MOVE t_pallet-lgpla TO lt_wa_delit-vlpla.

UNPACK t_pallet-lenum TO lt_wa_delit-vlenr.

APPEND lt_wa_delit TO lt_delit.

CLEAR lt_wa_delit.

ENDLOOP.

Bapi to Create the TO

CALL FUNCTION 'L_TO_CREATE_DN'

EXPORTING

i_lgnum = t_user-lgnum

i_vbeln = zmilk_zlm26_str-vbeln

i_squit = c_true

it_delit = lt_delit

IMPORTING

e_tanum = lv_tanum

TABLES

t_ltak = lt_ltak

t_ltap_vb = lt_ltap1

t_wmgrp_msg = lt_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.

hope this helps you.

\[removed by moderator\]

Thanks & Regards,

Y.R.Prem Kumar

Edited by: Jan Stallkamp on Jul 30, 2008 4:24 PM

0 Kudos

Hi Prem

You copied the same code posted by the above user, Did you notice that.

Please check before posting

Former Member
0 Kudos

Hello,

But I need to use VBELN...

Thanks,

PT

0 Kudos

you can make use of T_LATP_CREAT and T_LTAK to send the information

TABLES

*" T_LTAP_CREAT STRUCTURE LTAP_CREAT

*" T_LTAK STRUCTURE LTAK_VB OPTIONAL

0 Kudos

You have to call L_TO_SET_SPECIAL before the FM L_TO_CREATE_MULTIPLE.

CALL FUNCTION 'L_TO_SET_SPECIAL'

EXPORTING

i_spezi = 'B'

i_vbeln = <your VBELN>

EXCEPTIONS

call_forbidden = 1

input_wrong = 2

OTHERS = 3.

Damiano

0 Kudos

Hello Damiano,

I didn't succeed in applying your answer, could you please give a code example which is working ?

Tkanks

Blsap

Former Member
0 Kudos

were you able to solve this issue, i have the same issue and i tried to use the it_ltap table with certificate number but it doesnt update....

The table parameter of the FM also has the description , table for created TO items.

0 Kudos

Hello,

No, I wasn't able to solve this with the BAPI...

Former Member
0 Kudos

I am having the same issue that was discussed in this thread. I am able to create a TO for a delivery (like LT03) using L_TO_CREATE_DN. My issue is the ZEUGN field is not available in the table IT_DELIT. Creating entries in the L_LTAP_VB table doesn't seem to help.

Has anyone been able to use this function module and successfully get it to create the transfer order AND populate the ZEUGN field. Tried the L_TO_CREATE_SINGE and L_TO_CREATE_MULTIPLE, but these do not update the document flow, so sticking with trying to get the L_TO_CREATE_DN to work. I am open to any other options (other fm's, bapis,...).

Appreciate any feedback I can get on this.

thanks,

Chip

0 Kudos

Hello, Clyde Sanders.

Have you solve the issue? I have the similar situation - trying to use L_TO_CREATE_MULTIPLE, but this function is not filling VBELN field of LTAK table, and after confirmation of TO there are no packs in delivery document flow.

Thanks,

Roman

0 Kudos

Was unable to get past this. Tried using the table T_LTAP_VB but never could get it to recognize anything I put in there.

This is still an open issue for me.

0 Kudos

Is this tip helps u? that, usage of EXPORT & IMPORT in user exits.

thanq