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: 

BDC Upload in Background with the help of F9

former_member207009
Participant
0 Kudos

Hello ,

I develop a code for BDC to upload excel file from PC for T-code F-02 that is Payroll upload .

It's working fine but problem is that client want to run this program in background not only BDC

even full program through F9 or on selection screen menu path Program--> Excute in background .

when we did that it's not working job always cancel in SM37 . So please provide any solution ASAP

if somebody have knowledge about that .

Thanks & Regards

Gaurav Sharma

1 ACCEPTED SOLUTION

former_member207009
Participant
0 Kudos

Hello Peter,

  I told the same thing to client like it is not possible to upload File from presentation server in background , for background we have to save that file in application server to upload . But they are not ready to understand . So whta should i do now please suggest me .

Thanks & Regards

Gaurav sharma

16 REPLIES 16

PeterJonker
Active Contributor
0 Kudos

That is not possible.

You cannot upload a file from PC (always online !!!) and run it in the background same time.

You will need to change your program and extend the selection screen with a radio button group where the user have to choose to run online or in background.

Online file upload from PC is possible, add a selection screen field for the path to pc file and a F4 help for this.

In Background a program can only upload a file from the SERVER, not from a PC, because the program runs on the server (that is what background means) and therefore has no connection to a PC/desktop.

For this part you also add a selection screen field for the path to server file and a F4 help for this.

Then depending on your server OS you might have to change the file from excel to csv, unless you saved the excel file in xml format. (if your OS is e.g. UNIX).

shaik_sajid
Active Contributor
0 Kudos

former_member207009
Participant
0 Kudos

Hello Peter,

  I told the same thing to client like it is not possible to upload File from presentation server in background , for background we have to save that file in application server to upload . But they are not ready to understand . So whta should i do now please suggest me .

Thanks & Regards

Gaurav sharma

0 Kudos

Hi Gaurav,

Whether they understood or not, it is not possible. So, explain it from your side with the alternative solution which is possible.

BR

Tanmay

0 Kudos

Well, there is not much that you can do if the client demands something that is technically not possible.

Try to explain again that background is run on the SAP Application server and therefore no connection to the desktop exist. How should the application server now on which desktop to look for the file ?

But it is your job to convince your client that you are right.

I would also ask your client the reason why they want to run this on background, maybe that gives you a clue for an alternative solution that you can then suggest to them.

Or suggest to them to get a second opinion from another developer. And if that doesn't help let them do a search on this EXPERT forum themselves on "upload excel in background", maybe they will believe you when all the SAP experts are telling the same thing.

And if that still not convinces them let them call SAP.

But in general it is not a good thing that the client does not believe you.

I suggest you have a talk with your team manager or other direct manager of you where you mention this.

0 Kudos

Hi

You need to talk about the problem to IT manager of your customer: it's a technical problem, there's no solution except to use a file stored in the application.

Max

0 Kudos

Thanks to all for reply ,

I talked to my manager and explained this thing and i thing he got the point and do uploading

online .

But here is one query about that , actually when we enter any value in F-02 and save it then one document Number generates , so when we do upload with BDC then user have to check this document number in SM35 log . So is there any way to get Document number on front screen as success message .I did run session method in background no need to go SM35 to process it .

Thanks & Regards

Gaurav Sharma

0 Kudos

Hi

I think the best solution could be to use the BAPI BAPI_ACC_GL_POSTING_POST or BAPI_ACC_DOCUMENT_POST instead of a BI based on F-02, the BAPI returns the document number.

If you use BI method, you can submit the report RSBDCSUB in order to run your BI session

so it doesn't need SM35,

Max

0 Kudos

Hello Max ,

I have to use this BAPI Exiting BDC code or i have to create new code for BAPI or this bapi will post the data or give the document number of recently posted document . because i don't have enough knowledge of BAPI .

 

Thanks

Gaurav sharma

0 Kudos

Hi

The BAPI is better....for me, to replace the code for BAPI should be easy, because you need to fill the structure of BAPI instead of the BDC structure,

The BAPI will post the document and returns the number.

Max

0 Kudos

Hello Max,

I already submit RSBDCSUB this code to my BDC code to run session in background to avoid go to SM35 and process and its working fine but it generates one document number that i can see only in SM35 and user don't have authorization for T-code SM35 that why i want  this Document number on front end . so is it possible without BAPI .

Thanks

Gaurav Sharma

0 Kudos

Hi

You can try to show the log of SM35 after submitting the session by RSBDCSUB:

RSBDCSUB runs the session in background, so it schedules a job called like the session, you can check the status of this session and so show the log.by program RSBDC_ANALYSE

Max

0 Kudos

Hello Max ,

Thanks to reply and to solve my problem , i appreciated .

Still i am waiting from confirmation from my manager is this has convinced him or not

hope got the point because this is only way to do that.

Thanks & Regards

Gaurav Sharma

0 Kudos

Hello,

Last problem has solved but now i have new problem , actually user is not authorize for SM35 so

BDC with session method giving error like User is not authorize for SM35 so now i changed the

code and trying to upload through Call Transaction but in this i have also some problem .Error is

"Input field is longer than screen field BSEG-WRBTR " i have taken same data type for input field ..

Actually BDCDATA have field value have length 132 and BSEG-WRBTR have 13 with 2 decimal . so i think that's why this error is coming . so if some body have solution for that please provide .

Thanks & Regards

Guarav Sharma

0 Kudos

Hi

How do you transfer the amount value?

A good solution can be to use WRITE statament:

WRITE <AMOUNT> TO BDCDATA-VALUE CURRENCY <CURR>,

In this way yuo should be sure to transfer the amount in correct format.

Max

0 Kudos

hello ,

I Solved the problem .by this code

BSEG-WRBTR:

   data : amt1(16) type C.

   write WAREA-WRBTR  to AMT1 .
    condense AMT1.


perform BDC_FIELD       using 'BSEG-WRBTR'
                                       AMT1."WAREA-WRBTR.