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

G/L Document Comparing and Posting

Former Member
0 Likes
909

I am developed a ALV report, wherein the requirement is i have many columns but out of which i have 3 major columns, 1 column is for Invoice Amount(wherein i am able to pick the wrbtr data of bseg) and 2nd colums is pmt made by customer(editable column) and 3rd is pending payment(1st col-2nd column).

This report is basically for collection recevied from customer, when end user enters the data in pmt recvd then automatically my 3rd colm is getting updated. For doing this i have created a button on application toolbar "POSTING" . so that when user selects rows from alv and clicks on POSTING button then the contents of these rows will go and fit into the F-28, for this i have recorded F-28 and here in f-28, the document number column is a read only column in table control, here i need to compare document number(selected from row) and document number of F-28 for correctly posting the payments like Complete Payment, Partial Payment and Residual Payment. But i could not able to do so? I am not able to compare selected row belnr with table control belnr (RFOPS_DK-BELNR) as this is a strucutre and no non-editable field.

Secondly, if i am trying to post the document through BAPI_ACC_DOCUMENT_POST, i am getting the following error.

E - RW - 609 - Error in document: BKPFF $ PEDCLNT710

E - RW - 014 - FI/CO interface: Line item entered several times.

However, in HEADER i am entering OBJ_TYPE = BKPFF, OBJ_KEY = $ AND OBJ_SYS = PDCLNT710

Can any experts, who has already faced such issues can post the solution. <removed by moderator>

In Adv Thanks

A Sustainer

Edited by: Thomas Zloch on Sep 9, 2011 7:32 PM

3 REPLIES 3
Read only

Former Member
0 Likes
682

Hi

A) Instead of to use a BDC based on F-28 you can use the fm POSTING_INTERFACE_CLEARING

B) I don't know which kind of accounting document you're trying to post by BAPI, but you don't need to fill those fields (OBJ_TYPE, OBJ_KEY, OBJ_SYS)

Max

Read only

Former Member
0 Likes
682

HI Max, I am using the following code.

REPORT ZRFBIBL00.

PARAMETERS: p_mode TYPE char01 DEFAULT 'A',

p_bukrs TYPE bkpf-bukrs,

p_kunnr TYPE kna1-kunnr,

p_doc1 TYPE bkpf-belnr,

p_doc2 TYPE bkpf-belnr.

CALL FUNCTION 'POSTING_INTERFACE_START'

EXPORTING

  • I_CLIENT = SY-MANDT

i_function = 'C'

  • I_GROUP = ' '

  • I_HOLDDATE = ' '

  • I_KEEP = ' '

I_MODE = p_mode

  • I_UPDATE = 'S'

I_USER = sy-uname

  • I_XBDCC = ' '

EXCEPTIONS

CLIENT_INCORRECT = 1

FUNCTION_INVALID = 2

GROUP_NAME_MISSING = 3

MODE_INVALID = 4

UPDATE_INVALID = 5

OTHERS = 6.

IF sy-subrc NE 0.

EXIT.

ENDIF.

DATA: l_auglv TYPE T041A-AUGLV VALUE 'EINGZAHL', "Posting with Clearing

l_tcode TYPE sy-tcode VALUE 'FB05', "You get an error with any other value

l_sgfunct TYPE RFIPI-SGFUNCT VALUE 'C'. "Post immediately

DATA: lt_blntab TYPE STANDARD TABLE OF BLNTAB WITH HEADER LINE,

lt_ftclear TYPE STANDARD TABLE OF ftclear WITH HEADER LINE,

lt_ftpost TYPE STANDARD TABLE OF ftpost WITH HEADER LINE,

lt_fttax TYPE STANDARD TABLE OF fttax WITH HEADER LINE.

  • Batch Input Values

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 = 'DA'. "Same type as documents cleared via F-32

APPEND lt_ftpost.

lt_ftpost-fnam = 'BSEG-BETRG'.

lt_ftpost-fval = '7000'.

append lt_ftpost.

*lt_ftpost-fnam = 'RF05A-NEWBS'.

*lt_ftpost-fval = 40.

*APPEND lt_ftpost.

*

*lt_ftpost-fnam = 'RF05A-NEWKO'.

*lt_ftpost-fval = 208024.

*APPEND lt_ftpost.

  • Documents to be cleared

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.

lt_ftclear-selvon = p_doc2.

lt_ftclear-selbis = p_doc2.

APPEND lt_ftclear.

CALL FUNCTION 'POSTING_INTERFACE_CLEARING'

EXPORTING

i_auglv = l_auglv

i_tcode = l_tcode

I_SGFUNCT = l_sgfunct

  • I_NO_AUTH = ' '

  • IMPORTING

  • E_MSGID =

  • E_MSGNO =

  • E_MSGTY =

  • E_MSGV1 =

  • E_MSGV2 =

  • E_MSGV3 =

  • E_MSGV4 =

  • E_SUBRC =

tables

t_blntab = lt_blntab

t_ftclear = lt_ftclear

t_ftpost = lt_ftpost

t_fttax = lt_fttax

EXCEPTIONS

CLEARING_PROCEDURE_INVALID = 1

CLEARING_PROCEDURE_MISSING = 2

TABLE_T041A_EMPTY = 3

TRANSACTION_CODE_INVALID = 4

AMOUNT_FORMAT_ERROR = 5

TOO_MANY_LINE_ITEMS = 6

COMPANY_CODE_INVALID = 7

SCREEN_NOT_FOUND = 8

NO_AUTHORIZATION = 9

OTHERS = 10.

IF sy-subrc NE 0.

RETURN.

ENDIF.

CALL FUNCTION 'POSTING_INTERFACE_END'

EXPORTING

I_BDCIMMED = 'X'

  • I_BDCSTRTDT = NO_DATE

  • I_BDCSTRTTM = NO_TIME

EXCEPTIONS

SESSION_NOT_PROCESSABLE = 1

OTHERS = 2.

IF sy-subrc NE 0.

RETURN.

ENDIF.

But in the above code, i am not able to pass the Amount for a particular document, Could you please let me know from the following tables, which table field can carry the amount for a document, which i passing from my alv report, which then decide whether its complete payment, partial amount or residual payment by comparing the amount of my alv report with the amount of the document (f-28) screen.

t_blntab

t_ftclea

t_ftpost

t_fttax

Will be very thankful, if you revert.

Thanks,

A Sustainer

Read only

Former Member
0 Likes
682

Please ignore the following lines of code from the code just pasted in the previous post, few moments back.

lt_ftpost-fnam = 'BSEG-BETRG'.

lt_ftpost-fval = '7000'.

append lt_ftpost.