cancel
Showing results for 
Search instead for 
Did you mean: 

pick list print issue?

Former Member
0 Kudos
110

Hello Friends,

I have a printing issue with my client,

For specific customers they ship very large kits(BOM's) and require ship labels to print for each component listed on the picklist , in addition to the regular ship label for the header material YX.

These components are item category YF (purposely omitted for delivery note).

They do not want this to print of every customer, Please advice how we can add a logic to print shipping labels for components only for specific customers.

thanks;

Mike

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi,

Currently i am working on similar object

We have developed Zprogram for the project. We are using bar code printer which is used to print the lables.

1. Developed a zprogram with selection screen child & parent material radio buttons. so whenver u click child material it will create label only for components apart from header material.

2.Program generates a text file with component details and downloads it to the Application server

3. Once the text fiole get downloaded & bar code printer is ON , it will automatically prints the labels. If the barcode printer is OFF, then u will be able to see the text files

Please find the Zprogram used, pls take help of ur ABAPER to cchnage the plants & details corresponding to ur setup

REPORT ZKITTAG message-id z_apd.

tables : mseg,

makt,

mkpf,

zmmstoragebin,

t001w,

mast,

stpo.

**SELECTION SCREEN

selection-screen : begin of block blk1 with frame title text-001.

parameters : p_werks type ekpo-werks obligatory.

parameters : s_mblnr type mseg-mblnr obligatory.

select-options : s_matnr for mseg-matnr obligatory no intervals

no-extension.

parameters:p_child radiobutton group rad,

p_parent radiobutton group rad.

*parameters : no type i.

selection-screen : end of block blk1.

data :begin of it_mseg_header occurs 0,

MBLNR LIKE MSEG-MBLNR,

MJAHR LIKE MSEG-MJAHR,"Kiran 28.06.2008

EBELN LIKE MSEG-EBELN,

MATNR LIKE MSEG-MATNR,

MENGE like mseg-menge,

BWTAR LIKE MSEG-BWTAR,

meins like mseg-meins,

MAKTX LIKE MAKT-MAKTX,

menge1(19),

STORAGE LIKE ZMMSTORAGEBIN-STORAGE, "Sridhar on 22082005

WERKS LIKE MSEG-WERKS, "Sridhar on 22082005

end of it_mseg_header.

data: menge1 like mseg-menge.

DATA : BEGIN OF IT_MSEG_CHILD OCCURS 0,

MBLNR LIKE MSEG-MBLNR,

MJAHR LIKE MSEG-MJAHR,

EBELN LIKE MSEG-EBELN,

WERKS LIKE MSEG-WERKS,

MATNR1 LIKE MSEG-MATNR, " HEADER PARTNO

MATNR LIKE MSEG-MATNR,

MAKTX LIKE MAKT-MAKTX,

BWTAR LIKE MSEG-BWTAR,

MEINS LIKE MSEG-MEINS,

STORAGE LIKE ZMMSTORAGEBIN-STORAGE,

HQTY LIKE MSEG-MENGE, " HEADER QTY

MENGE LIKE MSEG-MENGE, " CHILD QTY

SUMQTY LIKE MSEG-MENGE, "SUM OF CHILD QTY FOR SAME PARTS

QTPKIT LIKE MSEG-MENGE, " QTY PER KIT

PQTY LIKE MSEG-MENGE, " PRINT QTY

PQTY1 LIKE MSEG-MENGE, " PRINT QTY 1

QUO TYPE I,

REM LIKE MSEG-MENGE ,

MENGE2(19),

MENGE3(16),

MENGE4(19),

MENGE5(16),

END OF IT_MSEG_CHILD.

DATA: TEMPQUO LIKE MSEG-MENGE,TEMPREM LIKE MSEG-MENGE,

TEMPHQTY LIKE MSEG-MENGE,TEMPSUMQTY LIKE MSEG-MENGE,

CMPVAL LIKE MSEG-MENGE.

data: v_bktxt type mkpf-bktxt.

data: sum like mseg-menge.

data : prod(13).

data : n1(2) type n.

data : n2(2) type n.

data : n3(2) type n.

data : n4(2) type n.

data : c1(2) type n value 1.

data : dsn(150).

data : dsn1(100).

data : number(3).

data : file(50) value 'E:\userdata\Barcode_kittags\kit00' .

Data : file1(50) value 'E:\userdata\Barcode_kittags\kit00' .

  • Data for server details

data : host1 like syst-host.

data : sysid like syst-sysid.

RANGES : r_werks FOR mseg-werks.

*AT SELECTION SCREEN.*

at selection-screen.

r_werks-sign = 'I'.

r_werks-option = 'EQ'.

r_werks-low = 'WK01'.

APPEND r_werks.

r_werks-low = 'CQ01'.

APPEND r_werks.

if p_werks not in r_werks.

message 'Plant should be either plant1 or plant2' TYPE 'E'.

endif.

select single werks into t001w-werks from t001w

where werks eq p_werks.

if sy-subrc <> 0.

message e000(z_apd) with 'Invalid Plant...Please Check'.

endif.

select single mblnr into mseg-mblnr from mseg

where mblnr eq s_mblnr.

if sy-subrc <> 0.

message e000(z_apd) with 'Invalid Material Doc...Please Check'.

endif.

start-of-selection.

perform get_data.

if p_child eq 'X'.

if it_mseg_child is initial.

  • No Details Available

message i017(z_apd) with text-002.

exit.

else.

host1 = syst-host.

sysid = syst-sysid.

n1 = 1.

**Sorting according parent material and child parts

sort it_mseg_child by matnr1 matnr.

  • loop at it_mseg_child.

if p_werks = 'WK01'.

concatenate file n1 '.PJ' into dsn.

ENDIF.

if p_werks = 'CQ01'.

concatenate file1 n1 '.PJ' into dsn.

ENDIF.

perform write_data.

clear dsn.

n1 = n1 + 1.

  • endloop.

message i017(z_apd) with TExt-003."'File Has Been Created'.

clear: it_mseg_child, it_mseg_child.

refresh : it_mseg_child, it_mseg_child.

endif.

else.

if it_mseg_header is initial.

  • No Details Available

message i017(z_apd) with text-002.

exit.

else.

host1 = syst-host.

sysid = syst-sysid.

n1 = 1.

**Sorting according parent material and child parts

sort it_mseg_header by matnr.

  • loop at it_mseg_header .

if p_werks = 'WK01'.

concatenate file n1 '.PJ' into dsn.

ENDIF.

if p_werks = 'CQ01'.

concatenate file1 n1 '.PJ' into dsn.

ENDIF.

n2 = it_mseg_header-menge.

perform write_data1.

clear dsn.

n1 = n1 + 1.

  • endloop.

message i017(z_apd) with TExt-003."'File Has Been Created'.

clear: it_mseg_header, it_mseg_header.

refresh : it_mseg_header, it_mseg_header.

endif.

endif.

end-of-selection.

&----


*& Form get_data

&----


  • text

----


FORM get_data .

AUTHORITY-CHECK OBJECT 'ZPLANT'

ID 'WERKS' FIELD P_WERKS.

IF SY-SUBRC NE 0.

message E006(zmess) with text-009 p_werks.

endif.

select a~mblnr

a~mjahr

a~ebeln

a~matnr

a~menge

a~bwtar

a~meins

a~werks

from mseg as a

inner join mkpf as b

on amblnr = bmblnr and

amjahr = bmjahr

into corresponding fields of table it_mseg_header

where

a~WERKS = p_werks

and b~mblnr = s_mblnr

and a~matnr in s_matnr

and a~BWART = '101'.

loop at it_mseg_header.

select single maktx from makt into

(it_mseg_header-maktx)

where matnr = it_mseg_header-matnr.

select single storage into (it_mseg_header-storage)

from ZMMSTORAGEBIN

where WERKS = it_mseg_header-WERKS

and MATNR = it_mseg_header-MATNR and

BWTAR = it_mseg_header-BWTAR.

move '1.000' to it_mseg_header-menge1.

CONCATENATE it_mseg_header-MENGE1 it_mseg_header-meins INTO

it_mseg_header-menge1 .

modify it_mseg_header transporting maktx menge1.

SELECT DISTINCT AMBLNR aMJAHR aWERKS aMEINS aEBELN aMATNR a~BWTAR

a~MENGE

INTO CORRESPONDING FIELDS OF TABLE IT_MSEG_CHILD

FROM MSEG AS A INNER JOIN MKPF AS B

ON AMBLNR = BMBLNR AND

AMJAHR = BMJAHR

WHERE A~MBLNR = IT_MSEG_HEADER-MBLNR

AND A~MJAHR = IT_MSEG_HEADER-MJAHR

AND A~BWART = '543'

AND A~WERKS = IT_MSEG_HEADER-WERKS

AND A~EBELN = IT_MSEG_HEADER-EBELN.

*AND A~BWART = '541'.

endloop.

loop at it_mseg_child.

SELECT SINGLE SUM( MENGE )

INTO (TEMPSUMQTY)

FROM MSEG

WHERE MBLNR = IT_MSEG_CHILD-MBLNR

AND MJAHR = IT_MSEG_CHILD-MJAHR

AND WERKS = IT_MSEG_CHILD-WERKS

AND EBELN = IT_MSEG_CHILD-EBELN

AND MATNR = IT_MSEG_CHILD-MATNR

AND BWART = '543'.

select single maktx

into it_mseg_child-maktx

from makt

where matnr = it_mseg_child-matnr.

select single matnr MENGE

into (it_mseg_child-matnr1,TEMPHQTY)

from mseg

where mblnr = it_mseg_child-mblnr

and mjahr = it_mseg_child-mjahr

and werks = it_mseg_child-werks

and ebeln = it_mseg_child-ebeln

and bwart = '101'.

select single storage

into (it_mseg_child-storage)

from ZMMSTORAGEBIN

where WERKS = it_mseg_child-WERKS

and MATNR = it_mseg_child-MATNR and

BWTAR = it_mseg_child-BWTAR.

IT_MSEG_CHILD-QTPKIT = TEMPSUMQTY / TEMPHQTY.

IT_MSEG_CHILD-SUMQTY = TEMPSUMQTY.

IT_MSEG_CHILD-HQTY = TEMPHQTY.

modify it_mseg_child.

endloop.

DELETE ADJACENT DUPLICATES FROM it_mseg_child.

LOOP AT IT_MSEG_CHILD.

IT_MSEG_CHILD-QUO = IT_MSEG_CHILD-MENGE DIV IT_MSEG_CHILD-QTPKIT.

IT_MSEG_CHILD-REM = IT_MSEG_CHILD-MENGE MOD IT_MSEG_CHILD-QTPKIT.

it_mseg_child-MENGE3 = it_mseg_child-QTPKIT.

condense it_mseg_child-MENGE3.

CONCATENATE it_mseg_child-MENGE3 it_mseg_child-MEins INTO

it_mseg_child-MENGE2 .

condense it_mseg_child-MENGE2 .

it_mseg_child-MENGE4 = IT_MSEG_CHILD-REM.

condense it_mseg_child-MENGE4.

CONCATENATE it_mseg_child-MENGE4 it_mseg_child-MEins INTO

it_mseg_child-MENGE5 .

condense it_mseg_child-MENGE5 .

MODIFY IT_MSEG_CHILD.

ENDLOOP.

ENDFORM. " get_data

&----


*& Form write_data

&----


  • text

----


FORM write_data .

open dataset dsn for output in text mode encoding default.

if sy-subrc <> 0.

exit.

endif.

  • transfer 'KTN.LBL' to dsn.

SORT IT_MSEG_CHILD BY EBELN STORAGE.

LOOP AT IT_MSEG_CHILD.

IF IT_MSEG_CHILD-QUO > 0."uncommented

  • IF IT_MSEG_CHILD-REM = 0."commented

n3 = IT_MSEG_CHILD-QUO.

do n3 times.

transfer 'KTN.LBL' to dsn.

MOVE 1 TO NUMBER.

  • MOVE IT_MSEG_CHILD-QUO TO NUMBER."commented

  • MOVE IT_MSEG_CHILD-QTPKIT TO NUMBER."commented

condense number.

transfer number to dsn.

transfer : it_mseg_child-EBELN to dsn,

it_mseg_child-matnr1 to dsn,

it_mseg_child-matnr to dsn,

it_mseg_child-maktx to dsn,

it_mseg_child-MENGE2 to dsn,

it_mseg_child-bwtar to dsn.

transfer it_mseg_child-storage to dsn.

transfer space to dsn.

c1 = c1 + 1.

if c1 = 8.

clear c1.

close dataset dsn.

clear dsn.

n1 = n1 + 1.

if p_werks = 'WK01'.

concatenate file n1 '.PJ' into dsn.

ENDIF.

if p_werks = 'CQ01'.

concatenate file1 n1 '.PJ' into dsn.

ENDIF.

open dataset dsn for output in text mode encoding default.

if sy-subrc <> 0.

exit.

endif.

endif.

enddo.

ENDIF.

IF IT_MSEG_CHILD-REM > 0.

  • n4 = IT_MSEG_CHILD-REM.

do 1 times.

transfer 'KTN.LBL' to dsn.

MOVE 1 TO NUMBER."uncommented

  • MOVE IT_MSEG_CHILD-REM TO NUMBER."commented

condense number.

transfer number to dsn.

transfer : it_mseg_child-EBELN to dsn,

it_mseg_child-matnr1 to dsn,

it_mseg_child-matnr to dsn,

it_mseg_child-maktx to dsn,

it_mseg_child-MENGE5 to dsn,

it_mseg_child-bwtar to dsn.

transfer it_mseg_child-storage to dsn.

transfer space to dsn.

c1 = c1 + 1.

if c1 = 8.

clear c1.

close dataset dsn.

clear dsn.

n1 = n1 + 1.

if p_werks = 'WK01'.

concatenate file n1 '.PJ' into dsn.

ENDIF.

if p_werks = 'CQ01'.

concatenate file1 n1 '.PJ' into dsn.

ENDIF.

open dataset dsn for output in text mode encoding default.

if sy-subrc <> 0.

exit.

endif.

endif.

enddo.

ENDIF.

ENDLOOP.

close dataset dsn.

ENDFORM. " write_data

&----


*& Form write_data1

&----


  • text

----


FORM write_data1 .

open dataset dsn for output in text mode encoding default.

if sy-subrc <> 0.

exit.

endif.

SORT IT_MSEG_HEADER BY EBELN .

  • LOOP AT IT_MSEG_HEADER.

do n2 times.

transfer 'KTN.LBL' to dsn.

MOVE 1 TO NUMBER.

condense number.

transfer number to dsn.

transfer : it_mseg_header-EBELN to dsn,

it_mseg_header-matnr to dsn,

it_mseg_header-matnr to dsn,

it_mseg_header-maktx to dsn,

it_mseg_header-MENGE1 to dsn,

it_mseg_header-bwtar to dsn,

it_mseg_header-storage to dsn.

transfer space to dsn.

c1 = c1 + 1.

if c1 = 8.

clear c1.

close dataset dsn.

clear dsn.

n1 = n1 + 1.

if p_werks = 'WK01'.

concatenate file n1 '.PJ' into dsn.

ENDIF.

if p_werks = 'CQ01'.

concatenate file1 n1 '.PJ' into dsn.

ENDIF.

open dataset dsn for output in text mode encoding default.

if sy-subrc <> 0.

exit.

endif.

endif.

*ENDLOOP.

enddo.

close dataset dsn.

ENDFORM. " write_data1

hope this shelps u

regards,

Arun prasad

former_member204513
Active Contributor
0 Kudos

Hi Mike,

One option

You better to take help of ABAPer, explain the requirement what you want they can try whether it will be possible through adding the coading in the existing ouput program or Smart form program.

Second option Try with this

You define new output type for the packing list ,put that output type in your delivery output procedure.

Assign output program and script or smart form program to the output type.

Define table with the Customer is one of the field

Maintain the access sequence

Maintain the condition record for that output type with the key combination Customer in VV21 transaction.

I hope it will help you,

Regards,

Murali.