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: 

ASSERTION_FAILED dump error when using SD_VBUP_READ_FROM_DOC_MULTI

walkerist
Participant
0 Kudos
535

I am experiencing ASSERTION_FAILED dump error when running my code.

Here's my code:


   DATA: lt_vbuk_key TYPE vbuk_key_tab, 
lt_vbup_key TYPE vbup_key_tab,
lt_vbup TYPE vbup_t.
INSERT VALUE #( VBELN = TVBDPL-VBELN ) INTO TABLE LT_VBUK_KEY.
INSERT VALUE #( VBELN = TVBDPL-VBELN
POSNR = TVBDPL-POSNR) INTO TABLE LT_VBUP_KEY.
CALL FUNCTION 'SD_VBUP_READ_FROM_DOC_MULTI'
EXPORTING
it_vbuk_key = lt_vbuk_key
it_vbup_key = lt_vbup_key
IMPORTING
et_vbup = lt_vbup
EXCEPTIONS
vbeln_not_found = 1
vbtyp_not_supported = 2
vbobj_not_supported = 3
OTHERS = 4.
3 REPLIES 3

VXLozano
Active Contributor
486

There's something wrong in the CALL FUNCTION parameters, I guess... a failed assertion is a termination used (in this case) by SAP to prevent further data movements.

Check the DUMP analysis, program details: you will find a line like

>>> assert 1 = 2.

Read the code BEFORE that point, I guess you will find an IF. That's the wrong data detection.

jens_michaelsen
Participant
486

The FM fills internal table of type VBUP out of table VBUP
-for all items of given SD documents, if it_vbuK_key is provided

-for given items of given SD documents, if it_vbuP_key is provided

But :it's not allowed to provide both tables.

You must decide, if you want to get the status of all items of a document or the status of specific items only.

raymond_giuseppi
Active Contributor
486

Basically

  ASSERT it_vbup_key IS NOT INITIAL AND it_vbuk_key IS INITIAL OR
         it_vbup_key IS INITIAL AND it_vbuk_key IS NOT INITIAL.

So either you pass keys of a list of items or keys of a list of documents, not both. If you pass only keys of documents, it will select every item of those documents.