cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

FB05 Clearing by Doc number + Fiscal Year

sachin_thombre
Participant
6,109

Hello All,

For a Custom Program, we are calling FB05 T code for clearing.

Issue:

There are some cases where same document number is repeated into multiple fiscal years, hence using FB05 and document number, we get 2-3 documents and program goes into error - Difference too large for clearing since we want the clearing to happen only for 1 document number as per fiscal year.

Do you know how I can limit the selection with Document number + Fiscal year so that multiple doc numbers are not displayed

Accepted Solutions (1)

Accepted Solutions (1)

Filipe_Magalhaes
Product and Topic Expert
Product and Topic Expert

Hello Sachin,

Normally you should use, in the Document to be cleared field (eg. SLVON_1), the following format: DDDDDDDDDDYYYYIII - Eg. 01000023452023001 (Item 1 of document 0100002345 in 2023).

As you can find the program RFBIBL00 documentation:

Post with clearing (FB05)

For transaction FB05, in addition to the header record (BBKPF) and possibly line items (BBSEG), the selection header data (BSELK) and the selection items (BSELP) must be transferred. The data for BBSEG must be transferred before BSELK and BSELP for technical reasons.

Up to 18 selection items can be transferred in a BSELP structure. If this is not sufficient, then further BSELP structures can be transferred.

You can also use a BSELP structure to select a specific line item in the form <document no.><fiscal year><line item no.>.

The document number must have 10 characters and the line item 3, and the preceding zeroes should also be entered.

Example: Selecting the third line of document 0000222222 from fiscal year yyyy.

      BSELP-FELDN_1 = "BELNR"
        BSELP-SLVON_1 = "0000222222yyyy003"

      Hope this helps.

      BR,

      Filipe

      sachin_thombre
      Participant
      0 Kudos

      filipe.magalhes

      I am not able to find the field [Document to be cleared field (eg. SLVON_1)] that you mentioned.

      In FB05 -> Process Open Items -> Document Number, I can see only 10 digits available for inputs.

      Can you please share the screenshot which field you are referring to?

      Filipe_Magalhaes
      Product and Topic Expert
      Product and Topic Expert

      Hi sachin.thombre,

      If you are creating a custom program for FB05 you should use/call RFBIBL00 program to do the clearing. In this program, you can find structure BSELP, where you can find the fields to fill for clearing, eg.:

        BSELP-FELDN_1 = "BELNR"
          BSELP-SLVON_1 = "0000222222yyyy003"
        1. You can even create an LSMW calling this program - please consider this example. The only adjustment needed from this example to your use case is to consider also structure BSELP, which you can easily map similarly as in steps 4 and 5.

        I hope this helps.

        BR,

        Filipe

          sachin_thombre
          Participant
          0 Kudos

          filipe_magalhaes Thank you so much for your response. I got it...

          mack_bai_2023
          Discoverer

          this is very helpful, thanks~

          Carlos-Gaytan
          Newcomer
          0 Kudos

          Hi filipe.magalhes,

          I have the same problem and tried to create the LSMW with some problems but made to follow step by step

          At the end into the last point I got the message FB013 The treatment was cancelled

          CarlosGaytanCDMX69_1-1751556393861.png

          CarlosGaytanCDMX69_2-1751556422187.png

          CarlosGaytanCDMX69_0-1751556357189.png

          CarlosGaytanCDMX69_3-1751556443292.png

          To get the error run in foregrownd and see that the program considered FB01 and not FB05.

          CarlosGaytanCDMX69_0-1751566720290.png

          Any suggestions?

          B&R,

          Carlos Gaytan

          Answers (0)