‎2007 Mar 24 8:38 AM
Hi,
I am using bapi_incominginvoice_save to create a logistical invoice (similar to transaction MIRA). In my program, after BAPI execution I check the contents of the 'RETURN' parameter for any problems that may have occurred. However, I have found that certain 'E' messages do not get passed to the BAPI's 'RETURN' parameter but instead result in the end the program. As a result the subsequent statements in the calling program are not executed. Is there some configuration that needs to be setup to ensure all messages are passed to the RETURN parameter rather than executed at runtime?
An example of one such message is: purchase order incomplete.
Any help or suggestions are very much appreciated.
Thanks,
Vicki
‎2007 Mar 24 9:21 AM
If these abort come from standard SAP code, look for a note or send an OSS message.
IF they come from client developpement, BADI for example, maybe theses need some corrections.
Take a look at OSS <a href="https://service.sap.com/sap/support/notes/771655">Note 771655 - BAPI invoice verification: no posting</a>
Regards
‎2007 Mar 24 9:21 AM
If these abort come from standard SAP code, look for a note or send an OSS message.
IF they come from client developpement, BADI for example, maybe theses need some corrections.
Take a look at OSS <a href="https://service.sap.com/sap/support/notes/771655">Note 771655 - BAPI invoice verification: no posting</a>
Regards
‎2007 Mar 25 9:26 AM
Thanks Raymond. I think you are right to suggest OSS.
I believe what is happening is that the BAPI calls the function module "me_read_header_invoice" which checks the purchase order. One of the checks this function makes is whether the PO is complete (In the procedure bestellkopf_lesen line 94)
IF ekko-memory ne space.
PERFORM ENTSPERREN_EKKO USING H-EBELN.
MESSAGE E045(MEPO) WITH EKKO-EBELN "<<<<<<<<<<<<<<<<<
RAISING PARKED_DOCUMENT.
EXIT.
ENDIF.
However, if you look at the functin call this exception PARKED_DOCUMENT is not checked. (in the include: LMRM_BAPIF0W).
CALL FUNCTION 'ME_READ_HEADER_INVOICE'
EXPORTING
display = 'X'
ebeln = s_selectpo-po_number
re_kursf = i_rbkpv-kursf
re_waers = i_rbkpv-waers
IMPORTING
iekko = s_ekko
EXCEPTIONS
not_found = 1
wrong_type = 2
not_activ = 3
not_released = 4. "<<<<Line 32
To overcome this I suggest the following standard SAP code change is made.
CALL FUNCTION 'ME_READ_HEADER_INVOICE'
EXPORTING
display = 'X'
ebeln = s_selectpo-po_number
re_kursf = i_rbkpv-kursf
re_waers = i_rbkpv-waers
IMPORTING
iekko = s_ekko
EXCEPTIONS
not_found = 1
wrong_type = 2
not_activ = 3
not_released = 4 "<<<<<Line 32 fullstop removed
others = 5. "<<<<<Line inserted
Does this sound like I am on the right track?