Skip to Content
-5

MIR7 - Posting document Save as Complete Error capture

Oct 17, 2016 at 01:39 PM

556

avatar image
Former Member

Hi All,

Posting a document (MIR7) save as complete, but I am unable to capture the error. Please help.thread used

https://archive.sap.com/discussions/thread/832854

Thanks,

Shweta

10 |10000 characters needed characters left characters exceeded

Please add some screenshot or explain with more details about the problem.

0
Former Member
Osvaldo Lopez

Hi Osvaldo,

Every time I post the document using above code, I get a document number , with the message that Document has been Saved as Complete.

Although, when I check the document it is saved as Park and contains messages. My requirement is that no document number gets generated until the document is error free and gets saved as complete.

Thanks,

Shweta

0
* Please Login or Register to Answer, Follow or Comment.

8 Answers

Best Answer
Pablo Casamayor Oct 18, 2016 at 01:34 PM
1

Hi,

i understand now the point your making. (sorry.. sometimes i' m a wooden head)

before saving as complete you could try to use MRM_INCOMINGINVOICE_PARK in this way:

CALL FUNCTION 'MRM_INVOICE_PARK'
    EXPORTING
      i_rbkpv       = s_rbkpv
      i_xupda       = 'U'
      i_simulation  = 'Y'
      i_rbstat_new  = 'C'
      ti_drseg      = tab_drseg
    TABLES
      te_acchd      = l_t_acchd
      te_accit      = l_t_accit
      te_acccr      = l_t_acccr
      te_accfi      = l_t_accfi
      te_accbset    = l_t_accbset
      te_accit_wt   = l_t_accit_wt
    EXCEPTIONS
      error_message = 01.
* Try to get some sort of messages here
IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
<br>

are you not able to get some information about the messages even by debugging?

in the thread you are referring to i added this comment too:

(before the above code some of this routines where needed too in order to fill all the structures needed) have a look at the following routines in program saplmrm_bapi :

1.- importing_data_check

2.- rbkpv_fill

3.-frseg_fill

4.-co_fill

5.-ma_fill

6.-rbtx_fill

e.g.

PERFORM rbtx_fill(saplmrm_bapi)                  TABLES    taxdata
                                              withtaxdata
                                              vendoritemsplitdata
                                    USING    s_rbkpv-waers
                                    CHANGING  s_rbkpv-rbtx[]
                                              s_rbkpv-h_rbws[]
                                              s_rbkpv-h_rbvs[]
                                              return[]
                                              f_subrc.
CHECK f_subrc = 0.

in this way some errors can be controlled.

Best regards,

Pablo

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Pablo,

Thanks a lot for your prompt replies, I tried all the permutations and combinations but this also doesn't seem to help. Can you please elaborate on sequences of FM & Subroutines to be called. Also, suggest if there is other way to capture messages.

Regards,

Shweta

0
Pablo Casamayor Oct 18, 2016 at 08:28 AM
1

Hi,

i guess you do not have a clear idea o the difference between parking and saving as complete.

In MIR7 transaction you can find this information (help icon):

Parking Invoice Documents

You create an invoice document in document parking. Choose the disk icon Save parked document to do this. Before saving the data, the system performs consistency checks.

Subsequently, you can still change, delete, or post parked documents, or save them as complete.

Use document parking if:

  • Information required for posting the invoice document is missing in the invoice document and you do not want to have to enter again the data already entered
  • The balance is not zero
  • The following updates are to take place:
  • Log of document changes
  • Informative purchase order history
  • Data for advance tax returns
  • Index for checking for duplicate invoices
  • Vendor open items
  • Vendor open items for parked documents
  • Document parking is performed by more than one group of employees



Saving Invoice Documents as Complete

You create an invoice document in document parking. Choose Save as complete to do this. Before saving the data, the system performs consistency checks. In the event of errors, the data is not saved, but is presented for correction instead.

Subsequently, you can still change, delete, or post Documents complete for posting.

Use Save as complete if:

  • No more changes are to be made to the invoice document
  • The balance is zero
  • The invoice document is to be parked for posting but not posted yet
  • The following updates take place at the time of posting:
  • Document changes
  • Purchase order history
  • Data for advance tax returns
  • Index for checking for duplicate invoices
  • Vendor open items
  • Vendor open items in parked documents
  • Purchase order commitments
  • Controlling documents
  • Funds management documents
  • Document parking is controlled using a release procedure

fin order to be able to save as complete you need to park the documents without errors .

And this is the reason of my asking what was the content of i_return in BAPI_INCOMINGINVOICE_PARK.

Best regards,

Pablo

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Pablo,

I understand the difference, but I am not clear of where to get these messages in document in code.

Thanks,

Shweta

0
Pablo Casamayor Oct 20, 2016 at 08:32 PM
1

Hi,

i guess in here

                                              return[]
                                              f_subrc.

internal table return and variable f_subrc

Best regards,

Pablo

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Pablo,

Thank a lot for your response, but this also doesn't seem to help. I also tried debugging the code, but unable to find a structure or internal table where these messages are getting captured.

Thanks,

Shweta

0
Pablo Casamayor Oct 18, 2016 at 06:42 AM
0

Hi,

where are you getting the error messages?

when calling BAPI_INCOMINGINVOICE_PARK?

if so, could you please show the content of i_return?

Best regards,

Pablo

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Pablo,

Thanks for reply,

for BAPI_INCOMINGINVOICE_PARK I am not getting any error messages, I want to capture the messages in MIR7 which I am able to not.

I_RETURN is not helping, because anyhow it is parking the document.

The routines further also give message as, Invoice Document Save as Complete. Only the documents without messages are getting Saved as complete, rest are not. But I am still not able to find a point in Routine where I can check if the document contain messages, before saving it as complete.

Thanks,

Shweta

PF Screenshot for Messages

0
Raymond Giuseppi
Oct 18, 2016 at 08:14 AM
0

Which BAPI(s) did you try, BAPI_INCOMINGINVOICE_SAVE or BAPI_INCOMINGINVOICE_CREATE1, did you look for OSS notes to get last available corrections?

Regards,
Raymond

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

BAPI_INCOMINGINVOICE_PARK

0

Are notes1677685 and 1694854 implemented in your system?

0
avatar image
Former Member Oct 18, 2016 at 11:02 AM
0

Hi,

I understand the difference, but I am not clear of where to get these messages in document in code.

Thanks,

Shweta

Share
10 |10000 characters needed characters left characters exceeded
Pablo Casamayor Oct 24, 2016 at 06:28 AM
0

Hi,

have a look at this thread and see if there is any information about the messages that could be obtained from (SAPLMRMF)TAB_ERRPROT[] or similar:

how to find (SAPLMRMF)TAB_ERRPROT[] in badi

Best regards,

Pablo

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Dear Pablo,

Thanks for your constant assistance, I captured the error by using 'BAPI_TRANSACTION_ROLLBACK' , but currently I am stuck at

PERFORM document_park(saplmr1m)....

this subroutine exits the program at this statement in include 'LMR1MF0D':

IF sy-calld IS INITIAL.
PERFORM variant_transaction USING c_bool_false.
ELSE.
LEAVE PROGRAM.
ENDIF.

If I try to execute any other statement after this Sub routine, it doesn't help. Any other way if we could tackle it?

Thanks,

Shweta

0
Former Member
Former Member

sorry thats BAPI_INCOMINGINVOICE_CREATE , instead of 'BAPI_TRANSACTION_ROLLBACK'

0
Pablo Casamayor Oct 30, 2016 at 03:48 PM
0

Hi,

have a look at this thread:

regarding SY-CALLD system field

Regards,

Pablo

Share
10 |10000 characters needed characters left characters exceeded