2008 May 08 7:52 AM
Dear All,
I need to retrive login id field from an Logon input field, and I need to compare with Kna1-Kunnar whether it is External user or Internal User.
What is the logic for this, Is there any existing BAPI or FM..
Regards,
Maruti
2008 May 08 8:15 AM
Hi,
Structure field SYST-UNAME will contain the login id of the user at any point of time.
you can compare this field with USR21-BNAME
take the USR21-ADDRNUMBER
check this entry in KNA1-ADRNR..if record found then its External user else its Internal User.
Regards,
Rahul
2008 May 08 8:04 AM
Hi Maruti,
You can get the logon user name from sy-uname. And then can check in USR02 table whether its external or internal user.
Hope this information helps you.
2008 May 08 8:18 AM
Thanks for ur inputs,,
But here i need to retrive user login id from NON-SAP field entry, which i should map to internal table(This i done).
Now i need to compare with internal table field value(cust id) with KNA1-KUNNR. and if it is matching itab with kna1-kunnr then it is external id if not that is internal id.
This is the concept...I need logic for this.
Regards,
Maruti
2008 May 08 8:15 AM
Hi,
Structure field SYST-UNAME will contain the login id of the user at any point of time.
you can compare this field with USR21-BNAME
take the USR21-ADDRNUMBER
check this entry in KNA1-ADRNR..if record found then its External user else its Internal User.
Regards,
Rahul
2008 May 08 8:28 AM
Hi,
I guess the internal table you are talking about is declared with the cust id as that of the kna1-kunnr form.
If that is the case you can try with the select query for kna1
I mean
data : (declare you internal table here 'itab')
data : wa_itab like itab.
loop at itab into wa_itab.
select single * from kna1
where kunnr = wa_itab-custid.
if sy-sybrc = 0.
(int customer)
else.
(ext customer)
endif.
endloop.
Try this.
Reward if useful.
Regards,
Anu.