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

Update HUs using WS_DELIVERY_UPDATE_2 ?

Former Member
0 Likes
14,317

Hi all,

I am using WS_DELIVERY_UPDATE_2 to update Delivery.

I am generating HUS using BAPI_HU_CREATE and packing using BAPI_HU_PACK. after these two BAPI i am using

WS_DELIVERY_UPDATE_2 to update delivery. While executing i am getting this error...

There is no handling unit with identification 1000002278 , but HUS are already created using above BAPIs...

Can anybody help in this... how to update HUS using this FM.

Thanks,

Venkat.

Hi all,

I am using WS_DELIVERY_UPDATE_2 to update Delivery.

I am generating HUS using BAPI_HU_CREATE and packing using BAPI_HU_PACK. after these two BAPI i am using

WS_DELIVERY_UPDATE_2 to update delivery. While executing i am getting this error...

There is no handling unit with identification 1000002278 , but HUS are already created using above BAPIs...

Can anybody help in this... how to update HUS using this FM.

Thanks,

Venkat.

12 REPLIES 12
Read only

Former Member
0 Likes
7,508

Hello,

This might be an update issue.

I would suggest to use WAIT statement before calling 'WS_DELIVERY_UPDATE_2' FM.

Thanks.

Read only

0 Likes
7,508

Hi

Thanks for your reply..

This is webdynpro related application, i am using bapi_transaction_commit after every bapi, and even i checked DB tables,

HUs are created at DB level also, then where is the problem.. check code please... this code i tried at se38 giving same error..

can you check with this code once.. in your sys.

DATA: lw_vbkok TYPE vbkok,

lt_vbpok TYPE TABLE OF vbpok,

lw_vbpok TYPE vbpok,

l_vbeln TYPE vbeln_vl.

l_vbeln = '0084000104'.

lw_vbkok-vbeln_vl = l_vbeln.

lw_vbkok-vbeln = l_vbeln.

*vbkok_wa-wabuc = 'X'.

lw_vbpok-vbeln_vl = l_vbeln.

lw_vbpok-posnr_vl = '000010'.

lw_vbpok-vbeln = l_vbeln.

lw_vbpok-posnn = '000010'.

lw_vbpok-pikmg = '1'.

APPEND lw_vbpok TO lt_vbpok.

DATA : VERKO_TAB TYPE TABLE OF VERKO,

WA_VERKO_TAB TYPE VERKO,

VERPO_TAB TYPE TABLE OF VERPO,

WA_VERPO_TAB TYPE VERPO.

WA_VERKO_TAB-VENUM = '0000003373' ."ls_pack_mat-INT_HAND_UNIT.

WA_VERKO_TAB-EXIDA = 'E'.

WA_VERKO_TAB-EXIDV = '00000000001000002279' ."ls_pack_mat-HANDLING_UNIT.

WA_VERKO_TAB-VSTEL = '2000'.

APPEND WA_VERKO_TAB to VERKO_TAB.

*

  • loop at lt_it_lips1 into ls_it_lips1.

WA_VERPO_TAB-VENUM = '0000003373'.

WA_VERPO_TAB-EXIDV_OB = '00000000001000002279' .

WA_VERPO_TAB-EXIDV = '00000000001000002279' .

WA_VERPO_TAB-VELIN = '1'.

WA_VERPO_TAB-VBELN = l_vbeln.

WA_VERPO_TAB-POSNR = '000010'.

CALL FUNCTION 'WS_DELIVERY_UPDATE_2'

EXPORTING

vbkok_wa = lw_vbkok

commit = 'X'

delivery = l_vbeln

update_picking = 'X'

IF_NO_MES_UPD_PACK = 'X'

TABLES

vbpok_tab = lt_vbpok

VERKO_TAB = VERKO_TAB

VERPO_TAB = VERPO_TAB.

Thanks,

Venkat.

Read only

0 Likes
7,508

I think this is not way for picking for WM cases. Try with L_TO_CREATE_DN function module.

Read only

0 Likes
7,508

Hi,

Same code i check through se 38, i am getting this error..

There is already a handling unit 1000002279 posted for GR without stock. now how can i process??

Thanks,

Venkat

Read only

0 Likes
7,508

Hi Venkat,

What exactly you are trying to do?

From what I understand is..

Inbound delivery created an handling unit and you trying to pick this HU for an outbound delivery - so that that HU will get assigned to outbound delivery to do goods issue. Am I right/ If so try to use L_TO_CREATE_DN function module (Like LT03 tcode) - this will help you to pick the inbound HU for outbound delivery. Once done overall picking status will be 'fully picked' and this allows you to do goods issue?

If am wrong - please explain what exactly you want and how it you will do it using transactions - vl02n, lt03 etc..so can be found underlying BAPI's or functions from our friends.

thanks

Read only

0 Likes
7,508

Hi Manohar,

Thanks for your reply..

In general VL02N transaction.. we do by giving pick quantity and and packing that material using packing material and HUs. Like this i developed one application using this( delivery is input ) i am generating HUs and updating pik quantity and HUs (packing material), like vl02n. For this i used bapis BAPI_HU_CREATE for creating HUs and WS_DELIVERY_UPDATE_2 for updating piking qty and HUs and for packing material.

But what i observed here using BAPI_HU_CREATE , it is generating HUS also doing GR with no stock, so i am getting error is another bapi.

Hope you understand..

Thanks,

Venkat.

Read only

0 Likes
7,508

As per my knowledge..

You mean 'picking qty' is enabled/editable field in vl02n transaction? means this is an inventory manged and no HU's are required ( required for WM managed cases). And if required this field will be grayed out and you need pick using LT03 transaction.

BAPI_HU_CREATE will just create HU's and for goods issue you need to pick and existing HU's and i dont think we need to create new HU's..

Or may be am confused with the scenario....

Read only

marcin_cholewczuk
Active Contributor
0 Likes
7,508

Hi,

If I'm not mistaken acording to what SAP says about BAPI, within one LUW you shouldn't create and change the same object. It is because there is this rule that BAPI should use update task as a way of updating data. In effect it work like this in your case:

1. Call BAPI for creation -> BAPI is registring in update task that it will create this object with next COMMIT WORK.

2. Call BAPI for change of created object -> since object was not yet created you're getting an error

3. COMMIT comes and now object is created.

In my opinion you need to run commit in synchronus way (COMMIT WORK AND WAIT) before point 2.

Best regards

Marcin Cholewczuk

Read only

0 Likes
7,508

Hi All,

Thanks for your repies..

I have one doubt now.. WS_DELIVERY_UPDATE_2 bapi creats HUs ??? or only update..

Here i am creating HUS using BAPI_HU_CREATE. Please give me suggestions please..

Thanks,

Venkat.

Read only

aidan_mulcahy
Active Participant
0 Likes
7,508

Hi,

same issue here. Might have got a little further than you so here's what I did and maybe it will help you get both of us all the way:

BAPI_HU_PACK - packs the material into the HU
BAPI_CHANGE_HEADER - assigns the HU to the Delivery
bapi_transation_commit - Saves assignment

This will pack the HU and assign it to the delivery but will not assign the delivery item from the delivery to the HU.

Strange thing is that if I then use VL02n to break the assignment and re-enter the HU manually it will automatically take the delivery item. So...it's almost correct....

Below are random FM's that I have used:

V51P_FILL_GT
V51P_GET_TABLES
SD_DELIVERY_UPDATE_PACKING
WS_DELIVERY_UPDATE
HU_PACKING_AND_UNPACKING
HU_PACKING_REFRESH
HU_PACKING_UPDATE

and generally anything in the Function Group V51P

G'luck.

Read only

karel_havlicek
Explorer
7,508

Hi,

just for the others in the same trap.

There is no need to use BAPI_HU_PACK. Creation of HUs by BAPI_HU_CREATE + WS_DELIVERY_UPDATE_2  is sufficient for packing process. See example coding.

The other way is to use HUs created by FM 'L_TO_PICKHU_ASSIGN' when you provide the packaging material, it creates HUs as well. Later on TO (transfer order)  confirmation FM 'L_TO_CONFIRM', it updates the delivery and it becomes packed.

Read only

larshp
Active Contributor
0 Likes
7,508

In my scenario, the packing material had be set(field VHILM)