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: 

HI ABAP GURUS

Former Member
0 Kudos
254

HI ALL,

I M USING LT31 ( PRINT TRANSFER ORDER)......................IN BDC ..............

i m passing TO number ans TO item.................................................

this my code...........................

IF ITAB[] IS NOT INITIAL.

LOOP AT ITAB.

REFRESH BDCDATA.

PERFORM BDC_DYNPRO USING 'SAPML03T' '0125'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'RLDRU-SPOOL'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=DRU'.

PERFORM BDC_FIELD USING 'LTAK-LGNUM'

'W01'.

PERFORM BDC_FIELD USING 'LTAK-TANUM'

ITAB-TANUM."'804'."

  • PERFORM BDC_FIELD USING 'LTAP-VBELN'

  • '01'."ITAB-TAPOS.

PERFORM BDC_FIELD USING 'RL03T-TAPOS'

ITAB-TAPOS."'01'.

  • PERFORM BDC_FIELD USING 'RLDRU-DRUKZ'

  • '01'.

  • PERFORM BDC_FIELD USING 'RLDRU-LDEST'.

  • P_LDEST.

PERFORM BDC_FIELD USING 'RLDRU-SPOOL'

'01'.

PERFORM BDC_FIELD USING 'RLDRU-DRUCK'

'X'.

PERFORM BDC_FIELD USING 'RLDRU-TASCH'

'X'.

CALL TRANSACTION 'LT31' USING BDCDATA MODE 'A'.

ENDLOOP.

ENDIF.

it is printing multiple print of single TO number...........................

means........TO number,1 items.......TO number,2 item

but requirement is that for one TO one print..............

here i m passing items excluding cancel one..................

give me some solution ..........so that i can print all items of TO number in single print..

thanks in advance..........

Reghards,

Imran

1 ACCEPTED SOLUTION

Former Member
0 Kudos
126

Hi

Just bring the <b>Call trxn part of code, out of the loop</b>.

Regards

Raj

14 REPLIES 14

Former Member
0 Kudos
127

Hi

Just bring the <b>Call trxn part of code, out of the loop</b>.

Regards

Raj

0 Kudos
126

hi rajesekhar,

thanks for reply..............

i have done that before this..................

but it is only printing last item ot TO number............

thanks,

Imran

0 Kudos
126

Hi Imran,

Do As below

IF ITAB[] IS NOT INITIAL.

LOOP AT ITAB.

[<i>b]REFRESH BDCDATA.</b></i> <b>-> Remove this</b>

PERFORM BDC_DYNPRO USING 'SAPML03T' '0125'.

PERFORM BDC_FIELD USING 'BDC_CURSOR'

'RLDRU-SPOOL'.

PERFORM BDC_FIELD USING 'BDC_OKCODE'

'=DRU'.

PERFORM BDC_FIELD USING 'LTAK-LGNUM'

'W01'.

PERFORM BDC_FIELD USING 'LTAK-TANUM'

ITAB-TANUM."'804'."

  • PERFORM BDC_FIELD USING 'LTAP-VBELN'

  • '01'."ITAB-TAPOS.

PERFORM BDC_FIELD USING 'RL03T-TAPOS'

ITAB-TAPOS."'01'.

  • PERFORM BDC_FIELD USING 'RLDRU-DRUKZ'

  • '01'.

  • PERFORM BDC_FIELD USING 'RLDRU-LDEST'.

  • P_LDEST.

PERFORM BDC_FIELD USING 'RLDRU-SPOOL'

'01'.

PERFORM BDC_FIELD USING 'RLDRU-DRUCK'

'X'.

PERFORM BDC_FIELD USING 'RLDRU-TASCH'

'X'.

ENDLOOP.

CALL TRANSACTION 'LT31' USING BDCDATA MODE 'A'.

Reward points if useful.

Regards,

Atish

0 Kudos
126

Hi Imran,

Just try out for,

AT LAST item

call trxn in loop.

regards

Amol C.

0 Kudos
126

Try not to refresh BDCDATA..I am not sure but try it...I am also in a learning stage...

Former Member
0 Kudos
126

Hi Imran,

U can create/set some Print code to get the necessary action.

U can create/set the print code in the Print control table T329F.

PS: PLease reward points if useful..

0 Kudos
126

hi atish,

i tried as u said...................

but now it is only printing 1st item.............not all.............

thanks,

Imran

0 Kudos
126

Hi Imran,

This means there is something wrong with your recording. See while doing recording you might have used only one record. What I suggest is better re record with two to 3 entries and then change code accordingly. As you are calling this transaction in A mode see just check in debuging if all the data is filling up in BDCDATA or not and also see on which screen the program is stucking up.

Regards,

Atish

Former Member
0 Kudos
126

hi atish,

i have debug BDCDATA all data is coming.....which i want...................

now problem is only for printing..............................

currently it is printing first item of TO number.................

but actually there is 4 items.................

thanks,

Imran

0 Kudos
126

Hi Imran,

There are lots of things looking as hardcoded in your BDC. Can you just check as all the data coming correctly in BDCDATA.

Just rerecord the transaction if still probelm is there. It is a very small transaction so it won't take time.

Regards,

Atish

Former Member
0 Kudos
126

Hi Imran,

I think this transaction doesnot accept a range for TO item.

So this will take a single TO item.

But u can control the print,with the help of the Print Code.

What u can do is u can create a Print code in the table T329F, by setting the indicator SAMML-which will enable u to print transfer orders in combined list and

SORNR -Sort indicator for transfer order

accordingly.

U can give a try in this way.

Regards,Sree

PS:Reward points if USEFUL.

0 Kudos
126

hi srikanth,

thanks for the reply............

please give me the sample code ........for T329F.................

thanks,

imran

Former Member
0 Kudos
126

hi atish,

as u said i hv done recording again........but still same problem............

thanks,

Imran

Former Member
0 Kudos
126

Hi Imran,

Go to SPRO -> Logistics - General ->Logistics Execution ->Warehouse Management ->Activities ->Define Print Control.

here u can define a new print control, with the indicators SAMML = X,SORNR = 1/2/3/4.

and pass this in the Transaction LT31 as print code.

Regards,

Sree.

PS:Reward points if Useful.