Skip to Content
0

VL10 HU Outbound Delivery with batch split problems

Dec 07, 2016 at 03:13 AM

122

avatar image
Former Member

Hello Community,

i'm having issues creating outbound deliveries with VL10.

Due to lack of usability, i am rewriting the V50R_VIEW.

i got an own fcode exit in the FM "SHP_EXTENDED_DUE_LIST", scenario and role for VL10 are adjusted to my case and the shipments and orders are properly filled and displayed.

The deliveries are pre-created based on sales order lines with the wanted amount (VBAK & VBAP)

I already got a listing of due deliveries shown in my ALV-Tree.

What i want to do is:

- Reference HU's with material no. matching to delivery lines (LIPS-MATNR) and assign them via HURES-table as a soft reference to the outbound delivery. The HU's are assigned on VBELN and POSNR base. [done]

- Assign these preassigned HU's to the existing delivery (pack & ship)

- In case of batch split, batch split positions should be created into this existing delivery and the existing positions should be altered to accept batch split

- The "picked quantity" (field LIPS-PIKMG) should be set according to the bookings i do on the delivery

What i am currently using for booking is the function module "VHUDLVHU_DELIVERY_UPDATE", which internally calls "WS_DELIVERY_UPDATE".

My actual attempt of booking does nothing, not sy-subrc, neither exceptions, messages nor BAL MSG Log, but both of all are properly working.

The delivery gets not extended, altered or anything.

The VBPOK_TAB gets filled with 1 position (the existing) stating the LFIMG & LGMNG to set to the amount of chosen HU's and LIANP set to change the amount, the other fields filled are VBELN_VL, POSNR_VL, MATNR, CHARG, WERKS according to what is set in LIPS.

VBPOK_WA is only filled with VBELN_VL = LIKP-VBELN and IT_HANDLING_UNITS is filled with TOP_HU_EXTERNAL, TOP_HU_INTERNAL, VENUM, VEPOS, RFBEL, RFPOS.

My complete call to WS_DELIVERY_UPDATE looks like this

CALL FUNCTION 'WS_DELIVERY_UPDATE'
EXPORTING
vbkok_wa = wa_vbkok
delivery = cs_likp-vbeln
TABLES
vbpok_tab = lt_vbpok
it_handling_units = lt_hus_upd

The non-given fields are falling back to default.

Please give me some light, what am i doing wrong ?

Cheers

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member Dec 17, 2016 at 11:56 PM
0

thanks for the many responses, i sorted it out myself ...

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Even nobody could help you this time, it would be nice if you could share how you solved it, just in case somebody else finds this discussion in future and is then disappointed that the solution was not shared

0
avatar image
Former Member Dec 18, 2016 at 01:01 AM
0

yeah you're right, i was a bit pissy as it was such a painful way to the finish line ^^ ;-)

the magic lies in the way the VBPOK_TAB gets filled.

As the processing is done with one delivery at a time, someone could just simply do this

Creating batch split positions has to be done with pos numbering greater/equal 900000

PAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L0S31 {
font-style: italic;
color: #808080;
}
.L0S32 {
color: #3399FF;
}
.L0S33 {
color: #4DA619;
}
.L0S52 {
color: #0000FF;
}
.L0S55 {
color: #800080;
}
.L0S70 {
color: #808080;
}

* this only works if every booking is going into a new batch split position, might go wrong if someone would update existing batch split positions
LOOP AT lt_vbpok ASSIGNING <fs_vbpok>.
  SELECT MAX( posnr ) FROM lips INTO lv_bs_posnr
    WHERE vbeln EQ <fs_vbpok>-vbeln_vl
      AND posnr EQ <fs_vbpok>-posnr_vl.
  IF sy-subrc NE 0.
    lv_bs_posnr = '900000'.
  ELSEIF lv_bs_posnr LT '900000'.
    lv_bs_posnr = '900000'.
  ENDIF.
  EXIT.
ENDLOOP.
LOOP AT lt_vbpok ASSIGNING <fs_vbpok> WHERE posnr_vl LT '900000'.
* VBELN_VL, POSNR_VL, MATNR, CHARG, WERKS, LIANP have to be filled as well as stated in first post
  lv_bs_posnr = lv_bs_posnr + 1.
  <fs_vbpok>-vbeln                 = <fs_vbpok>-vbeln_vl.
  <fs_vbpok>-posnn                 = lv_bs_posnr.
  <fs_vbpok>-taqui                 = 'X'.
  <fs_vbpok>-orpos                 = <fs_vbpok>-posnr_vl.
  <fs_vbpok>-wms_rfbel             = <fs_vbpok>-vbeln_vl.
  <fs_vbpok>-wms_rfpos             = <fs_vbpok>-posnr_vl.
* <fs_vbpok>-force_orpos_reduction = 'X'.
  <fs_vbpok>-force_orpos_reduction = ''.

  LOOP AT lt_hus_upd ASSIGNING <fs_hus> WHERE rfbel EQ <fs_vbpok>-vbeln_vl
                                          AND rfpos EQ <fs_vbpok>-posnr_vl
                                          AND charg EQ <fs_vbpok>-charg.
    <fs_hus>-rfpos = lv_bs_posnr.
  ENDLOOP.
ENDLOOP.

Somewhere i found that the numbering for batch split is customizable, but even SAP itself hard coded the "greater/equal 900000" in the context of WS_DELIVERY_UPDATE, so there should be no problem hardcoding this myself as it is doing the same "mistake".

Essential is the VBELN/POSNN for creating the new position and the ORPOS reference to the original position that's containing the batch split.

TAQUI and WMS_RFBEL / WMS_RFPOS have to be checked if necessary, i needed them to get it properly working, not even knowing what they are intended to use for.

LIANP is changing the LFIMG upwards (aka overbooking the LIPS entry), with force_orpos_reduction someone could even force downwards correction of LFIMG.

The last part is important as well, the handling units have to be booked on the batch split positions we are just creating, not the original pos

LOOP AT lt_hus_upd ASSIGNING <fs_hus> WHERE rfbel EQ <fs_vbpok>-vbeln_vl
   AND rfpos EQ <fs_vbpok>-posnr_vl
  AND charg EQ <fs_vbpok>-charg.
  <fs_hus>-rfpos = lv_bs_posnr.
  ENDLOOP.

My complete call lastly looks like

SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L0S32 {
color: #3399FF;
}
.L0S33 {
color: #4DA619;
}
.L0S52 {
color: #0000FF;
}
.L0S55 {
color: #800080;
}
.L0S70 {
color: #808080;
}

CALL FUNCTION 'WS_DELIVERY_UPDATE'
        EXPORTING
          vbkok_wa             = wa_vbkok
          synchron             = 'X'
          commit               = 'X'
          delivery             = cs_likp-vbeln
          update_picking       = 'X'
          if_wmpp              = ' '
          if_late_delivery_upd = 'X'
        TABLES
          vbpok_tab            = lt_vbpok
          prot                 = lt_prot
          it_handling_units    = lt_hus_upd
        EXCEPTIONS
          error_message        = 1
          OTHERS               = 2.

Picking update could be done by additionally setting

IF <fs_lips>-kzfme IS INITIAL.
  IF <fs_vbpok>-lgmng GE 0.
    <fs_vbpok>-pikmg = <fs_vbpok>-lgmng.
    <fs_vbpok>-plmin = '+'.
  ELSE.
    <fs_vbpok>-pikmg = <fs_vbpok>-lgmng * -1.
    <fs_vbpok>-plmin = '-'.
  ENDIF.
ELSE.
  IF <fs_vbpok>-lfimg GE 0.
    <fs_vbpok>-pikmg = <fs_vbpok>-lfimg.
    <fs_vbpok>-plmin = '+'.
  ELSE.
    <fs_vbpok>-pikmg = <fs_vbpok>-lfimg * -1.
    <fs_vbpok>-plmin = '-'.
  ENDIF.
ENDIF.
Share
10 |10000 characters needed characters left characters exceeded