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

Posting FI documents using BAPI

Former Member
0 Likes
988

Hi All,

I need to park and post the FI document as per the below example based on the posting keys dynamically .

The code which I have shown below is written for posting keys 40,50,21and 31 which is hardcoded.

But this should not be the case .Could you please provide me the solution how to handle the posting keys dynamically to post the FI document using BAPI.

For the below example shown:

REC REC_LINK PO ACCOUNT COMP AMOUNT COSTCENTER PROFIT ASSMT_FLD SGTXT

L01 12345 40 1000000001 1000 100.00 ITEM TEXT TEST - ROW 1

L02 12345 40 1000000002 1000 100.00 ITEM TEXT TEST - ROW 1

L03 12345 40 1000000003 1000 100.00 ITEM TEXT TEST - ROW 1

L04 12345 40 1000000004 1000 100.00 ITEM TEXT TEST - ROW 1

L05 12345 31 1000000000 1000 400.00 ITEM TEXT TEST - ROW 2

Step1:

W e need to compare all the line items of 40 with 50 at once

(L01L02L03+L04) = L01 of 50.

(100100100+100) = 400.

Step2:

Split each line item of posting key 40 and compare with the offset posting key 31.

Every line item of posting key 40 (L01,L02,L03,L04) has to match with posting key L05

EX:

40 à L01 u2013 L05 = 100 -100

L02 u2013 L05 = 100 -100

L03 u2013 L05 = 100 -100

L04 u2013 L05 = 100 -100

For Every single line item there will be only one offset posting key u2013 31 ( In this case)

So we need to call BAPI 4 times for 4 separate entries.

All these posting keys should be handled dynamically.

The Code which i have written : I have created the RFC-FM which informatical will call this FM .

<Garbled code removed by moderator>

Thank you.

Regards,

Bharat

Edited by: Vinod Kumar on Jan 24, 2012 11:08 AM

1 ACCEPTED SOLUTION
Read only

former_member544878
Participant
0 Likes
891

Hi,

Posting key for Document posted is decided by 'ACCOUNTGL' or ACCOUNTRECEIVABLE or ACCOUNTPAYABLE .

you don't want to enter 40, 50 for this .

Thanks,

Rehan

3 REPLIES 3
Read only

Tamas_Hoznek
Product and Topic Expert
Product and Topic Expert
0 Likes
891

You may want to use the proper tags when posting any program code...

Read only

former_member544878
Participant
0 Likes
892

Hi,

Posting key for Document posted is decided by 'ACCOUNTGL' or ACCOUNTRECEIVABLE or ACCOUNTPAYABLE .

you don't want to enter 40, 50 for this .

Thanks,

Rehan

Read only

nirajgadre
Active Contributor
0 Likes
891

HI Bharat,

The posting key of FI document is decided on the account tye (K) or (S) and also debit creadit indicator (CR/DR).

So based on the GL ACCOUNT number/ account type and DR/CR indicator you need to decide the posting key for the same.