‎2006 Dec 03 12:15 PM
Hi All,
i created one bdc for FI Documents postings
during uploading process , i want validate the accounts,if the account exist in the SAP then only create session otherwise display error log file
how to validate the accounts
Plz give me the sample code
i look forward to your reply
Thanks & Regards
SEK
‎2006 Dec 03 12:51 PM
Hi
It depends on which type of account you need to check.
U can do two validations:
- The first one: check if the account exists;
- The second one: check if the account is defined for the company code.
So
- Vendor account: check if It's in LFA1 and LFB1
- Customer account: check if It's in KNA1 and KNB1
- G/L account: check if It's in SKA1 and SKB1
Max
‎2006 Dec 04 10:15 AM
Hi,
thank you for your reply
if anybody have sample code for account validation plz send me
i look forward to your reply
Thanks Regards
SEK
‎2006 Dec 04 10:17 AM
hi,
try:
select count( * ) from knb1 into sy-dbcnt
where kunnr = itab-kunnr
and bukrs = itab-bukrs.
if sy-dbcnt 0.
-> write to error log
A.
Message was edited by:
Andreas Mann
‎2006 Dec 04 11:42 AM
Hi ,
Thank you for your reply
data : begin of itab,
NEWKO1 LIKE BSEG-NEWKO,
NEWKO2 LIKE BSEG-NEWKO,
ENDOF ITAB.
From the Excel sheet we upload the data into ITAB
loop at itab.
Here the validation part comes
itab-newko the uploaded accounts exist in the sap or not
if sy-subrc ne 0. not exist in sap
the move the data to errtab
delete from itab.
endif.
my main problem is how to validate the uploaded accounts is exist in the sap or not
plz send sample code for validation
i look forward to your reply
Thanks & Regards
SEK