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

rsbdcsub failure case needed ?

Former Member
0 Likes
1,069

Hi Experts

submit rsbdcsub and return

user sy-uname

with mappe = group

with von = sy-datum

with bis = sy-datum

with z_verarb = 'X' .

above is the code which submit the session automatically. i am right?

my question is where we can get in program session failur case .

based on that case i need to make a program to send an mail to user.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,020

>

> my question is where we can get in program session failur case.

If by "session failure" you mean the session has rejects. there's not much you can do. This program just starts the session and returns to your program. The session may end much later.

Rob

8 REPLIES 8
Read only

Former Member
0 Likes
1,020
submit rsbdcsub and return
user sy-uname
with mappe = group
with von = sy-datum
with bis = sy-datum
with z_verarb = 'X' .

above is the code which submit the session automatically.  am i right?

Absolutely Correct.

my question is where we can get in program session failur case .
based on that case i need to make a program to send an mail to user.

SUBMIT rsbdcsub WITH mappe = l_session

WITH fehler = space

WITH von GE sy-datum

AND RETURN.

Check values populated in RETURN here.

Hope this helps!

Read only

0 Likes
1,020

>

> Check values populated in RETURN here.

Well, RSBDCSUB isn't a BAPI and won't have a RETURN table.

Rob

Read only

0 Likes
1,020

SUBMIT rsbdcsub

USER sy-uname VIA JOB jobname NUMBER jobcount_test

WITH mappe = map

WITH von = pdatum

WITH z_verarb = 'X'

AND RETURN .

*

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

jobcount = jobcount_test

jobname = jobname

strtimmed = strtimmed

targetsystem = sy-host

IMPORTING

job_was_released = job_released

EXCEPTIONS

cant_start_immediate = 1

invalid_startdate = 2

jobname_missing = 3

job_close_failed = 4

job_nosteps = 5

job_notex = 6

lock_failed = 7

OTHERS = 8.

IF sy-subrc > 1.

MESSAGE x000(yp) WITH 'JOB-CLOSE ' jobname ' failed!!!'.

ENDIF.

Read only

0 Likes
1,020

Yeah Rob, Sorry, It was oversight from my side.

Kalyan, RETURN has nothing to do with passing the run values back to the system but it is related to program control.

ABAPHELP Documentation says:


 The addition AND RETURN starts the executable program in a new internal session. 
The session for the calling program is retained. Once program access is completed, program 
execution for the calling program continues after the SUBMIT statement. 

Read only

Former Member
0 Likes
1,021

>

> my question is where we can get in program session failur case.

If by "session failure" you mean the session has rejects. there's not much you can do. This program just starts the session and returns to your program. The session may end much later.

Rob

Read only

0 Likes
1,020

Thanks Rob

when session will complete the process. does this program do the session process automatically?

could plz advise is here any case availble to close the session automatically.

because my requirement is to send an email(through programatically) after the session completed.

Thanks.

Read only

0 Likes
1,020

Neither your program nor RSBDCSUB knows anything about the session other than the fact that it was started.

If you search the forum for RSBDCSUB, you will find more information.

Rob

Read only

0 Likes
1,020

Probably you can read the status of BDC Session from the standard table/s APQD, APQI , APQL.

But the design would not be so good as you will read the session status If its not Completed/Errored then WAIT and then again Read the status.

This is just one approch to handle the issue i am not sure generally how much your session will take time.