Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Bapi

Former Member
0 Likes
835

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
797

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.

8 REPLIES 8
Read only

Former Member
0 Likes
798

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.

Read only

0 Likes
797

Hi

Thanks for the reply what is this iv_user and where i have to declare this??

Read only

0 Likes
797

Hi

Plz reply me

Read only

0 Likes
797

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.

Read only

0 Likes
797

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

Read only

0 Likes
797

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

Read only

0 Likes
797

Hi,

I'm sorry, but I don't understand your question. You have done a selection and what is the problem?

Regards,

John.

Read only

0 Likes
797

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.