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: 

need solution for using a FM -PACK_HANDLING_UNIT_DLVRY

Former Member
0 Kudos

Hi,

I have Pick HU's and Pallet HU, i have to nest the pick HU's one-by-one or all at once into a pallet HU using a function module PACK_HANDLING_UNIT_DLVRY.

Can anyone help me out regarding the parameters that need to passed and output of the FM.

Thanx in advance...

3 REPLIES 3

Former Member
0 Kudos

Hi,

you can try in the include :RLMOBI01 ,where you can see the following params are passed to the fm.

*&----


*

*& Form pack_hu_for_outbound_delivery

*&----


FORM PACK_HU_FOR_OUTBOUND_DELIVERY.

HU_HEADER_PROP = HU_HEADER_MAIN.

*... for outbound delivery object should be free..................

HU_REF_DOC-OBJECT = ' '.

CALL FUNCTION 'PACK_HANDLING_UNIT_DLVRY'

EXPORTING

I_HU_ID = HU_ID

I_NEW_HU = NEW_HU

I_UPDATE_DB = UPDATE_DB

I_CREATE_HU = CREATE_HU

I_REFERENCE_OBJECT = HU_REF_DOC

I_MM_DATA = MM_DATA

I_HU_HEADER_MAIN = HU_HEADER_PROP

I_HU_HEADER_CAPACITY = HU_HEADER_CAPACITY[]

I_HU_HEADER_ADDITIONAL = HU_HEADER_ADDITIONAL[]

I_HU_HEADER_TRANSPORT = HU_HEADER_TRANSPORT[]

I_HU_ITEMS = HU_ITEMS_PROPOSAL[]

I_HU_SERIAL_NR = HU_SERIAL_NR_LIST[]

I_SAVE_STEP = SAVE_STEP

I_PACK_ACTIVITY = PACK_TYPE

I_HU_EXTERNAL = UNPACK_HU_EXT[]

I_HU_INTERNAL = UNPACK_HU_INT[]

I_DELIVERY_TYPE = INT_DLVRY_TYPE

IMPORTING

O_HU_REF_ID = HU_REF_ID

O_HU_HEADER = HU_WORK_HEADER[]

O_HU_ITEMS = HU_WORK_ITEMS[]

O_HU_MESSAGES = HU_MESSAGES[]

EXCEPTIONS

INPUT_MISSING = 01

NOT_POSSIBLE = 02

FATAL_ERROR = 03

OPERATION_FAILED = 04

DELIVERY_UPDATE_ERROR = 05

ERROR_MESSAGE = 99.

CASE SY-SUBRC.

WHEN 00.

IF SAVE_STEP = SAVE_ITEMS.

COMMIT WORK.

IF SY-TCODE = CON_LM24 OR SY-TCODE = CON_LM25

OR SY-TCODE = CON_LM19 OR SY-TCODE = CON_LM22.

OUT_LM25 = 'X'.

GOOD_DST_SAVE = '1'.

EXIT.

ELSE.

LEAVE TO TRANSACTION SY-TCODE.

ENDIF.

ENDIF.

WHEN 01.

  • Missing inputs for creating / adding of Handling Unit

MESSAGE_NUMBER = '776'.

CLEAR: MESSAGE_VAR1, MESSAGE_VAR2, MESSAGE_VAR3, MESSAGE_VAR4.

PERFORM ERROR_MESSAGE.

ERROR_CODE = 9.

EXIT.

WHEN 02.

  • Operation not possible

MESSAGE_NUMBER = '706'.

CLEAR: MESSAGE_VAR1, MESSAGE_VAR2, MESSAGE_VAR3, MESSAGE_VAR4.

PERFORM ERROR_MESSAGE.

ERROR_CODE = 9.

EXIT.

WHEN 03.

  • System fatal error

MESSAGE_NUMBER = '707'.

CLEAR: MESSAGE_VAR1, MESSAGE_VAR2, MESSAGE_VAR3, MESSAGE_VAR4.

PERFORM ERROR_MESSAGE.

ERROR_CODE = 9.

EXIT.

WHEN 04 OR 05.

  • Packing of Handling Unit failed

MESSAGE_NUMBER = '708'.

CLEAR: MESSAGE_VAR1, MESSAGE_VAR2, MESSAGE_VAR3, MESSAGE_VAR4.

PERFORM ERROR_MESSAGE.

ERROR_CODE = 9.

EXIT.

WHEN 99.

  • An internal error has occurred

MESSAGE_ID = SY-MSGID.

MESSAGE_NUMBER = SY-MSGNO.

MESSAGE_VAR1 = SY-MSGV1.

MESSAGE_VAR2 = SY-MSGV2.

MESSAGE_VAR3 = SY-MSGV3.

MESSAGE_VAR4 = SY-MSGV4.

PERFORM ERROR_MESSAGE.

ERROR_CODE = 9.

EXIT.

ENDCASE.

ENDFORM. " pack_hu_for_outbound_delivery

Regds

Sivaparvathi

Please reward points if helpful...

0 Kudos

Hi,

I have already gone through that, but i need some specific input parameters with which the FM will work.

Thank you

Sumanth

Former Member

Hi,

I have got the solution and posting the answer as this may be useful to others.

Please refer the following code:

FORM pallet_pick_nest USING p_vbeln TYPE vbeln_vl

p_pallet_exidv TYPE exidv

p_pallet_venum TYPE venum

p_parcel_exidv TYPE exidv

p_parcel_venum TYPE venum.

DATA: ls_s_pithu TYPE vsep_s_pithu.

DATA: lt_exidv TYPE hum_exidv_t,

lt_header TYPE hum_hu_header_t.

DATA: lv_error TYPE c.

DATA: lv_vbkok_wa TYPE vbkok.

  • 1. Initialize internal tables of function group

CALL FUNCTION 'HU_PACKING_REFRESH'.

  • 2. Initialize Delivery Data

CALL FUNCTION 'HU_READ_DELIVERY_AND_INIT'

EXPORTING

if_delivery = p_vbeln.

IF sy-subrc EQ 0.

  • 3.Lock the delivery

CALL FUNCTION 'ENQUEUE_EVVBLKE'

EXPORTING

vbeln = p_vbeln

EXCEPTIONS

foreign_lock = 2

system_failure = 3.

IF sy-subrc NE 0.

IF sy-msgno EQ 1 OR sy-msgno GT 3.

gv_msgnr = gc_160.

CALL SCREEN 9050.

EXIT.

ELSE.

PERFORM f_retreive_msgno.

EXIT.

ENDIF.

ELSE.

  • 4. Get HU data for global memory

REFRESH lt_exidv.

APPEND p_pallet_exidv TO lt_exidv.

APPEND p_parcel_exidv TO lt_exidv.

CALL FUNCTION 'HU_GET_HUS'

EXPORTING

it_hus = lt_exidv

IMPORTING

et_header = lt_header

EXCEPTIONS

no_hu_found = 1

OTHERS = 3.

IF sy-subrc NE 0.

PERFORM f_retreive_msgno.

EXIT.

ELSE.

  • 5. Perform Packing

ls_s_pithu-exidv = p_pallet_exidv.

ls_s_pithu-venum = p_pallet_venum.

ls_s_pithu-velin = 3.

ls_s_pithu-sub_hu_venum = p_parcel_venum.

ls_s_pithu-sub_hu_exidv = p_parcel_exidv.

ls_s_pithu-quantity = 1.

ls_s_pithu-veanz = 1.

CALL FUNCTION 'HU_PACKING_AND_UNPACKING'

EXPORTING

is_packing_request = ls_s_pithu

IMPORTING

es_p_request = ls_s_pithu

EXCEPTIONS

missing_data = 1

hu_not_changeable = 2

not_possible = 3

serial_nr = 4

OTHERS = 99.

IF sy-subrc NE 0.

PERFORM f_retreive_msgno.

EXIT.

ELSE.

  • 6. Post HU changes

CALL FUNCTION 'HU_PACKING_UPDATE'

EXPORTING

if_synchron = gc_x.

COMMIT WORK AND WAIT.

  • 7. Release lock .... just to please the other users

CALL FUNCTION 'DEQUEUE_ALL'.

  • 8. Save complete document ... to get all global memory in sync with DB

lv_vbkok_wa-vbeln_vl = p_vbeln.

CALL FUNCTION 'WS_DELIVERY_UPDATE'

EXPORTING

vbkok_wa = lv_vbkok_wa

synchron = gc_x

commit = gc_x

delivery = p_vbeln

if_database_update = gc_1

if_error_messages_send_0 = gc_x

IMPORTING

ef_error_any_0 = lv_error.

ENDIF. "'HU_PACKING_AND_UNPACKING'

ENDIF. "HU_GET_HUS

ENDIF. "Lock delivery successful

ENDIF. "HU_READ_DELIVERY_AND_INIT' ==> 0.

ENDFORM. " pallet_pick_nest