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: 

Batch run and need number

Former Member
0 Kudos

Hi all,

I have created a batch input program to enter customer cheques

and according to cheque number a new document is created through transaction F-36.

That is to say, assume 10 lines of data is available in file and all cheque numbers are different.

So do I have to call following sentence as 10 times?

CALL TRANSACTION 'F-36' USING bdcdata
                          OPTIONS FROM lv_opts
                         MESSAGES INTO messtab.

If yes, then How can I get the created FI documents numbers?

Waiting for your useful answers, offers.

Thanks.

deniz.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

After Call Transaction Syntax check for sy-subrc.

If sy-subrc = 0.

loop the internal table of messages and call fm

FORMAT_MESSAGE.

Now,

loop the messages int table.

case msgtyp.

when 'S".

write 😕 msgv1(Document NoS), msgv2.......

endloop.

This is how U can trap the Document NOs.

Hope this will help U out.

Regards,

Shake sha vali

4 REPLIES 4

Former Member
0 Kudos

Hi,

When you have to fill your BDC table you will need to put all your file into an internal table and i hope you have done that.

If you have done this then you need to loop on your internal table and call this statement.

Also you messtab will have the message numbers and will have 4 fields called MSGV1 MSGV2 MSGV3 and MSGV4. One of these fields will have the document number created.

Regards,

Pramod

Former Member
0 Kudos

Hi,

Use the Parameter Id for the FI document number at the dataelement level and try to get them using this paramter id. Use the GET PARAMETER ID for that.

Regards

Lekha

Former Member
0 Kudos

Hi,

After Call Transaction Syntax check for sy-subrc.

If sy-subrc = 0.

loop the internal table of messages and call fm

FORMAT_MESSAGE.

Now,

loop the messages int table.

case msgtyp.

when 'S".

write 😕 msgv1(Document NoS), msgv2.......

endloop.

This is how U can trap the Document NOs.

Hope this will help U out.

Regards,

Shake sha vali

Former Member
0 Kudos

yes you can get the FI document number by using

GET paramater ID 'BLN' field belnr , after call transaction if sy-subrc = 0.

then put in internal table for further processing.