Application Development 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: 

Displaying custom messages in BDC session instead of using SM35

former_member582508
Participant
0 Kudos

Hello everyone,

I have a query regarding BDC session as this is the first time I am working on a BDC requirement. Now I do know that to check messages (error or success) using BDC session method, we need to go to SM35. Now in my requirement, the user has to upload the data from excel and after executing the BDC program, needs to see the error or success messages after the data has been uploaded. So, he/she does not not need to go to SM35 for the messages to be displayed.


So if I am using the session method (not call transaction!) to upload large volumes of data, how can I display the messages in the bdc program to the user without he/she going to SM35 ?  Moreover the messages must be customized messages and not the ones used in the SM35 log for the purpose of simplicity.

Regards.

Manish

30 REPLIES 30

roberto_vacca2
Active Contributor
0 Kudos

Hi.

If you can't use Call transaction with messtab return table, then you could try to use RSBDCDRU standard report to print in a spool request or read message.

This is a standard report to analyze bdc from ID and folder Data...

Hope to help

Bye

0 Kudos

Hi Roberto,

Sorry but I dont know how that standard report will help me to display messages from SM35 to the user in the background.

0 Kudos

Hi.

I suppose you've created a custom Z* bdc program from SM35.

If not there's a creation program reference label in SM35.

For your need There should be a custom BDC program behind. You should change this code adapting to your needs and because you need custom messages too.

Standard report show how to read LOG bdc data from standard tables within a BDC running in a session mode.

Hope to help.

0 Kudos

Hi.

Roberto, I have created a custom Z program for the recording for session. My issue is how to go ahead and display the messages to the user . I need to know how.

Thanks.

Manish

0 Kudos

The messages, you want to display, are generated while posting (while BDC group runs, started in SM35).

That brings us back to the question, I asked you a few minutes ago.

0 Kudos

Hi.

To display messages to the user, if you don't use call transaction with messtab returning table, you'll have first to manage LOG messages of your bdc session directly.

Standard report RSBDCDRU show you how to read LOG messages.

If you've already managed this step, you have to decide how to show messages to your user without going into SM35, you can use POPUP messages, Mail, SAP business workplace, etc.

If you want to hide messages in foreground , you have to manage them into a spool print.

Try to put your custom program  and the point where you want to show your messages.

Hope to help

Bye

0 Kudos

But this only can be done, if the BDC has been started. His Z program generates the BDC, but there is no information, that the BDC is started by this Z program.

0 Kudos

Hi,

Well honestly, since this is my first ever real time requirement in BDC, I really don't know how to manage log messages directly, or how to manage them into a spool print (I don't even know what that means). So basically, I need a step by step guidance for my issue as this is something I have never come across before during my training.

I just need to write that message in the background so that the user can see it after uploading has been done.

Regards.

Manish

0 Kudos

Hi.

As your need seems to be a little complicated, you can show us some dynpros of what are you doing at the moment, step by step.

You have to think that every custom solution need to be analyzed well before giving an answer.

0 Kudos

Hi,

Below are the screen shots of my requirement. I have also attached the screenshots of the code I have written for your reference.

1) The transaction I need to deal with is XD03. Under the tab Marketing, the customer class (KUKLA) and ASM Territory (BRAN1) has to be uploaded for the respective customer numbers:

2) I have done the recording and below is my custom BDC program:

    

So after executing the above code I get the below screen :

On executing it, since it is done via session, no messages will come up as I (or the user in this case) has to go to SM35.

Hence I need to know how to throw the messages to the user after executing the above screen .

Regards

Manish

0 Kudos

Hi.

You'll need to manage messages in some way.

Look there Get log of batch input session - ABAP Development - SCN Wiki

From APQL table with group ID (your Z* bdc name session) you get QID.

With QID you get messages during batch input.

Have a look and let us know.

0 Kudos

He wants to get the messages, BEFORE the BDC has been startet.

ralf_wenzel_heuristika
Active Participant
0 Kudos

I tried to figure out what exactly you want.

So, the user wants to see the messages, BEFORE posting (means: BEFORE starting the BDC in SM35?

Or he wants to see the messages AFTER posting, but not byusing SM35?

0 Kudos

Its clearly mentioned in my post Ralf. How can error or success messages be displayed unless and until the data has been uploaded successfully or unsuccessfully ?

The user wants the messages AFTER uploading the data, but not by using SM35.

0 Kudos

It's not, I'm afraid. Sure, you want to display the messages after uploading, but before or after the BDC run?

1. Start Z-Report to Upload the Data and BDC creation.

2. <--- do you want to get the messages HERE?

3. Go To SM35 and make the BDC itself running.

4. <--- do you want to get the messages HERE?

0 Kudos

As per your comment, I would like my messages to be displayed at step 2. But since I am using BDC session, I need to know how to display the messages to the user .

0 Kudos

OK, a BDC group contains transactions, which are running in step 3. The messages, you need to get, are caused by this transactions. If you want to get this messages, before step 3 (which is the step, that executes the transactions), you have to determine, which messages the transactions may generate.

Which transaction do you want to use?

0 Kudos

The transaction is XD03.  In short as Raghu mentioned, I need to paste the standard code of SM35 in my custom BDC program so that I can fetch the messages from there, simplify and modify it and throw it in the background to the user after he/she executes my BDC program . Now I need to know how to go about doing it.

former_member186319
Participant
0 Kudos

Hi Manish,

As per my understanding you need to display messages as soon as you run the custom program (Using BDC Session) without involving SM35 transaction.

If that is the case, then it will be a bit complicated to achieve your requirement.

The thing is, you should definitely process your session from SM35 after running your Z program. If you don't like to go to SM35 and process the sessions, then you have a write a code to process your session that behaves like SM35 tcode. Which is not that easy.

Procedure: If you want to achieve your scenario:

Steps:

1. Record SM35 transaction to process the session. (Use BDC Call transaction)

    With this recording you can automatically process your session.

2. After processing your session automatically with the code generated from step-1, Log will be generated in SM35 (Select your session and Click on Log).

3. You need to analyse the standard code when you select your session and click on Log.

    You have to pull that standard coding part and use that in your custom Z program to write the       custom messages as per required.

The above process is bit complicated and time consuming, you have to decide whether to go like this or use SM35.

Regards,

B Raghu Prasad

0 Kudos

Is that the same as "submit rsbdcsub" and reading the messages from DDIC?

0 Kudos

Hi Raghu,

Ok this is really tough for me as I didn't expect my first real time requirement to be out of the box. I didn't understand a few things though.

1. You want me to record sm35 in SHDB and then what am I supposed to do? Where will I get the code from? (Sorry because this is something I have never done before)

2. In this case, the user will be uploading data from excel and its not me. As a result he/she will not know what SM35 means that's why I have to throw a simplified message for the user to notify if the data has been uploaded successfully or not.

3. There will be about 6000-7000 data that need to be uploaded. So is this considered a large amount of data or small? I know that we use call transaction for less number of data, but for these many records is session a better approach ?

Also I really need to understand fully as to how I can get the code from sm35 and paste it in my custom program so I can get the messages from there and throw them in the background after the user executes the BDC program.

Regards.

Manish

0 Kudos

Perhaps, you better could post the data via BAPI/FM....?

0 Kudos

So I need to find the find the function module (that is BAPI) by myself or do I need to ask that from my SD consultant ?

0 Kudos

(crap deleted)

You are using XD03? This shows customers - why do you want to display customers in a BDC session????

0 Kudos

Hi Manish,

See my comments below:

1. You want me to record sm35 in SHDB and then what am I supposed to do? Where will I get the code from? (Sorry because this is something I have never done before)

Ans: If you record SM35 tcode, you will get an auto generated code by selecting your recording from SHDB and then click Program. (I hope you already know this process)

2. In this case, the user will be uploading data from excel and its not me. As a result he/she will not know what SM35 means that's why I have to throw a simplified message for the user to notify if the data has been uploaded successfully or not.

Ans: I agree that user doesn't know about SM35, you should guide/teach the user by proving a relevant documentation with the clear steps on processing the sessions from SM35.

3. There will be about 6000-7000 data that need to be uploaded. So is this considered a large amount of data or small? I know that we use call transaction for less number of data, but for these many records is session a better approach ?

Ans: You can still use CALL TRANSACTION process, if you think the record count is too high then run the Z program twice (First load: 3000 and rest in the second load)

Hope you understand clearly.

Regards,

Raghu Prasad

0 Kudos

I didnt get what you meant

0 Kudos

You are starting XD03 to display customer's data. Then you start XD03 again to display the next customer's data. And again and again.

What do you want to to - exactly?

0 Kudos

I can't contemplate what is the part you don't understand..so I will simply tell you the requirement that I have. The fields KUKLA and BRAN1 have to be uploaded from excel . I am planning to use bdc session to to that. The issue I have is to display the messages from SM35. Below is the excel screen shot. Hope I have made myself clear.

0 Kudos

BAPI_CUSTOMER_CHANGEFROMDATA

BAPI_CUSTOMER_CHANGEFROMDATA1

former_member186319
Participant
0 Kudos

Hi Manish,

You can also use CMD_EI_API=>MAINTAIN_BAPI to update the customer master data.

Please dig through it, you will find solution.

Note: You have to look at deep structure CMDS_EI_MAIN (IS_MASTER_DATA).

Regards,

B Raghu Prasad