10-12-2007 7:00 PM
Hello experts.
My requirement is like this, please help me.
i want to pass data to ke21 transaction. I am fetching data from different tables based on different conditions as per our requirement. i will be having all the data in the internal table .
Now i want to populate the ke21 with the internal table data. I want to populate only 5 screens and rest of the screens i want to ignore it . So please tell me how to write the bdc for this requirement . we will sechudle in the background this job everyday. So please tell me which method to use session or call transaction. Please tell me step by step process what to do.
thanks for all the replies.
10-13-2007 5:59 PM
hi,
Firstly record transaction KE21 using SHDB.After recording is done program gets generated.
Now you will have many perform bdc_field statements.You can pass data from your internal table to these perform statements.Since you are using background job,I think session method is better.If you still have any more doubts,please let me know.
10-14-2007 1:18 PM
hi,
Instead of Gui_upload use oendata set .
and use session menthod.
About Session method
In this method you transfer data from internal table to database table through sessions.
In this method, an ABAP/4 program reads the external data that is to be entered in the SAP System and stores the data in session. A session stores the actions that are required to enter your data using normal SAP transaction i.e., Data is transferred to session which in turn transfers data to database table.
Session is intermediate step between internal table and database table. Data along with its action is stored in session i.e., data for screen fields, to which screen it is passed, the program name behind it, and how the next screen is processed.
When the program has finished generating the session, you can run the session to execute the SAP transactions in it. You can either explicitly start and monitor a session or have the session run in the background processing system.
Unless session is processed, the data is not transferred to database table.
BDC_OPEN_GROUP
You create the session through program by BDC_OPEN_GROUP function.
Parameters to this function are:
User Name: User name
Group: Name of the session
Lock Date: The date on which you want to process the session.(IF U WANT TO RUNTHEPG DAILY GIVE SYS DATE)
Keep: This parameter is passed as X when you want to retain session after
processing it or to delete it after processing.
BDC_INSERT
This function creates the session & data is transferred to Session.
Parameters to this function are:
Tcode: Transaction Name
Dynprotab: BDC Data
BDC_CLOSE_GROUP
This function closes the BDC Group. No Parameters.
Some additional information for session processing
When the session is generated using the KEEP option within the BDC_OPEN_GROUP, the system always keeps the sessions in the queue, whether it has been processed successfully or not.
However, if the session is processed, you have to delete it manually. When session processing is completed successfully while KEEP option was not set, it will be removed automatically from the session queue. Log is not removed for that session.
If the batch-input session is terminated with errors, then it appears in the list of INCORRECT session and it can be processed again. To correct incorrect session, you can analyze the session. The Analysis function allows to determine which screen and value has produced the error. If you find small errors in data, you can correct them interactively, otherwise you need to modify batch input program, which has generated the session or many times even the data file.
10-15-2007 7:13 AM
it depends upon requirement..if there are too many records and frequency then use session method instead use call transaction method...