09-21-2008 12:45 PM
is there any fm to retrieve the company code of vendor and customer?I dnt want to retriev the extended company codes, only the company code where it was created first time
09-21-2008 7:26 PM
hi Sia,
I think you have to make a select on table LFB1 (vendors) or KNB1 (customers) and check for the lowest creation date (I guess the field is ERDAT, but I am not sure and cannot check it right now). It will be a something like this:
SELECT bukrs erdat
FROM lfb1
INTO gt_...
WHERE lifnr EQ ....
SORT gt_... BY erdat.
READ TABLE gt_... INTO gw_... INDEX 1.
gw_...-bukrs "This is the Company code you'll need
hope this helps
ec
09-21-2008 12:53 PM
Hi,
BAPI_COMPANYCODE_GET_PERIOD
HRPP_COMPANYCODE_GET_PERIOD
Regards,
Harish
09-21-2008 7:26 PM
hi Sia,
I think you have to make a select on table LFB1 (vendors) or KNB1 (customers) and check for the lowest creation date (I guess the field is ERDAT, but I am not sure and cannot check it right now). It will be a something like this:
SELECT bukrs erdat
FROM lfb1
INTO gt_...
WHERE lifnr EQ ....
SORT gt_... BY erdat.
READ TABLE gt_... INTO gw_... INDEX 1.
gw_...-bukrs "This is the Company code you'll need
hope this helps
ec