05-05-2008 8:05 AM
A BDC is working fine in foreground but not making the same changes when run in background.
What could be the problem and how should i approach it????
05-05-2008 8:08 AM
05-05-2008 8:13 AM
Yup GUI_UPLOAD n its uploading the data into the internal table perfectly
05-05-2008 8:17 AM
GUI_UPLOAD doesn't work in background mode. GUI_UPLOAD can work with files which are on ur desktop i. e. presentation server. In background mode, this presentation server is not available. Hence you need to keep the file on application server and then you need to get the data using dataset functions - OPEN DATASET, TRANSFER DATASET.
Have a look at below links about this file handling.
[File Handling in ABAP|http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3c8c358411d1829f0000e829fbfe/frameset.htm]
[Sample Code|http://www.sap-img.com/ab004.htm]
I hope it helps. Let me know if any doubts.
Best Regards,
Vibha
Please mark all the helpful answers
05-05-2008 8:11 AM
Many SAP transactions behave differently in online mode and in Batch mode and this mode is determined by the SY-BINPT variable that can be controlled using the OPTIONS command in addition to the CALL TRANSACTION.
 For example, the error message that usually comes in status bar while you are running the transaction online might appear in a popup window when you are running that in batch. This will make your fields disabled for input. This OPTIONS addition will remove this problem
The way to use the OPTIONS addition.
Declare a work area of type CTU_PARAMS.
Fill the fields of CTU_PARAMS. The field NOBINPT should be set to X.
This will set the SY-BINPT to space. So now the transaction which you will be calling will run in online mode.
Example.
clear X_OPTIONS.
X_OPTIONS-DISMODE = 'E'.
X_OPTIONS-UPDMODE = 'S'.
X_OPTIONS-CATTMODE = ' '.
X_OPTIONS-DEFSIZE = ' '.
X_OPTIONS-RACOMMIT = ' '.
X_OPTIONS-NOBINPT = 'X'.
X_OPTIONS-NOBIEND = ' '.
call transaction 'BP' using T_BDCDATA[] options from X_OPTIONS.
Note:
Do not use the MODE & UPDATE additions when you are using OPTIONS. The mode & update values are passed in the CTU_PARAMS structure.
05-05-2008 8:14 AM
Hi,
After filling th BDCDATA table(filling session)...
You use call transaction statement: in that you have addition Mode: use N instead of A...This will run in background..
CALL TRANSACTIOn 'ME21' MODE 'N'
A will run in foreground(All screens)
Reward if useful
Regards
Shiva
05-05-2008 8:21 AM
Dear,
You have to use open data set while you are setting the program as background. this is one thing
and next thing you have to take the error message list i mean you have to exclude the error message or warning messages while you are doing through transaction
In details when you are selecting data from sap and you are passing those values to you bdc table in that case you have to exculde the messages like error or warning.
Hope it will help you.
Revert me if you have quaries.
Regards,
Madan.
05-05-2008 8:24 AM
Hi,
Place the FLAT FILE in application server by using OPEN DATASET concept.
sachin.