Application Development and Automation 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: 
Read only

FB05 with POSTING_INTERFACE_CLEARING

Former Member
0 Likes
7,748

Hi All ,

I am tryiogn to post and clear invoice with incoming customer payments with FM POSTING_INTERFACE_CLEARING.

lt_ftpost-stype = 'K'."Header

lt_ftpost-count = '1'. "number of Dynpro

lt_ftpost-fnam = 'BKPF-BLDAT'.

CONCATENATE sy-datum6(2) sy-datum4(2) sy-datum(4) INTO lt_ftpost-fval SEPARATED BY '.'.

APPEND lt_ftpost.

lt_ftpost-fnam = 'BKPF-BUDAT'.

CONCATENATE sy-datum6(2) sy-datum4(2) sy-datum(4) INTO lt_ftpost-fval SEPARATED BY '.'.

APPEND lt_ftpost.

lt_ftpost-fnam = 'BKPF-BLART'.

lt_ftpost-fval = 'DZ'. "Same type as documents cleared via F-32

APPEND lt_ftpost.

lt_ftpost-stype = 'P'.

lt_ftpost-count = '2' .

lt_ftpost-fnam = 'RF05A-NEWBS'.

lt_ftpost-fval = '40'.

APPEND lt_ftpost.

lt_ftpost-fnam = 'BSEG-HKONT'.

lt_ftpost-fval = '113100' .

APPEND lt_ftpost.

lt_ftpost-fnam = 'BSEG-WRBTR'.

lt_ftpost-fval = '5000'.

APPEND lt_ftpost.

lt_ftclear-agkoa = 'D'. "Account Type

lt_ftclear-xnops = 'X'. "Indicator: Select only open items which are not special G/L?

lt_ftclear-agbuk = p_bukrs. "Example company code

lt_ftclear-agkon = p_kunnr. "Example Customer

lt_ftclear-selfd = 'BELNR'."Selection Field

lt_ftclear-selvon = p_doc1.

lt_ftclear-selbis = p_doc1.

APPEND lt_ftclear.

It does notthing but when comment lines for 'RF05A-NEWBS', 'BSEG-HKONT' , 'BSEG-WRBTR' and run in 'A' mode and check the screens in foreground it throws error "diffrence is too large " which is obvious as i am not passing any amount .

I would like to know how I can pass NEWBS(posting key), HKONT and WRBTR and do an incoming positng.

I went through severe search and could not find help so I guess any links would not help me .

Any alternative suggestion to acheive will also be helpfull .

Thanks in Advance

Regards

Vinay

8 REPLIES 8
Read only

andreas_mann3
Active Contributor
0 Likes
2,976

Hi,

here's a sample from creating clearing document with report RFBIBL00 for tc ode FB05:

..
PERFORM INIT_BSELK(RFBIBLI0) USING BSELK.
PERFORM INIT_BSELP(RFBIBLI0) USING BSELP.

...
*create header
FORM PROCESS_AUGL.

  XBKPF = BBKPF.

  MOVE: 'FB05' TO XBKPF-TCODE.
  MOVE <F>-KEY-BUKRS TO XBKPF-BUKRS.
  MOVE BU_BLART TO XBKPF-BLART.

  CONCATENATE SY-DATUM+6(2) SY-DATUM+4(2) SY-DATUM(4)
              INTO XBKPF-BLDAT.
  CONCATENATE SY-DATUM+6(2) SY-DATUM+4(2) SY-DATUM(4)
              INTO XBKPF-BUDAT.

  MOVE <F>-WAERS TO XBKPF-WAERS.
  XBKPF-AUGLV = 'UMBUCHNG'.
  TRANSFER XBKPF TO FILE.
  ADD 1 TO CNT_TA.
  ADD 1 TO CNT_IN.

*
  XSELK = BSELK.
  XSELK-AGKON = <F>-KEY-KUNNR.
  XSELK-AGBUK = <F>-KEY-BUKRS.
  XSELK-AGKOA = 'D'.
  XSELK-XNOPS = 'X'.

  TRANSFER XSELK TO FILE.
  ADD 1 TO CNT_IN.



ENDFORM.                 
.

and

.

*clearing posten 
  SORT TAUGL.
  LOOP AT TAUGL ASSIGNING <F>.

    AT NEW KEY.
      PERFORM PROCESS_AUGL.
    ENDAT.

    XSELP = BSELP.
    XSELP-FELDN_1 = 'SGTXT'.
    MOVE  <F>-SGTXT TO XSELP-SLVON_1.

    TRANSFER XSELP TO FILE.
    ADD 1 TO CNT_IN.

  ENDLOOP.


..

hope that helps

Andreas

Read only

0 Likes
2,976

Hi Andreas

Thanks for your reply ,

I actually looked at it and found it does not cater for residual items and partial payments , Where as from my investigation and search I found that with Fm POSTING_INTERFACE_CLEARING we can do a partial or residual .

Any other input will be appreciated .

Thanks

Vinay

Read only

Former Member
0 Likes
2,976

Hi Vinay,

Based on your explanation it sounds to me that the invoice item to be cleared cannot be determined. Since you only use the accounting document number as a search, at least I assume that is what is in the <p_doc1>, it cannot determine the invoice item as the accounting document number is a combination of year document item (<GJAHR><BELNR><BUZEI>).

So what you will need to do is prefix <p_doc1> with year and suffix with the item no.:

 write: bsid_tab-gjahr(4) to ftclear-selvon+10,
         bsid_tab-buzei(3) to ftclear-selvon+14.

(copied from SAPF103).

Hope that this does the trick...

Kind regards and good luck,

Robert

Read only

0 Likes
2,976

Hi RJ ,

Thanks for your reply ,

I actually need to know how I can pass NEWBS , HKONT ,WRBTR to function module POSTING_INTERFACE_CLEARING.

Thanks

Vinay

Read only

0 Likes
2,976

Hi All ,

Thanks for respsones .

I have tested with BDC recording on f-28 its very simple and seem to work quite nice .Can quite easily record the residual payment and partial payment

keeping this thread open unitll actaul development is done with complete requirement from client .

Thanks

Vinay

Edited by: vinay kolla on Jan 21, 2011 12:37 AM

Read only

0 Likes
2,976

Hi Vinay,

- NEWBS

FNAM = RF05A-NEWBS

FVAL = 'Posting Key'

- HKONT

FNAM = RF05A-NEWKO

FVAL = 'G/L Account'

- WRBTR

FNAM = BSEG-WRBTR

FVAL = 'Amount'

Pass those fields to table T_FTPOST.

Read only

0 Likes
2,976

Hello Vinay,

I am also trying to post residual items by going through FB05.  As you mentionned above, does the function module 'POSTING_INTERFACE_CLEARING' cater for posting residual items?

OR only BDC recording will work for this particular requirement?

Really appreciate if you could answer asap.

Thanks in advance

Regards,

Thyaga

Read only

Former Member
0 Likes
2,976

Ammend lt_ftpost-count = '1' .

That should do the trick.