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: 

BAPI 'BAPI_OUTB_DELIVERY_CONFIRM_DEC' doesnt check quantity limit

former_member196098
Participant
0 Kudos

Hello gurus

I am using the BAPI  'BAPI_OUTB_DELIVERY_CONFIRM_DEC' to update the quantity like in VL02N.

And users can update the quantity to any value with the BAPI

whereas in VL02N it doesnt allow and gives an error message stating the total quantity has exceded!!

BAPI fails to go into this validation.

I debugged the code and noticed that

BAPı goes into the user exit  but because of the flag

CHECK V50AGL-CONFIRM_CENTRAL IS INITIAL.

Here is the code!!

Why this flag is set to X and how do i fix this

*&---------------------------------------------------------------------*

*& Report  ZSELTST72

*&---------------------------------------------------------------------*

REPORT ZSELTST72.

PARAMETERS P_VBELN LIKE LIKP-VBELN.

DATA LS_HEADER_DATA    LIKE BAPIOBDLVHDRCON.

DATA LS_HEADER_KONTROL LIKE BAPIOBDLVHDRCTRLCON.

DATA LV_DELIVERY       LIKE BAPIOBDLVHDRCON-DELIV_NUMB.

DATA LT_ITEM_DATA      LIKE TABLE OF BAPIOBDLVITEMCON WITH HEADER LINE.

DATA LT_ITEM_CONTROL   LIKE TABLE OF BAPIOBDLVITEMCTRLCON

        WITH HEADER LINE.

DATA LT_RETURN         LIKE TABLE OF BAPIRET2.

DATA LT_LIPS           TYPE TABLE OF LIPS WITH HEADER LINE .

SELECT * FROM LIPS

   INTO TABLE LT_LIPS

   WHERE VBELN = P_VBELN.

LV_DELIVERY                   = P_VBELN.

LS_HEADER_DATA-DELIV_NUMB     = P_VBELN.

LS_HEADER_KONTROL-DELIV_NUMB  = P_VBELN.

*ls_header_kontrol-post_gi_flg = 'X'.

LOOP AT LT_LIPS.

LT_ITEM_DATA-DELIV_NUMB          = LV_DELIVERY.

LT_ITEM_DATA-DELIV_ITEM          = LT_LIPS-POSNR.

LT_ITEM_DATA-MATERIAL            = LT_LIPS-MATNR.

LT_ITEM_DATA-DLV_QTY             = LT_LIPS-LFIMG.

LT_ITEM_DATA-DLV_QTY_IMUNIT      = LT_LIPS-LFIMG.

LT_ITEM_DATA-FACT_UNIT_NOM       = 1.

LT_ITEM_DATA-FACT_UNIT_DENOM     = 1.

APPEND LT_ITEM_DATA.

LT_ITEM_CONTROL-DELIV_NUMB        = LV_DELIVERY.

LT_ITEM_CONTROL-DELIV_ITEM        = LT_LIPS-POSNR.

LT_ITEM_CONTROL-CHG_DELQTY        = 'X'.

APPEND LT_ITEM_CONTROL.

ENDLOOP.

CALL FUNCTION 'BAPI_OUTB_DELIVERY_CONFIRM_DEC'

   EXPORTING

     HEADER_DATA                      = LS_HEADER_DATA

     HEADER_CONTROL                   = LS_HEADER_KONTROL

     DELIVERY                         = LV_DELIVERY

   TABLES

    ITEM_DATA                        = LT_ITEM_DATA[]

    ITEM_CONTROL                     = LT_ITEM_CONTROL[]

    RETURN                           = LT_RETURN

           .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

  EXPORTING

    WAIT          = 'X'

* IMPORTING

*   RETURN        =

           .

1 ACCEPTED SOLUTION

nabheetscn
Active Contributor
0 Kudos

Hi

This flag is for "Flag: Confirmation of Delivery from Decentralized WMS Active" and the BAPI which you are using is also for decenmtralized system (BAPI for Outbound Delivery Confirmation from a Decentralized System) . that is why it is set to X at line 388 in it. I would suggest you to search for another BAPI/FM for the same. You will find many for example WS_DELIVERY_UPDATE_2

 

GS_DLV_BAPI_CONTROL-CONFIRM_CENTRAL = 'X'

Nabheet

.

6 REPLIES 6

nabheetscn
Active Contributor
0 Kudos

Hi

This flag is for "Flag: Confirmation of Delivery from Decentralized WMS Active" and the BAPI which you are using is also for decenmtralized system (BAPI for Outbound Delivery Confirmation from a Decentralized System) . that is why it is set to X at line 388 in it. I would suggest you to search for another BAPI/FM for the same. You will find many for example WS_DELIVERY_UPDATE_2

 

GS_DLV_BAPI_CONTROL-CONFIRM_CENTRAL = 'X'

Nabheet

.

0 Kudos

Nabheet

Thanks alot for your answer

It makes sense alot

Yes i read the documentation

same as you say

So we can use WS_DELIVERY_UPDATE_2 for the same purpose

do we still need to set the flag  confirm_central?

Thanks again

0 Kudos

I dont think so...:)Please try

0 Kudos

Thanks for your help

I will try for sure

Its good to know

as i noticed we used this BAPI in several programs

have a nice day

former_member15255
Active Participant
0 Kudos

Hello,

Please make use of these function module : WS_DELIVERY_UPDATE. This should help in solving your issue

Regards

Suresh nair

0 Kudos

Yes you can use any:)thanks suresh:)