‎2010 Jan 05 11:07 AM
Hi,
I am a writing a custom program to park documents through FBV1. Here I using PRELIMINARY_POSTING_FB01. But as it doesn't have a return table of type bapiret, I am not able to catch the messages. Once an error message comes, it is exiting from the program itself. But I need to save the error messages. How will I do this ?
‎2010 Jan 05 12:47 PM
Hi you can catch the exceptions.
after calling the function module just catch the system variables.
data:ls_return type bapiret2.
data:et_return type bapiret2_t.
call function '----'
----
exceptions
----
if sy-subrc ne 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
into ls_return-message.
append ls_return to et_return.
endif.
‎2010 Jan 06 5:23 AM
hi,
i tried that, as the call is not coming to back to the program, it wont work.
‎2011 Dec 09 4:55 AM
Hi,
Please can you let me what FM we have to use in order to get the error/successfull message from FM PRELIMINARY_POSTING_FB01 .
I saw your posting to use data:ls_return type bapiret2.
data:et_return type bapiret2_t.
call function '----'
-
exceptions
-
if sy-subrc ne 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
into ls_return-message.
append ls_return to et_return.
endif.
*But I didn't understand what is call function '----'. Is there any FM name I have to use.* Waiting for your reply.
‎2010 Jan 08 6:43 AM
Hi,
I think that FM PRELIMINARY_POSTING_FB01 is for internal use only and was created just to be called from transaction FB01. I do not thing there is some way how to get error messages and supress terminating a program, because there are error messages without raising any exceptions. I have not found a BAPI for parking documents. The best way to solve your issue is probably creating a batch input. It should be easy. If You want still to use FM PRELIMINARY_POSTING_FB01 , the only idea I have is a little bit complicated. You can call FM in background task, wait until job finishes and than read a job jog to get messages. But I do not think it is a good looking solution, but by this You can achieve that You will be able to get messages of FM without terminating a program. There are some other threads about BAPIs for parking documents:
Regards,
Adrian
‎2010 Jan 12 7:44 AM
Hi,
I solved it by providing like this
call function ' '
-
exceptions
error_message = 1.
Here the control come back to the program and used the system varibale to catch the messages.
‎2010 Jan 12 7:44 AM
‎2011 Dec 09 4:57 AM
Hi Vinaraj,
YOu have repied as closed and solved the issue.
Please can let me know what FM we have to use.
I didn't understand call function ' '. Ho to to capture the message from PRELIMINARY_POSTING_FB01 .
Wiaitng for your reply.
Thanks