Application Development and Automation 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: 
Read only

Delivery Picking and Printing

Former Member
0 Likes
1,646

I've been assigned a project in which once an order goes through a certain criteria, I need to loop through all of it's deliveries and do the following:

1. Pick all the items on the delivery

2. Print the Picking List Ticket to a specified printer

Can anyone give me any ideas on where I should start looking?

Thanks,

Curtis

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,344

1/Create smartform for picklist

ZM_PICK_LIST

2/Create printing program


***********DATA DECLARATION
tables: vbak.
DATA:
gv_func   type RS38L_FNAM,
gt_vbfa type table of vbfa,
gs_vbfa type             vbfa.
************SELECT REQUIRED ORDER
select-options: svbeln for vbak-vbeln.
***********FIND DELIVERYIES FOR ORDES
select * from vbfa into gt_vbfa 
                              where vbelv in svblen
                               and    vbtyp_n = 'J'
                               and     vbtyp_c = 'O'

*Find function for smartform
  call function 'SSF_FUNCTION_MODULE_NAME'
       exporting  formname           = 'ZMM_PICKLIST'
       importing  fm_name            = gv_func
       exceptions no_form            = 1
                  no_function_module = 2
                  others             = 3.

*Print Smartfomr picklist for  delivery
      data: gt_text      type ZLINET,
            ls_CTRL_PRNT type SSFCTRLOP.
ls_CTRL_PRNT-no_dialog = 'X'.        "Suppres dialog
ls_CTRL_PRNT-DEVICE = 'LOCAL'.   "!!!!!!specify required printer
loop at svbeln.
loop at gt_vbfa into gs_vbfa where vbelv = svbeln-low.
  CALL FUNCTION gv_func
    EXPORTING
CONTROL_PARAMETERS        = LS_CTRL_PRNT
      ZVBFA           = gs_vbfa
    EXCEPTIONS
      FORMATTING_ERROR = 1
      INTERNAL_ERROR   = 2
      SEND_ERROR       = 3
      USER_CANCELED    = 4.
endloop.
endloop.

Edited by: Jan Hoblik on Jan 5, 2011 3:53 PM

I've been assigned a project in which once an order goes through a certain criteria, I need to loop through all of it's deliveries and do the following:

1. Pick all the items on the delivery

2. Print the Picking List Ticket to a specified printer

Can anyone give me any ideas on where I should start looking?

Thanks,

Curtis

3 REPLIES 3
Read only

brad_bohn
Active Contributor
0 Likes
1,344

In that scenario, you can use WS_DELIVERY_UPDATE or SD_DELIVERY_UPDATE_PICKING to pick the delivery. You can use a requirement on the delivery output to hold the pick ticket print until the delivery is fully picked (though that seems a bit backward unless it's a non-warehouse managed, externally picked location). See KOMKBV2 for the correct picking status field for output processing.

Read only

Former Member
0 Likes
1,345

1/Create smartform for picklist

ZM_PICK_LIST

2/Create printing program


***********DATA DECLARATION
tables: vbak.
DATA:
gv_func   type RS38L_FNAM,
gt_vbfa type table of vbfa,
gs_vbfa type             vbfa.
************SELECT REQUIRED ORDER
select-options: svbeln for vbak-vbeln.
***********FIND DELIVERYIES FOR ORDES
select * from vbfa into gt_vbfa 
                              where vbelv in svblen
                               and    vbtyp_n = 'J'
                               and     vbtyp_c = 'O'

*Find function for smartform
  call function 'SSF_FUNCTION_MODULE_NAME'
       exporting  formname           = 'ZMM_PICKLIST'
       importing  fm_name            = gv_func
       exceptions no_form            = 1
                  no_function_module = 2
                  others             = 3.

*Print Smartfomr picklist for  delivery
      data: gt_text      type ZLINET,
            ls_CTRL_PRNT type SSFCTRLOP.
ls_CTRL_PRNT-no_dialog = 'X'.        "Suppres dialog
ls_CTRL_PRNT-DEVICE = 'LOCAL'.   "!!!!!!specify required printer
loop at svbeln.
loop at gt_vbfa into gs_vbfa where vbelv = svbeln-low.
  CALL FUNCTION gv_func
    EXPORTING
CONTROL_PARAMETERS        = LS_CTRL_PRNT
      ZVBFA           = gs_vbfa
    EXCEPTIONS
      FORMATTING_ERROR = 1
      INTERNAL_ERROR   = 2
      SEND_ERROR       = 3
      USER_CANCELED    = 4.
endloop.
endloop.

Edited by: Jan Hoblik on Jan 5, 2011 3:53 PM

Read only

Former Member
0 Likes
1,344

Hi Curtis,

My advice to you would be to schedule a program as a periodic background job (SM37).

In the program, you can check the conditions for the sales order in table VBAK, VBAP, Delivery in tables : LIKP, LIPS.

Based on that you can print the pricking list either through an ABAP program or smart form (Smart Forms are a better choice).

[Visit this Link for all tables related to SD.|http://www.erpgenie.com/sap/abap/tables_sd.htm]

Regards,

Jovito.