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

Success or Error msgs in BDC(Session method) program.

0 Likes
1,530

Hi,

My requirement is to upload two tcodes from excel to sap for which I have chosen Session method.

As we all know, uploading more than one tcode can be done using session method alone.

Here I'm processing the record inline the program using RSBDCSUB.

The output should be a ALV report displaying the records which were successfully uploaded and also

the records which failed to.

For this I have a field(EXCEPTIONS) in my ALV GRID.

For records which were successfully uploaded. The exception field should appear green.

And for records which failed, it should appear red.

Now how do i capture the success or failure msgs inside my program without having to go to tcode sm35 ?

Thanks & Regards,

Shruthi M.R

1 ACCEPTED SOLUTION
Read only

matt
Active Contributor
0 Likes
1,069

Shruthi M.R wrote:

As we all know, uploading more than one tcode can be done using session method alone.

...

This is not the case. In your program you can build two different BDC tables - one for each transaction and then use call transaction once for each transation.

If you're not going to use SM35, then there's no point in using the session method. You might as well program your error handling directly.

7 REPLIES 7
Read only

matt
Active Contributor
0 Likes
1,070

Shruthi M.R wrote:

As we all know, uploading more than one tcode can be done using session method alone.

...

This is not the case. In your program you can build two different BDC tables - one for each transaction and then use call transaction once for each transation.

If you're not going to use SM35, then there's no point in using the session method. You might as well program your error handling directly.

Read only

0 Likes
1,069

Hi Shruthi,

I think, you have 2 options:

1.- Use Call Transaction.

2.- Remember that, BDC_OPEN_GROUP, BDC_INSERT, BDC_CLOSE_GROUP just create a session on SM35 but not run the session, your has to entry SM35 and process manually.

So, if you can to use this option, i think you will need to process BDC session programatically, check this link How to process BDC session programatically and capture errors instead of manual SM35 - ABAP Developm...

Regards,

Read only

0 Likes
1,069

Hi David,

As I have metioned in my earlier post. I am processing the session in the background using the standard program RSBDCSUB. Also, the records are being successfully uploaded in the database.

All that I need, is to capture the success or failure msgs in my program and display it using the exception field.

Is there any function module or standard program to get only the log msgs?.

Read only

matt
Active Contributor
0 Likes
1,069

Why are you using RSBDCSUB instead of using CALL TRANSACTION directly, which will give you access to success/failure messages immediately?

Read only

0 Likes
1,069

Hi Matthew,

I understand what you are trying to say.

That is the task assigned to me. So, I am using Session method.

Anyways! Thank you all.

My issue is resolved. I debugged the standard code and got the piece of code which holds the log details.

Regards,

Shruthi M.R

Read only

matt
Active Contributor
0 Likes
1,069

You were told to use the session method, and so you use the session method even though experts here with many years experience have suggested it might not be the best method?

Read only

0 Likes
1,069

Hi Matthew,

I really respect your time and efforts in solving the issue.

That was a challenge given to me, to fetch the log details in Session method.

Hence I stuck to Session method alone.

Regards,

Shruthi M.R