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: 

Upload

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Thanx a lot everyone for taking time & helping me. I will be rewarding points very soon to everybody

18 REPLIES 18

Former Member
0 Kudos

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

0 Kudos

hi,

thanx a lot, Can u please tell me how to use BDC as i have never worked on it,

thanx.

0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Thanx a lot everyone for taking time & helping me. I will be rewarding points very soon to everybody

0 Kudos

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.

0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

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.

0 Kudos

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

0 Kudos

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

0 Kudos

thanx a lot abdul

0 Kudos

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

0 Kudos

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...