2011 Jan 05 8:07 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
2011 Jan 05 11:53 PM
1/Create smartform for picklist
ZM_PICK_LIST2/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
2011 Jan 05 10:41 PM
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.
2011 Jan 05 11:53 PM
1/Create smartform for picklist
ZM_PICK_LIST2/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
2011 Jan 06 3:56 AM
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.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |