on ‎2011 Jul 18 6:19 AM
Hi All,
I am trying to use the following function module FMFR_CREATE_FROM_DATA for posting commitments. I need to know what are the mandatory values and if someone can show an example of working code that calls this function. I also require example of FMFR_CHANGE_FROM_DATA for releasing commitments.
Any help would be greatly appreciated.
Thanks
Request clarification before answering.
Hi.
The answer depends on your FM cusomization.
For example if EMF has external number you should fill BELNR in C_F_HEADDATA and T_POSDATA and vise versa.
Another example: if you defined commitment item as mandatory you should fill FIPOS in T_POSDATA.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Andrey,
When I use TCODE FMZ1 to post commitments I do not require the document number (BELNR). I simply put an amount , text, gl-code and cost center. I then press enter and the other information is derived automatically. I then subsequently press the save button and the commitment document is created. I want to replicate this in the call to the function module with just the above 4 values (ie, amount, text, gl account and cost center). Is this possible? I would also appreciate if you can find ANY working example of a call to this function.
Hi,
I used FI_PSO_EARMARKED_FUNDS_CREATE function to create reservation documents. You can try it. As for mandatory fields, you can fill exactly the same fields which are required in the foreground transaction; this could differ from project to project, as field status could be different for document type of EMF.
Regards,
Eli
Thanks Eli,
I've just succesfully posted a commitment using SE37 (test function module). I was previously using a wrong date in the header. I changed it to todays date and it worked.
I'm going to now try and call it via ABAP code to see if it works. Will post back with the results and sample code.
I was populating the fields with LSMW, so I don't have the 'code' in the pure sense of the word. Though, I can hardly see the problem with this function. You simply have to fill exactly the same fields you would fill for FMZ1 transaction, e.g. document type, number, dates, currency and amount and budget address for items.
Thank Eli,
Filled in the values exactly as in SE37. Works perfectly well. Code snippet as promised given below:-
DATA : loc_it_posdata TYPE STANDARD TABLE OF fmr_interface_det
INITIAL SIZE 1.
DATA : loc_it_rkpf LIKE fmr_interface_head occurs 1.
DATA : wa_rkpf TYPE fmr_interface_head,
wa_posdata TYPE fmr_interface_det.
"Hardcoding header values for testing purposes"
wa_rkpf-bltyp = '050'.
wa_rkpf-blart = '11'.
wa_rkpf-bldat = sy-datum.
wa_rkpf-budat = sy-datum.
wa_rkpf-waers = 'BHD'.
wa_rkpf-bukrs = 'CCN1'.
wa_rkpf-ktext = 'Test function from abap'.
"Hardcoding Detail values for testing purposes"
wa_posdata-blpos = '001'.
wa_posdata-wrbtr = '20.000'.
wa_posdata-ptext = 'Test abap'.
wa_posdata-kostl = '0000074990'.
wa_posdata-saknr = '0000240591'.
APPEND wa_posdata TO loc_it_posdata.
CALL FUNCTION 'FMFR_CREATE_FROM_DATA'
EXPORTING
i_flg_checkonly = space
i_flg_commit = 'X'
TABLES
t_posdata = loc_it_posdata
CHANGING
c_f_headdata = wa_rkpf
EXCEPTIONS
doctype_not_allowed = 1
error_occured = 2
OTHERS = 3.
error_message = 1.
| User | Count |
|---|---|
| 26 | |
| 13 | |
| 10 | |
| 4 | |
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.