‎2008 Jan 24 12:49 PM
Hi
I have developed a bapi in which i'm fetching the data by using some simple select conditions
TABLES: iflot.
DATA: BEGIN OF t_floc OCCURS 0,
tplnr LIKE iflot-tplnr,
tplma LIKE iflot-tplma,
funcloc LIKE alm_me_d997-funcloc,
END OF t_floc.
SELECT buserid atplnr a~tplma
INTO CORRESPONDING FIELDS OF TABLE userid
FROM iflot AS a
INNER JOIN alm_me_d997
AS b
ON atplnr = bfuncloc.
Now the data is being populated in the userid
now i have given userid as mandatory so as the user gives a particular user name then the relevant data should be displayed how to do??
Regards
Nanda
‎2008 Jan 24 12:52 PM
Hello Nanda,
Define an additional input parameter for your BAPI iv_user and change the coding like:
SELECT buserid atplnr a~tplma
INTO CORRESPONDING FIELDS OF TABLE userid
FROM iflot AS a
INNER JOIN alm_me_d997
AS b
ON atplnr = bfuncloc
WHERE b~userid = iv_user.
Regards,
John.
‎2008 Jan 24 12:52 PM
Hello Nanda,
Define an additional input parameter for your BAPI iv_user and change the coding like:
SELECT buserid atplnr a~tplma
INTO CORRESPONDING FIELDS OF TABLE userid
FROM iflot AS a
INNER JOIN alm_me_d997
AS b
ON atplnr = bfuncloc
WHERE b~userid = iv_user.
Regards,
John.
‎2008 Jan 24 12:55 PM
Hi
Thanks for the reply what is this iv_user and where i have to declare this??
‎2008 Jan 24 12:59 PM
‎2008 Jan 24 1:00 PM
Hi,
Unless I didn't get your question: I thought you wanted data for a given user-id or not??
In that case define an input parameter (name whatever you like, but I suggested iv_user of type SYUNAME).
Regards,
John.
‎2008 Jan 24 1:05 PM
No its not a system user name its other username its data will be stored in table alm_me_d997 and its field is userid
Regards
Nanda
‎2008 Jan 24 1:09 PM
If the user gives a user name as Nanda then it has to fetch the Functional location of that particular functional to which he was assigned
the remaining should not be displayed but in my present case i'm getting all the values of each & every user with their fucntional location
Regards
Nanda
‎2008 Jan 24 1:09 PM
Hi,
I'm sorry, but I don't understand your question. You have done a selection and what is the problem?
Regards,
John.
‎2008 Jan 24 1:11 PM
If you add the WHERE statement as I indicated previously you will get only values for records with userid = iv_user :
SELECT buserid atplnr a~tplma
INTO CORRESPONDING FIELDS OF TABLE userid
FROM iflot AS a
INNER JOIN alm_me_d997
AS b
ON atplnr = bfuncloc
WHERE b~userid = iv_user.
John.