Lakshmi Sravanthi
Lakshmi Sravanthi

Reputation: 11

Update BKPF fields while posting a document after validation is successful

I have a requirement to update XBLNR_ALT field using a number range on the header BKPF when posting a document. This update needs to happen only after all validations are successful.

My requirement is to update the field using continuous number range. If this update happens before all validations are successful, a number from a number range gets created but is not used in case validation fails. This causes a gap in the numbers and I'm looking for ways to avoid that.

For example, the number range is from 0010000 to 0020000.

Iteration 1

I'm trying to post a document.

Iteration 2

I correct the validation errors and try to post the document again.

XBLNR_ALT on Doc1 = 0010000
XBLNR_ALT on Doc2 = 0010002

I have tried two ways to update this field:

  1. By creating a substitution exit in GBB1. XBLNR_ALT was populated. However, this caused the number range to be not continuous as the validation exits are called after the substitution is done.

  2. By creating a BTE - 00001120 DOCUMENT POSTING: Field substitution header/items. This BTE FM is also called before the validations.

Upvotes: 0

Views: 1439

Answers (0)

Related Questions