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: 

MB_DOCUMENT_BADI - MB_DOCUMENT_BEFORE_UPDATE : how to check serial number

Former Member
0 Kudos
658

Hello,

we would like to check serial numbers just before saving our document.

How could we read the serial numbers from memory ?

The GET_SERNOS_OF_DOCUMENT does not return data from memory !

Do you know a function to catch those datas ?

Best regards

6 REPLIES 6

Former Member
0 Kudos
101

Hi ,

Check the link

Former Member
0 Kudos
101

Hi,

refer Program RIOBJK00 to solve ur problem

thanks & regards.

kesavadas_thekkillath
Active Contributor
0 Kudos
101

Have a look at exits

EXIT_SAPLIPW1_008 & EXIT_SAPLIPW1_002

Place IQ* in smod and search for it.

Former Member
0 Kudos
101

Thanks for your answers, but they don't resolve my question.

RIOBJK00 => usefull only to read existing serial numbers

Message ID 8118086#8118086 => not usefull in MD_DOCUMENT_BADI.

User EXIT for serial numbers : sometimes we must check more than 200 serial numbers and for these reason

we would like to check all of them in one step => just before the saving action.

I try to find a function to read the input serial numbers from memory.

0 Kudos
101

Did you check the customer exit EXIT_SAPLIPW1_008 ?

This exit will be called for every serial number entered. You will not obtain the whole serial no's in this function.

Please let us know how you have called GET_SERNOS_OF_DOCUMENT ?

Kesav

Former Member
0 Kudos
101

Hello Kesav,

If we use the customer exit EXIT_SAPLIPW1_008, we have a select in SER05 and OJBK for each serial numbers.

=> 200 serial = 200 select.

The use of the BADI would be a better solution => only one SELECT .... into t_tab and then one READ for each SN.

The use of GET_SERNOS_OF_DOCUMENT :

data : ls_rser TYPE rserob,

lt_sernos TYPE TABLE OF rserob.

move: x_mkpf-mblnr to ls_rser-mblnr,

x_mkpf-mjahr to ls_rser-mjahr,

'SER03' to ls_rser-taser.

CALL FUNCTION 'GET_SERNOS_OF_DOCUMENT'

EXPORTING

KEY_DATA = ls_rser

TABLES

sernos = lt_sernos

EXCEPTIONS

KEY_PARAMETER_ERROR = 1

NO_SUPPORTED_ACCESS = 2

NO_DATA_FOUND = 3.

Result = NO_DATA_FOUND (True, because we have no SN in SER03 for the specified document => not saved).

This function seems not to be the good way to catch our SN from memory !

Joce