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