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: 

BADI: SD_COND_SAVE_A

Former Member

Hi Experts - We are using the BADI SD_COND_SAVE_A to validate condition records being entered in MEK1. Whenever we issue a message the validation works fine. But upon hittng Enter the program just abruptly terminates with message "<b>$$00000001 in function group</b>". Upon investigation we found that this is due to a Number range issue.

During our trace in debug mode, we noticed that a change document was generated (in subroutine ‘NUMBERN_VERGABE’) and added to internal table NUMBER_CHANGE during the initial save of the pricing condition, but due to the failure of the validation check placed in BADI implementation ‘SD_COND_SAVE_A’, the actual save did not take place. Then, when user pressed enter key or back key, the PAI event of the transaction VK11 was triggered and the routine NUMMERN_VERGABE’ was called again to generate a new change document. This time, in the routine ‘NUMMERN_VERGABE’, the statement READ TABLE NUMBER_CHANGE WITH KEY NUMBER_CHANGE-OLD NUMBER BINARY SERACH this time has return code ‘0’ because the internal table NUMBER_CHANGE still keeps the record previously stored during the initial save. As a result, the transaction terminated and all data was lost.

The table is <b>NUMBER_CHANGE</b> in program SAPMV13A.

I am able to see and delete these values from the shared memory in debugging if I use the prefix SAPMV13A in the debugger from the BADI.

<b>

(SAPMV13A)NUMBER_CHANGE</b> if I use this in the debugger I am able to delete the entries in the table. <b>Is it possible to do this programatically?</b>

Thanks.

Sam.

3 REPLIES 3

Former Member
0 Kudos

Hi sam,

Now i have faced the same error in FV11. Could you please tell me how did you resolve the error in your case.

waiting for your reply.

Regards

Sathish

Former Member
0 Kudos

NOT ANSWERED

Code to delete table (SAPMV13A)NUMBER_CHANGE entries programatically.


FIELD-SYMBOLS: <fs_number> TYPE any table.
  DATA: lw_var(40) TYPE c.

  lw_var = '(SAPMV13A)NUMBER_CHANGE[]'.
  ASSIGN (lw_var) TO <fs_number>.
  IF sy-subrc = 0 AND <fs_number> IS ASSIGNED.
   clear <fs_number>[].  
 endif.