2014 Apr 28 12:47 PM
hi experts,
I want to create zprogram which can reset mass documents but ı couldnt fınd any sample about that?
I just explored original S* program (FBRA) but it has so much ınclude ,its lookng really hard to turn it massive
So Is there anyone who can gıve me some advice about that?
Any help will be appriciated...
Thank u?
2014 Apr 28 1:02 PM
Look at those FM : POSTING_INTERFACE_RESET_CLEAR (*) or CALL_FBRA.
Regards,
Raymond
(*) Between call of POSTING_INTERFACE_START (before) and POSTING_INTERFACE_END (after)
2014 May 07 9:05 AM
Is there any sample of usage this functıons?
I need more detail...
thank u raymond
2021 Jan 05 7:12 AM
For a basic functioning, you would need 1 company code and 1 fiscal year and all other multiple documents which belongs to this company code and fiscal year.
Once the input is provided, you will need to loop through all the documents and reset each at a time. Sample code below:
LOOP AT s_augbl INTO DATA(ls_augbl).
CALL FUNCTION 'CALL_FBRA'
EXPORTING
i_bukrs = s_bukrs-low
i_augbl = ls_augbl-low
i_gjahr = s_gjahr-low
IMPORTING
e_xstor = lv_cancl_required
EXCEPTIONS
not_possible = 1
OTHERS = 2.
IF sy-subrc <> 0. "Failed to reset the document
ENDIF.
ENDLOOP.
While resetting, one of the step is called in the update task in standard code. So if anything goes wrong and we need to know the error message, we need to fetch it from the memory. I had used below code to do so.
DATA:
lv_bukrs TYPE bkpf-bukrs,
lv_belnr TYPE bkpf-belnr,
lv_gjahr TYPE bkpf-gjahr.
IMPORT
bkpf-bukrs TO lv_bukrs
bkpf-belnr TO lv_belnr
bkpf-gjahr TO lv_gjahr
msg TO lt_msg FROM DATABASE rfdt(ra) ID 'FBRA'.