04-03-2006 6:40 AM
hi all,
The data of transaction f-02 is in excel sheet.
The requirement is:
Whenever the user run's the program, the program should upload data into all the fields of f-02 transaction.
Solution:
Iam uploading the data from excel into internal table using function :alsm_excel_to_internal_table.
What i need is a method how to transfer data from internal table to the required fields of f-02.
thanking in advance,
regards
04-03-2006 7:16 AM
Thanx a lot everyone for taking time & helping me. I will be rewarding points very soon to everybody
04-03-2006 6:52 AM
Amna,
What you need is a BDC program which will run through the screens and put the data in there.
Record the F-02 transaction using SHDB transaction and then use the generated programs to run your BDC with the data uploaded from the Excel file.
Regards,
Ravi
04-03-2006 7:00 AM
hi,
thanx a lot, Can u please tell me how to use BDC as i have never worked on it,
thanx.
04-03-2006 7:06 AM
Hi Amna,
Just record the transaction F-02 using the tcode SHDB.
Pass the values to the screen fields which you really need and the mandatory ones as well.Finally save.
Afterwards the system will genereate you the program automatically and you can copy it your own program say for eg Z program by clicking the appropriate icon in the application toolbar.If you face any prblm then let me know..
Cheers,
Abdul Hakim
04-03-2006 7:07 AM
Amna,
Look into these links.
http://www.sap-img.com/bdc.htm
http://www.guidancetech.com/people/holland/sap/abap/
regards,
Ravi
note : Please mark the helpful answers
04-03-2006 7:04 AM
Hi Amna,
You need to write a BDC program for uploading data to the respective fields of the transaction.
Go to SHDB and start recording the transaction F-02 after entering data in the fields and screens that u require save the recording and go to shdb u will find ur recording select that and click on the button PROGRAM which will generate the program for that particular recording.
Use FM GUI_UPLOAD to upload data from file to internal table, provided the excel file is on your Presentation Server.Or else use Open dataset stmts, to upload the file which is on the Application server.
Hope this helps,
priya
Message was edited by: Priya
04-03-2006 7:12 AM
Hello Amna,
The BAPI usage will also solve your problem. You have data in internal table and you want to place this data into respective fields of F-02.
BAPI usage in the programs is like use of function modules with import, export, tables & exceptions.
You will need to pass on the values from the internal table to these BAPIs.
Following are some BAPIs avaialble for this -
1. If you want to post a document with only GL account -
bapi_acc_gl_posting_post
2. If you need to post documents to vendor -
bapi_acc_invoice_receipt_post
3. For customers - the bapi_acc_billing_post
PS: If the answer solves your query, plz reward points.
Regards
04-03-2006 7:13 AM
Hi
Just have look into below link
http://www.sapgenie.com/abap/bdc.htm
http://www.guidancetech.com/people/holland/sap/abap/yusermod.htm
http://www.guidancetech.com/people/holland/sap/abap/zutbdcer.htm
regards
vinod
04-03-2006 7:16 AM
Thanx a lot everyone for taking time & helping me. I will be rewarding points very soon to everybody
04-03-2006 7:39 AM
hi,
The recording is not generating a program.It is giving the error:
field cobol-gsber not available on the screen.
Also please tell me the alternate method using bapi.
thanx.
04-03-2006 8:21 AM
hi amna,
after recording jus save and come back to the initial screen of the recording.Select ur recording name and choose Program button on the appln.toolbar and afterwards give a name for ur prog and select the option <b>"Transfer from recording".</b>
If you wanna use BAPI then use <b>BAPI_ACC_GL_POSTING_POST</b>
Cheers,
Abdul
Message was edited by: Abdul Hakim
04-03-2006 8:48 AM
hi abdul,
thanx a lot if i have data in table t_record
Types: begin of t_record ,
BUKRS like itab-value,
BELNR like itab-value,
BLART like itab-value,
BLDAT LIKE ITAB-VALUE,
BUDAT LIKE ITAB-VALUE,
MONAT LIKE ITAB-VALUE,
WWERT LIKE ITAB-VALUE,
XBLNR LIKE ITAB-VALUE,
BKTXT LIKE ITAB-VALUE,
WAERS LIKE ITAB-VALUE,
END OF T_RECORD.
then how would i use the bapi :
bapi_acc_gl_posting_post to transfer the data from internal table t_record to bapi,
thanking in advance
04-03-2006 8:54 AM
hi amna,
it is pretty simple to use it.
jus go thru the documention of the FM then u will come to knw.chk the interface parameters documention as well..
If any prblm then let me knw...
Cheers,
Abdul
04-03-2006 9:15 AM
HI,
In internal table t_record iam uploading data from excel sheet using function module 'Alsm_excel_to_internal_table'
i want to know how would i pass this table 't_record' to bapi & then call this bapi in report.
thanking in advance,
regards.
04-03-2006 9:18 AM
hi amna,
jus pass the necessary values from ur internal table to the interface of the BAPI.I am advicing u to go thru the documentation of the BAPI and its interface b4 using it.
Any prblm let me knw...
Cheers,
Abdul
04-03-2006 9:21 AM
Amna,
Have a look at the BAPI documentation... this will let you know which fields are to be filled in which of the BAPI Internal tables.
However I would really suggest that you go via the BDC method as this would be simpler to understand and quicker to resolve issues.
The error message you are giving indicates that for the GL Account you are using , there is a mandatory field missing from the screen. Try using another GL account in the recording or speak to the functional consultant about it.
Once you have the recording then you can use a simple program to pass your "t_record" data to the BDC fields.
Hope this helps
04-03-2006 9:23 AM
04-03-2006 9:33 AM
hi,
I already have the bdc recording also i have generated the program.
What i want is a a sample program which passes the data from t_record to BDC data.
IAm extremely gratefull for all the help.
regards
04-03-2006 9:48 AM
It should not be difficult...
Assuming your internal table has fields
t_record-bukrs,
t_record-budat,
t_record-blart.
then when you do the recording and save it there is an option to create a program ( Select recording in SHDB>Menu Path Edit>Create Program)
This will ask you for a program name... enter a z program name ( say ZBDCTMP) and it will give you the recording in program format with routines already filled.
Copy the code from the ZBDCTMP into your program as it is..
then
Loop at t_record.
...
routines from ZBDCTMP (copy pasted)
...
call transaction 'F-02' with bdcdata... etc
endloop.
What exactly are you having difficulty with?.
I must also mention that the COBL error will probably come up in the BAPI as the BAPI will be checking missing fields in config in any case...