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: 

Reset cleared ıtem FBRA massive z program sample?

Former Member
0 Kudos
753

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?

3 REPLIES 3

raymond_giuseppi
Active Contributor
0 Kudos
234

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)

0 Kudos
234

Is there any sample of usage this functıons?

I need more detail...

thank u raymond

Jay_Dalsaniya
Participant
0 Kudos
234

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'.