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

Activate user exit for BAPI_DOCUMENT_CREATENEWVRS2

Former Member
0 Likes
601

Hi all,

Where I work we are using BAPI_DOCUMENT_CREATENEWVRS2 to create new versions of a document (DMS module). The problem we have is that the BAPI copies all values from the original version. We are looking for a way to leave blank fields RES1, RES2 and RES3 from table DRAW. Debugging the code takes us to a user exit section, but apparently no user exit is active. The code takes you to source code of method IF_EX_DOCUMENT_MAIN01~BEFORE_SAVE, but a validation forces the program to exit the routine. See last statement of the ABAP code below. Does anyone know how to activate the user exit in a method?

Carlos

method IF_EX_DOCUMENT_MAIN01~BEFORE_SAVE.

CLASS CL_EXIT_MASTER DEFINITION LOAD.

DATA: EXIT_OBJ_TAB TYPE SEEX_EXIT_TAB,

EXIT_OBJ TYPE SEEX_EXIT_TAB_STRUCT.

DATA: EXITINTF TYPE REF TO IF_EX_DOCUMENT_MAIN01.

LOOP AT INSTANCE_BADI_TABLE INTO EXIT_OBJ WHERE

INTER_NAME = 'IF_EX_DOCUMENT_MAIN01' AND

FLT_VAL = SPACE.

APPEND EXIT_OBJ TO EXIT_OBJ_TAB.

ENDLOOP.

IF SY-SUBRC = 4.

CALL METHOD CL_EXIT_MASTER=>CREATE_OBJ_BY_INTERFACE_FILTER

EXPORTING

INTER_NAME = 'IF_EX_DOCUMENT_MAIN01'

FLT_VAL = SPACE

IMPORTING

EXIT_OBJ_TAB = EXIT_OBJ_TAB.

APPEND LINES OF EXIT_OBJ_TAB TO INSTANCE_BADI_TABLE.

ENDIF.

LOOP AT EXIT_OBJ_TAB INTO EXIT_OBJ.

CHECK NOT EXIT_OBJ-OBJ IS INITIAL.

2 REPLIES 2
Read only

Former Member
0 Likes
428

hai coherna, u r not using any user exit

instead u r using the DOCUMENT_MAIN01 badi and it is implementated u can change the code also

as it is exiting so u change the code accordign to ur requirement and activate it and it will work fine

m.a

Read only

Former Member
0 Likes
428

hi,

Can you please tell me what are the mandatory parameters for BAPI_DOCUMENT_CREATENEWVRS2 and what values to pass through it?

Shilpa