2010 Jul 16 2:00 PM
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
2010 Jul 16 2:29 PM
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
2010 Jul 16 2:07 PM
In the tables parameter you are getting BKPF back.. I think you can get document number from this..
2010 Jul 16 2:10 PM
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.
2010 Jul 16 2:29 PM
tables are used for input and output....look at contents of the internal table(s) AFTER your FM call.
2010 Jul 16 2:29 PM
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.
2010 Jul 16 2:35 PM
Thanks for the reply Raj.. Can you please explain a lil more in detail as I am not that familiar with this.
Thanks
2010 Jul 16 2:43 PM
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
2010 Jul 16 2:46 PM
Hi Raj,
I tried this but the problem is the lt_bkpf doesn't have the document number it and hence nothing was retrieved.
2010 Jul 16 2:50 PM
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
2010 Jul 16 2:53 PM
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
2010 Jul 16 3:44 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |