Application Development and Automation 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: 
Read only

Parking documents using PRELIMINARY_POSTING_FB01

Former Member
0 Likes
2,277

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 ?

7 REPLIES 7
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,305

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.

Read only

0 Likes
1,305

hi,

i tried that, as the call is not coming to back to the program, it wont work.

Read only

0 Likes
1,305

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.

Read only

Former Member
0 Likes
1,305

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

Read only

0 Likes
1,305

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.

Read only

Former Member
0 Likes
1,305

closed

Read only

0 Likes
1,305

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