Application Development and Automation 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: 
Read only

FM module not returning the document number

Former Member
0 Likes
1,575

Hi all,

I am using FM PRELIMINARY_POSTING_FB01 to park a document, it's working perfectly fine and I am able to park the document as well but at the end of the FM it's not returning me the document number, so can you please tell me how can I get the document number which I parked using this FM at the end of the program.

Thanks,

Rajat Garg

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,487

When a document is created and saved to the database, the document number is stored in the SAP memory. You can access this number from the memory using the Parameter ID that identifies the particular document number.

Try using Get parameter Id for extracting the value from SAP memory.

DATA: w_belnr TYPE bkpf-belnr.

GET PARAMETER ID 'BLN' field w_belnr.

Hi all,

I am using FM PRELIMINARY_POSTING_FB01 to park a document, it's working perfectly fine and I am able to park the document as well but at the end of the FM it's not returning me the document number, so can you please tell me how can I get the document number which I parked using this FM at the end of the program.

Thanks,

Rajat Garg

10 REPLIES 10
Read only

Former Member
0 Likes
1,487

In the tables parameter you are getting BKPF back.. I think you can get document number from this..

Read only

0 Likes
1,487

Hi, Can you please expalin a little more, This is what I am passing:

call function 'PRELIMINARY_POSTING_FB01'
exporting
i_tcode = 'FV60'
I_XCMPL = 'X'
I_TCODE_INT = 'FV60'
IMPORTING xepbbp = l_xepbbp
tables
t_bkpf = lt_bkpf
t_bseg = lt_bseg
t_bsec = lt_bsec
t_bset = lt_bset
t_bsez = lt_bsez
exceptions
error_message = 1.
p_return-id = sy-msgid.
p_return-type = sy-msgty.
p_return-number = sy-msgno.

Read only

0 Likes
1,487

tables are used for input and output....look at contents of the internal table(s) AFTER your FM call.

Read only

Former Member
0 Likes
1,488

When a document is created and saved to the database, the document number is stored in the SAP memory. You can access this number from the memory using the Parameter ID that identifies the particular document number.

Try using Get parameter Id for extracting the value from SAP memory.

DATA: w_belnr TYPE bkpf-belnr.

GET PARAMETER ID 'BLN' field w_belnr.

Read only

0 Likes
1,487

Thanks for the reply Raj.. Can you please explain a lil more in detail as I am not that familiar with this.

Thanks

Read only

0 Likes
1,487

READ TABLE it_bkpf INDEX 1.

IF sy-subrc = 0.

  • Accounting document

GET PARAMETER ID 'BLN' FIELD it_bkpf-belnr.

ENDIF.

Edited by: Raj on Jul 16, 2010 7:13 PM

Read only

0 Likes
1,487

Hi Raj,

I tried this but the problem is the lt_bkpf doesn't have the document number it and hence nothing was retrieved.

Read only

0 Likes
1,487

I also tried likt his:

data:w_belnr TYPE bkpf-belnr,

para TYPE tpara-paramid VALUE 'BLN'.

GET PARAMETER ID para FIELD w_belnr.

but nothing is happening.

Edited by: rajatg on Jul 16, 2010 3:51 PM

Read only

0 Likes
1,487

The document must be in one of the internal tables otherwise it would not allow you to park the document. Can you please check it again or post the sy-subrc value

Read only

0 Likes
1,487

Hi Raj,

It's not there... any other clue